diff --git a/api/data.go b/api/data.go index bca72b3c..d31b350c 100644 --- a/api/data.go +++ b/api/data.go @@ -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) } } diff --git a/api/search.go b/api/search.go index c68e462e..0a6999da 100644 --- a/api/search.go +++ b/api/search.go @@ -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 diff --git a/api/timeseries.go b/api/timeseries.go index 1e693d23..054a1c6c 100644 --- a/api/timeseries.go +++ b/api/timeseries.go @@ -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