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_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gomplate_test.go') diff --git a/gomplate_test.go b/gomplate_test.go index 2485e7af..62ae4525 100644 --- a/gomplate_test.go +++ b/gomplate_test.go @@ -12,6 +12,7 @@ import ( "github.com/hairyhenderson/gomplate/v4/conv" "github.com/hairyhenderson/gomplate/v4/data" "github.com/hairyhenderson/gomplate/v4/env" + "github.com/hairyhenderson/gomplate/v4/internal/parsers" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -73,7 +74,7 @@ func TestEc2MetaTemplates_WithJSON(t *testing.T) { Funcs: template.FuncMap{ "ec2meta": ec2meta.Meta, "ec2dynamic": ec2meta.Dynamic, - "json": data.JSON, + "json": parsers.JSON, }, }) @@ -84,7 +85,7 @@ func TestEc2MetaTemplates_WithJSON(t *testing.T) { func TestJSONArrayTemplates(t *testing.T) { g := NewRenderer(Options{ Funcs: template.FuncMap{ - "jsonArray": data.JSONArray, + "jsonArray": parsers.JSONArray, }, }) @@ -95,8 +96,8 @@ func TestJSONArrayTemplates(t *testing.T) { func TestYAMLTemplates(t *testing.T) { g := NewRenderer(Options{ Funcs: template.FuncMap{ - "yaml": data.YAML, - "yamlArray": data.YAMLArray, + "yaml": parsers.YAML, + "yamlArray": parsers.YAMLArray, }, }) @@ -108,7 +109,7 @@ func TestYAMLTemplates(t *testing.T) { func TestHasTemplate(t *testing.T) { g := NewRenderer(Options{ Funcs: template.FuncMap{ - "yaml": data.YAML, + "yaml": parsers.YAML, "has": conv.Has, }, }) -- cgit v1.2.3