Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
go report fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yuce committed May 1, 2017
1 parent 6e7eea9 commit 2760492
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 23 deletions.
1 change: 0 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.


package pilosa

import (
Expand Down
10 changes: 5 additions & 5 deletions client_it_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func TestErrorResponseNotRead(t *testing.T) {
client := NewClientWithURI(uri)
response, err := client.Query(testFrame.Bitmap(1), nil)
if err == nil {
t.Fatalf("Got response: %s", response)
t.Fatalf("Got response: %v", response)
}
}

Expand All @@ -372,7 +372,7 @@ func TestResponseNotRead(t *testing.T) {
client := NewClientWithURI(uri)
response, err := client.Query(testFrame.Bitmap(1), nil)
if err == nil {
t.Fatalf("Got response: %s", response)
t.Fatalf("Got response: %v", response)
}
}

Expand All @@ -386,7 +386,7 @@ func TestInvalidResponse(t *testing.T) {
client := NewClientWithURI(uri)
response, err := client.Query(index.RawQuery("don't care"), nil)
if err == nil {
t.Fatalf("Got response: %s", response)
t.Fatalf("Got response: %v", response)
}
}

Expand Down Expand Up @@ -443,10 +443,10 @@ func TestResponseWithInvalidType(t *testing.T) {
qr := &internal.QueryResponse{
Err: "",
ColumnAttrSets: []*internal.ColumnAttrSet{
&internal.ColumnAttrSet{
{
ID: 0,
Attrs: []*internal.Attr{
&internal.Attr{
{
Type: 9999,
StringValue: "NOVAL",
},
Expand Down
3 changes: 3 additions & 0 deletions cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ func TestRemoveHost(t *testing.T) {
t.Fatalf("The cluster should contain the host")
}
uri, err = NewURIFromAddress("db1.pilosa.com:9999")
if err != nil {
t.Fatal(err)
}
c.RemoveHost(uri)
if len(c.hosts) != 0 {
t.Fatalf("The cluster should not contain the host")
Expand Down
2 changes: 1 addition & 1 deletion orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func TestInverseBitmapFailsIfNotEnabled(t *testing.T) {
t.Fatal(err)
}
qry := frame.InverseBitmap(5)
if qry.Error == nil {
if qry.Error() == nil {
t.Fatalf("Creating InverseBitmap query for a frame without inverse frame enabled should fail")
}
}
Expand Down
2 changes: 1 addition & 1 deletion response.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func convertInternalAttrsToMap(attrs []*internal.Attr) (attrsMap map[string]inte
return attrsMap, nil
}

// ColumnItem representes a column in the index
// ColumnItem represents a column in the index
type ColumnItem struct {
ID uint64
Attributes map[string]interface{}
Expand Down
30 changes: 15 additions & 15 deletions response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ func TestNewBitmapResultFromInternal(t *testing.T) {
}
targetBits := []uint64{5, 10}
attrs := []*internal.Attr{
&internal.Attr{Key: "name", StringValue: "some string", Type: 1},
&internal.Attr{Key: "age", IntValue: 95, Type: 2},
&internal.Attr{Key: "registered", BoolValue: true, Type: 3},
&internal.Attr{Key: "height", FloatValue: 1.83, Type: 4},
{Key: "name", StringValue: "some string", Type: 1},
{Key: "age", IntValue: 95, Type: 2},
{Key: "registered", BoolValue: true, Type: 3},
{Key: "height", FloatValue: 1.83, Type: 4},
}
bitmap := &internal.Bitmap{
Attrs: attrs,
Expand Down Expand Up @@ -79,25 +79,25 @@ func TestNewQueryResponseFromInternal(t *testing.T) {
}
targetBits := []uint64{5, 10}
targetCountItems := []*CountResultItem{
&CountResultItem{ID: 10, Count: 100},
{ID: 10, Count: 100},
}
attrs := []*internal.Attr{
&internal.Attr{Key: "name", StringValue: "some string", Type: 1},
&internal.Attr{Key: "age", IntValue: 95, Type: 2},
&internal.Attr{Key: "registered", BoolValue: true, Type: 3},
&internal.Attr{Key: "height", FloatValue: 1.83, Type: 4},
{Key: "name", StringValue: "some string", Type: 1},
{Key: "age", IntValue: 95, Type: 2},
{Key: "registered", BoolValue: true, Type: 3},
{Key: "height", FloatValue: 1.83, Type: 4},
}
bitmap := &internal.Bitmap{
Attrs: attrs,
Bits: []uint64{5, 10},
}
pairs := []*internal.Pair{
&internal.Pair{Key: 10, Count: 100},
{Key: 10, Count: 100},
}
response := &internal.QueryResponse{
Results: []*internal.QueryResult{
&internal.QueryResult{Bitmap: bitmap},
&internal.QueryResult{Pairs: pairs},
{Bitmap: bitmap},
{Pairs: pairs},
},
Err: "",
}
Expand Down Expand Up @@ -151,20 +151,20 @@ func TestNewQueryResponseWithErrorFromInternal(t *testing.T) {

func TestNewQueryResponseFromInternalFailure(t *testing.T) {
attrs := []*internal.Attr{
&internal.Attr{Key: "name", StringValue: "some string", Type: 99},
{Key: "name", StringValue: "some string", Type: 99},
}
bitmap := &internal.Bitmap{
Attrs: attrs,
}
response := &internal.QueryResponse{
Results: []*internal.QueryResult{&internal.QueryResult{Bitmap: bitmap}},
Results: []*internal.QueryResult{{Bitmap: bitmap}},
}
qr, err := newQueryResponseFromInternal(response)
if qr != nil && err == nil {
t.Fatalf("Should have failed")
}
response = &internal.QueryResponse{
ColumnAttrSets: []*internal.ColumnAttrSet{&internal.ColumnAttrSet{ID: 1, Attrs: attrs}},
ColumnAttrSets: []*internal.ColumnAttrSet{{ID: 1, Attrs: attrs}},
}
qr, err = newQueryResponseFromInternal(response)
if qr != nil && err == nil {
Expand Down

0 comments on commit 2760492

Please sign in to comment.