refactor: rename Var.Static to Var.Value

This commit is contained in:
Pete Davison
2023-11-28 18:18:28 +00:00
parent f58257a208
commit de09e675c1
13 changed files with 54 additions and 54 deletions

View File

@@ -18,7 +18,7 @@ func ParseV3(args ...string) ([]taskfile.Call, *taskfile.Vars) {
}
name, value := splitVar(arg)
globals.Set(name, taskfile.Var{Static: value})
globals.Set(name, taskfile.Var{Value: value})
}
return calls, globals
@@ -37,13 +37,13 @@ func ParseV2(args ...string) ([]taskfile.Call, *taskfile.Vars) {
if len(calls) < 1 {
name, value := splitVar(arg)
globals.Set(name, taskfile.Var{Static: value})
globals.Set(name, taskfile.Var{Value: value})
} else {
if calls[len(calls)-1].Vars == nil {
calls[len(calls)-1].Vars = &taskfile.Vars{}
}
name, value := splitVar(arg)
calls[len(calls)-1].Vars.Set(name, taskfile.Var{Static: value})
calls[len(calls)-1].Vars.Set(name, taskfile.Var{Value: value})
}
}

View File

@@ -35,9 +35,9 @@ func TestArgsV3(t *testing.T) {
ExpectedGlobals: &taskfile.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
map[string]taskfile.Var{
"FOO": {Static: "bar"},
"BAR": {Static: "baz"},
"BAZ": {Static: "foo"},
"FOO": {Value: "bar"},
"BAR": {Value: "baz"},
"BAZ": {Value: "foo"},
},
[]string{"FOO", "BAR", "BAZ"},
),
@@ -51,7 +51,7 @@ func TestArgsV3(t *testing.T) {
ExpectedGlobals: &taskfile.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
map[string]taskfile.Var{
"CONTENT": {Static: "with some spaces"},
"CONTENT": {Value: "with some spaces"},
},
[]string{"CONTENT"},
),
@@ -66,7 +66,7 @@ func TestArgsV3(t *testing.T) {
ExpectedGlobals: &taskfile.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
map[string]taskfile.Var{
"FOO": {Static: "bar"},
"FOO": {Value: "bar"},
},
[]string{"FOO"},
),
@@ -86,8 +86,8 @@ func TestArgsV3(t *testing.T) {
ExpectedGlobals: &taskfile.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
map[string]taskfile.Var{
"FOO": {Static: "bar"},
"BAR": {Static: "baz"},
"FOO": {Value: "bar"},
"BAR": {Value: "baz"},
},
[]string{"FOO", "BAR"},
),
@@ -130,7 +130,7 @@ func TestArgsV2(t *testing.T) {
Vars: &taskfile.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
map[string]taskfile.Var{
"FOO": {Static: "bar"},
"FOO": {Value: "bar"},
},
[]string{"FOO"},
),
@@ -143,8 +143,8 @@ func TestArgsV2(t *testing.T) {
Vars: &taskfile.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
map[string]taskfile.Var{
"BAR": {Static: "baz"},
"BAZ": {Static: "foo"},
"BAR": {Value: "baz"},
"BAZ": {Value: "foo"},
},
[]string{"BAR", "BAZ"},
),
@@ -161,7 +161,7 @@ func TestArgsV2(t *testing.T) {
Vars: &taskfile.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
map[string]taskfile.Var{
"CONTENT": {Static: "with some spaces"},
"CONTENT": {Value: "with some spaces"},
},
[]string{"CONTENT"},
),
@@ -178,7 +178,7 @@ func TestArgsV2(t *testing.T) {
ExpectedGlobals: &taskfile.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
map[string]taskfile.Var{
"FOO": {Static: "bar"},
"FOO": {Value: "bar"},
},
[]string{"FOO"},
),
@@ -198,8 +198,8 @@ func TestArgsV2(t *testing.T) {
ExpectedGlobals: &taskfile.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
map[string]taskfile.Var{
"FOO": {Static: "bar"},
"BAR": {Static: "baz"},
"FOO": {Value: "bar"},
"BAR": {Value: "baz"},
},
[]string{"FOO", "BAR"},
),