summaryrefslogtreecommitdiff
path: root/context.go
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2022-05-28 19:24:48 -0400
committerDave Henderson <dhenderson@gmail.com>2022-05-28 19:49:42 -0400
commitcec23e66f9bd5022845162ae4dd3f2633b5236fa (patch)
treef5caf83d0c92ce80942b2e7ed5e184ffb69e3c2d /context.go
parente00015a86393e947757dea88cb82b328b35ad8b4 (diff)
General refactoring & cleanup
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'context.go')
-rw-r--r--context.go6
1 files changed, 3 insertions, 3 deletions
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)
}