Skip to content

Commit 13d45b1

Browse files
committed
fix assorted oddities found by golangci-lint
Signed-off-by: Christoph Mewes <[email protected]>
1 parent c7488be commit 13d45b1

File tree

16 files changed

+80
-207
lines changed

16 files changed

+80
-207
lines changed

api/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (c *httpClient) URL(ep string, args map[string]string) *url.URL {
109109

110110
for arg, val := range args {
111111
arg = ":" + arg
112-
p = strings.Replace(p, arg, val, -1)
112+
p = strings.ReplaceAll(p, arg, val)
113113
}
114114

115115
u := *c.endpoint

api/prometheus/v1/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ func (h *httpAPI) Query(ctx context.Context, query string, ts time.Time, opts ..
856856
}
857857

858858
var qres queryResult
859-
return model.Value(qres.v), warnings, json.Unmarshal(body, &qres)
859+
return qres.v, warnings, json.Unmarshal(body, &qres)
860860
}
861861

862862
func (h *httpAPI) QueryRange(ctx context.Context, query string, r Range, opts ...Option) (model.Value, Warnings, error) {
@@ -885,7 +885,7 @@ func (h *httpAPI) QueryRange(ctx context.Context, query string, r Range, opts ..
885885

886886
var qres queryResult
887887

888-
return model.Value(qres.v), warnings, json.Unmarshal(body, &qres)
888+
return qres.v, warnings, json.Unmarshal(body, &qres)
889889
}
890890

891891
func (h *httpAPI) Series(ctx context.Context, matches []string, startTime, endTime time.Time) ([]model.LabelSet, Warnings, error) {

0 commit comments

Comments
 (0)