Lint code using staticcheck (#4471)
This commit is contained in:
parent
8f09acac2b
commit
fcd3054f13
16 changed files with 32 additions and 41 deletions
|
|
@ -217,10 +217,8 @@ func quote(input interface{}) string {
|
|||
switch input := input.(type) {
|
||||
case string:
|
||||
inputStr = input
|
||||
break
|
||||
case fmt.Stringer:
|
||||
inputStr = input.String()
|
||||
break
|
||||
default:
|
||||
inputStr = fmt.Sprintf("%v", input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,7 +220,11 @@ func TestBuildLuaSharedDictionaries(t *testing.T) {
|
|||
}
|
||||
// test invalid config
|
||||
configuration = buildLuaSharedDictionaries(invalidType, servers, false)
|
||||
if expected != actual {
|
||||
if configuration != "" {
|
||||
t.Errorf("expected an empty string, but got %s", configuration)
|
||||
}
|
||||
|
||||
if actual != expected {
|
||||
t.Errorf("Expected '%v' but returned '%v' ", expected, actual)
|
||||
}
|
||||
}
|
||||
|
|
@ -233,7 +237,7 @@ func TestLuaConfigurationRequestBodySize(t *testing.T) {
|
|||
}
|
||||
|
||||
size := luaConfigurationRequestBodySize(cfg)
|
||||
if "21" != size {
|
||||
if size != "21" {
|
||||
t.Errorf("expected the size to be 20 but got: %v", size)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue