diff --git a/go.mod b/go.mod index a0a9f83e..bbc15cba 100644 --- a/go.mod +++ b/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 diff --git a/internal/templater/funcs.go b/internal/templater/funcs.go index c6c7eb0b..2ba524b1 100644 --- a/internal/templater/funcs.go +++ b/internal/templater/funcs.go @@ -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"]