chore(linter): adjust initialization for revive

This commit is contained in:
Jan De Dobbeleer 2022-03-19 10:09:09 +01:00 committed by Jan De Dobbeleer
parent 0215f1727f
commit af6cea5d5b

View file

@ -14,101 +14,101 @@ const (
) )
func TestGetString(t *testing.T) { func TestGetString(t *testing.T) {
var properties Map = Map{Foo: expected} var properties = Map{Foo: expected}
value := properties.GetString(Foo, "err") value := properties.GetString(Foo, "err")
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestGetStringNoEntry(t *testing.T) { func TestGetStringNoEntry(t *testing.T) {
var properties Map = Map{} var properties = Map{}
value := properties.GetString(Foo, expected) value := properties.GetString(Foo, expected)
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestGetStringNoTextEntry(t *testing.T) { func TestGetStringNoTextEntry(t *testing.T) {
var properties Map = Map{Foo: true} var properties = Map{Foo: true}
value := properties.GetString(Foo, expected) value := properties.GetString(Foo, expected)
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestGetHexColor(t *testing.T) { func TestGetHexColor(t *testing.T) {
expected := expectedColor expected := expectedColor
var properties Map = Map{Foo: expected} var properties = Map{Foo: expected}
value := properties.GetColor(Foo, "#789123") value := properties.GetColor(Foo, "#789123")
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestGetColor(t *testing.T) { func TestGetColor(t *testing.T) {
expected := "yellow" expected := "yellow"
var properties Map = Map{Foo: expected} var properties = Map{Foo: expected}
value := properties.GetColor(Foo, "#789123") value := properties.GetColor(Foo, "#789123")
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestDefaultColorWithInvalidColorCode(t *testing.T) { func TestDefaultColorWithInvalidColorCode(t *testing.T) {
expected := expectedColor expected := expectedColor
var properties Map = Map{Foo: "invalid"} var properties = Map{Foo: "invalid"}
value := properties.GetColor(Foo, expected) value := properties.GetColor(Foo, expected)
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestDefaultColorWithUnavailableProperty(t *testing.T) { func TestDefaultColorWithUnavailableProperty(t *testing.T) {
expected := expectedColor expected := expectedColor
var properties Map = Map{} var properties = Map{}
value := properties.GetColor(Foo, expected) value := properties.GetColor(Foo, expected)
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestGetPaletteColor(t *testing.T) { func TestGetPaletteColor(t *testing.T) {
expected := "p:red" expected := "p:red"
var properties Map = Map{Foo: expected} var properties = Map{Foo: expected}
value := properties.GetColor(Foo, "white") value := properties.GetColor(Foo, "white")
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestGetBool(t *testing.T) { func TestGetBool(t *testing.T) {
expected := true expected := true
var properties Map = Map{Foo: expected} var properties = Map{Foo: expected}
value := properties.GetBool(Foo, false) value := properties.GetBool(Foo, false)
assert.True(t, value) assert.True(t, value)
} }
func TestGetBoolPropertyNotInMap(t *testing.T) { func TestGetBoolPropertyNotInMap(t *testing.T) {
var properties Map = Map{} var properties = Map{}
value := properties.GetBool(Foo, false) value := properties.GetBool(Foo, false)
assert.False(t, value) assert.False(t, value)
} }
func TestGetBoolInvalidProperty(t *testing.T) { func TestGetBoolInvalidProperty(t *testing.T) {
var properties Map = Map{Foo: "borked"} var properties = Map{Foo: "borked"}
value := properties.GetBool(Foo, false) value := properties.GetBool(Foo, false)
assert.False(t, value) assert.False(t, value)
} }
func TestGetFloat64(t *testing.T) { func TestGetFloat64(t *testing.T) {
expected := float64(1337) expected := float64(1337)
var properties Map = Map{Foo: expected} var properties = Map{Foo: expected}
value := properties.GetFloat64(Foo, 9001) value := properties.GetFloat64(Foo, 9001)
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestGetFloat64PropertyNotInMap(t *testing.T) { func TestGetFloat64PropertyNotInMap(t *testing.T) {
expected := float64(1337) expected := float64(1337)
var properties Map = Map{} var properties = Map{}
value := properties.GetFloat64(Foo, expected) value := properties.GetFloat64(Foo, expected)
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestGetFloat64InvalidStringProperty(t *testing.T) { func TestGetFloat64InvalidStringProperty(t *testing.T) {
expected := float64(1337) expected := float64(1337)
var properties Map = Map{Foo: "invalid"} var properties = Map{Foo: "invalid"}
value := properties.GetFloat64(Foo, expected) value := properties.GetFloat64(Foo, expected)
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }
func TestGetFloat64InvalidBoolProperty(t *testing.T) { func TestGetFloat64InvalidBoolProperty(t *testing.T) {
expected := float64(1337) expected := float64(1337)
var properties Map = Map{Foo: true} var properties = Map{Foo: true}
value := properties.GetFloat64(Foo, expected) value := properties.GetFloat64(Foo, expected)
assert.Equal(t, expected, value) assert.Equal(t, expected, value)
} }