Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cam-stitt committed Feb 3, 2022
1 parent a64b888 commit d1d23cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 7 additions & 7 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ 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",
[]string{`{"i": "foo"}`},
map[string]ast.Variable{
"var.i": {
Value: "foo",
Type: ast.TypeString,
Type: ast.TypeString,
},
},
false,
Expand Down Expand Up @@ -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
}{
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestLoadConfigFiles(t *testing.T) {
map[string]ast.Variable{
"var.h": {
Value: "foo",
Type: ast.TypeString,
Type: ast.TypeString,
},
},
&Result{
Expand All @@ -227,7 +227,7 @@ func TestLoadConfigFiles(t *testing.T) {
},
"var.h": {
Value: "foo",
Type: ast.TypeString,
Type: ast.TypeString,
},
},
Templates: map[string]ast.Variable{
Expand Down
2 changes: 1 addition & 1 deletion internal/interpolation/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}]`,
},
{
Expand Down

0 comments on commit d1d23cb

Please # to comment.