diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2022-05-28 19:24:48 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2022-05-28 19:49:42 -0400 |
| commit | cec23e66f9bd5022845162ae4dd3f2633b5236fa (patch) | |
| tree | f5caf83d0c92ce80942b2e7ed5e184ffb69e3c2d /context.go | |
| parent | e00015a86393e947757dea88cb82b328b35ad8b4 (diff) | |
General refactoring & cleanup
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'context.go')
| -rw-r--r-- | context.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) } |
