make linter happy

This commit is contained in:
Yuce Tekol 2019-05-28 14:12:04 +03:00
parent 5f4c5d4d35
commit 5e102154ca
No known key found for this signature in database
GPG key ID: CB59E46D2FB90573
2 changed files with 6 additions and 8 deletions

View file

@ -782,11 +782,9 @@ func (h *Handler) handlePostField(w http.ResponseWriter, r *http.Request) {
}
_, err = h.api.CreateField(r.Context(), indexName, fieldName, fos...)
if err != nil {
if _, ok := err.(pilosa.BadRequestError); ok {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
if _, ok := err.(pilosa.BadRequestError); ok {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
resp.write(w, err)
}

View file

@ -557,7 +557,7 @@ func TestHandler_Endpoints(t *testing.T) {
t.Fatalf("unexpected status code: %d", w.Code)
}
rsp := getSchemaResponse{}
if err := json.Unmarshal([]byte(w.Body.String()), &rsp); err != nil {
if err := json.Unmarshal(w.Body.Bytes(), &rsp); err != nil {
t.Fatalf("json decode: %s", err)
}
field := rsp.findField("i0", fieldName)
@ -586,7 +586,7 @@ func TestHandler_Endpoints(t *testing.T) {
t.Fatalf("unexpected status code: %d", w.Code)
}
rsp := getSchemaResponse{}
if err := json.Unmarshal([]byte(w.Body.String()), &rsp); err != nil {
if err := json.Unmarshal(w.Body.Bytes(), &rsp); err != nil {
t.Fatalf("json decode: %s", err)
}
field := rsp.findField("i0", fieldName)
@ -615,7 +615,7 @@ func TestHandler_Endpoints(t *testing.T) {
t.Fatalf("unexpected status code: %d", w.Code)
}
rsp := getSchemaResponse{}
if err := json.Unmarshal([]byte(w.Body.String()), &rsp); err != nil {
if err := json.Unmarshal(w.Body.Bytes(), &rsp); err != nil {
t.Fatalf("json decode: %s", err)
}
field := rsp.findField("i0", fieldName)