From 620226d6ef42127fa3344f89a042d0ec4fadee1c Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Tue, 15 May 2018 11:00:09 -0500 Subject: [PATCH] simplify comparisons to bool constants --- handler_test.go | 4 ++-- pilosa.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/handler_test.go b/handler_test.go index 9e947805c..0bb73db4a 100644 --- a/handler_test.go +++ b/handler_test.go @@ -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) } diff --git a/pilosa.go b/pilosa.go index f29356ef6..bad8badc3 100644 --- a/pilosa.go +++ b/pilosa.go @@ -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