From 0ac3aa24bf2e4ada9c26fd9ef5b7f0ae8c6b6cfb Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Mon, 22 Jan 2024 09:06:33 -0500 Subject: Use go-fsimpl to read from datasources (#1336) * Use go-fsimpl to read from datasources Signed-off-by: Dave Henderson * trying to fix windows bug Signed-off-by: Dave Henderson * attempts to fix some of the path madness Signed-off-by: Dave Henderson * remove 'HOME' from expected env vars Signed-off-by: Dave Henderson * more tweaks Signed-off-by: Dave Henderson * lint fix Signed-off-by: Dave Henderson --------- Signed-off-by: Dave Henderson --- gomplate.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gomplate.go') diff --git a/gomplate.go b/gomplate.go index f95dc2a3..b1312a34 100644 --- a/gomplate.go +++ b/gomplate.go @@ -11,8 +11,8 @@ import ( "text/template" "time" - "github.com/hairyhenderson/gomplate/v4/data" "github.com/hairyhenderson/gomplate/v4/internal/config" + "github.com/hairyhenderson/gomplate/v4/internal/datafs" ) // RunTemplates - run all gomplate templates specified by the given configuration @@ -46,7 +46,7 @@ func Run(ctx context.Context, cfg *config.Config) error { } // if a custom Stdin is set in the config, inject it into the context now - ctx = data.ContextWithStdin(ctx, cfg.Stdin) + ctx = datafs.ContextWithStdin(ctx, cfg.Stdin) opts := optionsFromConfig(cfg) opts.Funcs = funcMap @@ -87,7 +87,6 @@ func simpleNamer(outDir string) func(ctx context.Context, inPath string) (string func mappingNamer(outMap string, tr *Renderer) func(context.Context, string) (string, error) { return func(ctx context.Context, inPath string) (string, error) { - tr.data.Ctx = ctx tcontext, err := createTmplContext(ctx, tr.tctxAliases, tr.data) if err != nil { return "", err -- cgit v1.2.3