mirror of
				https://github.com/go-task/task.git
				synced 2025-10-30 23:58:01 +02:00 
			
		
		
		
	feat: add spew function to templater (#1452)
This commit is contained in:
		
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							| @@ -4,6 +4,7 @@ go 1.20 | ||||
|  | ||||
| require ( | ||||
| 	github.com/Masterminds/semver/v3 v3.2.1 | ||||
| 	github.com/davecgh/go-spew v1.1.1 | ||||
| 	github.com/fatih/color v1.16.0 | ||||
| 	github.com/go-task/slim-sprig/v3 v3.0.0 | ||||
| 	github.com/joho/godotenv v1.5.1 | ||||
| @@ -22,7 +23,6 @@ require ( | ||||
| ) | ||||
|  | ||||
| require ( | ||||
| 	github.com/davecgh/go-spew v1.1.1 // indirect | ||||
| 	github.com/klauspost/cpuid/v2 v2.0.9 // indirect | ||||
| 	github.com/mattn/go-colorable v0.1.13 // indirect | ||||
| 	github.com/mattn/go-isatty v0.0.20 // indirect | ||||
|   | ||||
| @@ -9,6 +9,8 @@ import ( | ||||
| 	"mvdan.cc/sh/v3/shell" | ||||
| 	"mvdan.cc/sh/v3/syntax" | ||||
|  | ||||
| 	"github.com/davecgh/go-spew/spew" | ||||
|  | ||||
| 	sprig "github.com/go-task/slim-sprig/v3" | ||||
| ) | ||||
|  | ||||
| @@ -52,6 +54,9 @@ func init() { | ||||
| 		"relPath": func(basePath, targetPath string) (string, error) { | ||||
| 			return filepath.Rel(basePath, targetPath) | ||||
| 		}, | ||||
| 		"spew": func(v any) string { | ||||
| 			return spew.Sdump(v) | ||||
| 		}, | ||||
| 	} | ||||
| 	// Deprecated aliases for renamed functions. | ||||
| 	taskFuncs["FromSlash"] = taskFuncs["fromSlash"] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user