simplify comparisons to bool constants

This commit is contained in:
Matt Jaffee 2018-05-15 11:00:09 -05:00
parent a0f4c613a2
commit 620226d6ef
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF
2 changed files with 3 additions and 3 deletions

View file

@ -492,7 +492,7 @@ func TestHandler_Query_Bitmap_Protobuf(t *testing.T) {
t.Fatalf("unexpected attr[0]: %s=%v", k, v)
} else if k, v := attrs[1].Key, attrs[1].IntValue; k != "c" || v != int64(1) {
t.Fatalf("unexpected attr[1]: %s=%v", k, v)
} else if k, v := attrs[2].Key, attrs[2].BoolValue; k != "d" || v != true {
} else if k, v := attrs[2].Key, attrs[2].BoolValue; k != "d" || !v {
t.Fatalf("unexpected attr[2]: %s=%v", k, v)
}
}
@ -551,7 +551,7 @@ func TestHandler_Query_Bitmap_ColumnAttrs_Protobuf(t *testing.T) {
t.Fatalf("unexpected attr[0]: %s=%v", k, v)
} else if k, v := attrs[1].Key, attrs[1].IntValue; k != "c" || v != int64(1) {
t.Fatalf("unexpected attr[1]: %s=%v", k, v)
} else if k, v := attrs[2].Key, attrs[2].BoolValue; k != "d" || v != true {
} else if k, v := attrs[2].Key, attrs[2].BoolValue; k != "d" || !v {
t.Fatalf("unexpected attr[2]: %s=%v", k, v)
}

View file

@ -111,7 +111,7 @@ const TimeFormat = "2006-01-02T15:04"
// ValidateName ensures that the name is a valid format.
func ValidateName(name string) error {
if nameRegexp.Match([]byte(name)) == false {
if !nameRegexp.Match([]byte(name)) {
return ErrName
}
return nil