Skip to content

Commit

Permalink
fix assorted oddities found by golangci-lint
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Mewes <christoph@kubermatic.com>
  • Loading branch information
xrstf committed Aug 2, 2022
1 parent c7488be commit 13d45b1
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 207 deletions.
2 changes: 1 addition & 1 deletion api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (c *httpClient) URL(ep string, args map[string]string) *url.URL {

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

u := *c.endpoint
Expand Down
4 changes: 2 additions & 2 deletions api/prometheus/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ func (h *httpAPI) Query(ctx context.Context, query string, ts time.Time, opts ..
}

var qres queryResult
return model.Value(qres.v), warnings, json.Unmarshal(body, &qres)
return qres.v, warnings, json.Unmarshal(body, &qres)
}

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

var qres queryResult

return model.Value(qres.v), warnings, json.Unmarshal(body, &qres)
return qres.v, warnings, json.Unmarshal(body, &qres)
}

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

0 comments on commit 13d45b1

Please sign in to comment.