Merge pull request #5670 from cueo/sonar-code-smell
Reduce code smell reported by SonarCloudpull/5655/head^2
commit
dbe977d879
|
@ -151,5 +151,5 @@ func posString(slice []string, element string) int {
|
|||
|
||||
// containsString returns true if slice contains element
|
||||
func containsString(slice []string, element string) bool {
|
||||
return !(posString(slice, element) == -1)
|
||||
return posString(slice, element) != -1
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ var (
|
|||
]`)
|
||||
)
|
||||
|
||||
func Test_parseStatusAndReturnIp(t *testing.T) {
|
||||
func TestParseStatusAndReturnIp(t *testing.T) {
|
||||
type args struct {
|
||||
mac string
|
||||
statuses []byte
|
||||
|
|
|
@ -174,7 +174,7 @@ func TestWriteConfig(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func Test_encode(t *testing.T) {
|
||||
func TestEncode(t *testing.T) {
|
||||
var b bytes.Buffer
|
||||
for _, tt := range configTestCases {
|
||||
err := encode(&b, tt.config)
|
||||
|
|
Loading…
Reference in New Issue