Skip to content

Commit

Permalink
Simplify code as per PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jessjenkins committed Nov 11, 2019
1 parent 05bccc9 commit 9a6b3bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ func DataLookupHandlerFunc(elasticSearchClient ElasticSearcher) http.HandlerFunc
}

w.Header().Set("Content-Type", "application/json;charset=utf-8")
w.Write([]byte(dataWithResponse))
w.Write(dataWithResponse)
}
}
2 changes: 1 addition & 1 deletion api/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func SearchHandlerFunc(elasticSearchClient ElasticSearcher) http.HandlerFunc {
return
}

if json.Valid([]byte(responseData)) != true {
if !json.Valid([]byte(responseData)) {
log.Debug("Invlid JSON returned by elastic search for search query", nil)
http.Error(w, "Failed to process search query", http.StatusInternalServerError)
return
Expand Down
2 changes: 1 addition & 1 deletion api/timeseries.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TimeseriesLookupHandlerFunc(elasticSearchClient ElasticSearcher) http.Handl
return
}

if json.Valid([]byte(responseData)) != true {
if !json.Valid([]byte(responseData)) {
log.Debug("Invlid JSON returned by elastic search for timeseries query", nil)
http.Error(w, "Failed to process timeseries query", http.StatusInternalServerError)
return
Expand Down

0 comments on commit 9a6b3bb

Please sign in to comment.