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 --- context_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'context_test.go') diff --git a/context_test.go b/context_test.go index aa3a4468..c8885a47 100644 --- a/context_test.go +++ b/context_test.go @@ -6,7 +6,9 @@ import ( "os" "testing" + "github.com/hairyhenderson/go-fsimpl" "github.com/hairyhenderson/gomplate/v4/data" + "github.com/hairyhenderson/gomplate/v4/internal/datafs" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -31,6 +33,11 @@ func TestCreateContext(t *testing.T) { require.NoError(t, err) assert.Empty(t, c) + fsmux := fsimpl.NewMux() + fsmux.Add(datafs.EnvFS) + + ctx = datafs.ContextWithFSProvider(ctx, fsmux) + fooURL := "env:///foo?type=application/yaml" barURL := "env:///bar?type=application/yaml" uf, _ := url.Parse(fooURL) -- cgit v1.2.3