diff --git a/internal/config/config.go b/internal/config/config.go index fdcda54..d36e405 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -38,6 +38,7 @@ type Result struct { Templates map[string]ast.Variable } +// LoadExtras attemps to load any additional vars func LoadExtras(args []string) (map[string]ast.Variable, error) { extras := make(map[string]ast.Variable) for _, extra := range args { diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 302cd74..d0b9f2d 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -121,10 +121,10 @@ func TestPrepareVariables(t *testing.T) { func TestLoadExtras(t *testing.T) { testCases := []struct { - desc string - args []string + desc string + args []string expectation map[string]ast.Variable - error bool + error bool }{ { "successfully load vars", @@ -132,7 +132,7 @@ func TestLoadExtras(t *testing.T) { map[string]ast.Variable{ "var.i": { Value: "foo", - Type: ast.TypeString, + Type: ast.TypeString, }, }, false, @@ -162,7 +162,7 @@ func TestLoadConfigFiles(t *testing.T) { testCases := []struct { description string filenames []string - extras map[string]ast.Variable + extras map[string]ast.Variable result *Result error bool }{ @@ -216,7 +216,7 @@ func TestLoadConfigFiles(t *testing.T) { map[string]ast.Variable{ "var.h": { Value: "foo", - Type: ast.TypeString, + Type: ast.TypeString, }, }, &Result{ @@ -227,7 +227,7 @@ func TestLoadConfigFiles(t *testing.T) { }, "var.h": { Value: "foo", - Type: ast.TypeString, + Type: ast.TypeString, }, }, Templates: map[string]ast.Variable{ diff --git a/internal/interpolation/encoding_test.go b/internal/interpolation/encoding_test.go index 0fff67b..4efd730 100644 --- a/internal/interpolation/encoding_test.go +++ b/internal/interpolation/encoding_test.go @@ -52,7 +52,7 @@ func TestInterpolationFuncJSONEncode(t *testing.T) { }, { description: "Advanced list encoding", - text: `${jsonencode(list(map("foo", "bar")))}`, + text: `${jsonencode(list(map("foo", "bar")))}`, expectation: `[{"foo":"bar"}]`, }, {