From cec23e66f9bd5022845162ae4dd3f2633b5236fa Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sat, 28 May 2022 19:24:48 -0400 Subject: General refactoring & cleanup Signed-off-by: Dave Henderson --- context.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'context.go') diff --git a/context.go b/context.go index 3d8bebe5..6c2f04a2 100644 --- a/context.go +++ b/context.go @@ -6,7 +6,6 @@ import ( "strings" "github.com/hairyhenderson/gomplate/v3/data" - "github.com/hairyhenderson/gomplate/v3/internal/config" ) // context for templates @@ -22,10 +21,11 @@ func (c *tmplctx) Env() map[string]string { return env } -func createTmplContext(ctx context.Context, contexts map[string]config.DataSource, d *data.Data) (interface{}, error) { +// createTmplContext reads the datasources for the given aliases +func createTmplContext(ctx context.Context, aliases []string, d *data.Data) (interface{}, error) { var err error tctx := &tmplctx{} - for a := range contexts { + for _, a := range aliases { if a == "." { return d.Datasource(a) } -- cgit v1.2.3