Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Oct 6, 2020
1 parent f8b536f commit 7d6c334
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/queryfrontend/metadata_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (c metadataCodec) DecodeResponse(ctx context.Context, r *http.Response, req

buf, err := ioutil.ReadAll(r.Body)
if err != nil {
log.Error(err)
log.Error(err) //nolint:errcheck
return nil, httpgrpc.Errorf(http.StatusInternalServerError, "error decoding response: %v", err)
}

Expand Down
11 changes: 4 additions & 7 deletions pkg/queryfrontend/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ func NewTripperware(
return nil, err
}

metadataTripperware, err := newMetadataTripperware(config, limits, metadataCodec,
metadataTripperware := newMetadataTripperware(config, limits, metadataCodec,
prometheus.WrapRegistererWith(prometheus.Labels{"tripperware": "metadata"}, reg), logger)
if err != nil {
return nil, err
}

return func(next http.RoundTripper) http.RoundTripper {
return newRoundTripper(next, queryRangeTripperware(next), metadataTripperware(next), reg)
Expand Down Expand Up @@ -116,7 +113,7 @@ func getOperation(r *http.Request) string {
return seriesOp
default:
matched, err := regexp.MatchString("/api/v1/label/.+/values$", r.URL.Path)
if err == nil && matched == true {
if err == nil && matched {
return labelValuesOp
}
}
Expand Down Expand Up @@ -199,7 +196,7 @@ func newMetadataTripperware(
codec *metadataCodec,
reg prometheus.Registerer,
logger log.Logger,
) (frontend.Tripperware, error) {
) frontend.Tripperware {
metadataMiddleware := []queryrange.Middleware{queryrange.LimitsMiddleware(limits)}
m := queryrange.NewInstrumentMiddlewareMetrics(reg)

Expand All @@ -225,7 +222,7 @@ func newMetadataTripperware(
return frontend.RoundTripFunc(func(r *http.Request) (*http.Response, error) {
return rt.RoundTrip(r)
})
}, nil
}
}

// Don't go to response cache if StoreMatchers are set.
Expand Down

0 comments on commit 7d6c334

Please sign in to comment.