Merge pull request #5670 from cueo/sonar-code-smell

Reduce code smell reported by SonarCloud
pull/5655/head^2
Thomas Strömberg 2019-10-21 09:42:25 -07:00 committed by GitHub
commit dbe977d879
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -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
}

View File

@ -46,7 +46,7 @@ var (
]`)
)
func Test_parseStatusAndReturnIp(t *testing.T) {
func TestParseStatusAndReturnIp(t *testing.T) {
type args struct {
mac string
statuses []byte

View File

@ -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)