Skip to content

Commit

Permalink
mimir-build-image: Upgrade golangci-lint to v1.59.1
Browse files Browse the repository at this point in the history
Signed-off-by: Arve Knudsen <[email protected]>
  • Loading branch information
aknuds1 committed Jun 17, 2024
1 parent f4867bf commit a29d34e
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion mimir-build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN GOARCH=$(go env GOARCH) && \
curl -fSL -o "/usr/bin/tk" "https://github.com/grafana/tanka/releases/download/v${TANKA_VERSION}/tk-linux-${GOARCH}" && \
chmod a+x /usr/bin/tk

RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b /usr/bin v1.54.1
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b /usr/bin v1.59.1

ENV SKOPEO_VERSION=v1.15.1
RUN git clone --depth 1 --branch ${SKOPEO_VERSION} https://github.com/containers/skopeo /go/src/github.com/containers/skopeo && \
Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,10 @@ func buildIntegrationsMap(nc []*definition.PostableApiReceiver, tmpl *template.T

func buildGrafanaReceiverIntegrations(rcv *definition.PostableApiReceiver, tmpl *template.Template, logger log.Logger) ([]*nfstatus.Integration, error) {
loggerFactory := newLoggerFactory(logger)
whFn := func(n alertingReceivers.Metadata) (alertingReceivers.WebhookSender, error) {
whFn := func(alertingReceivers.Metadata) (alertingReceivers.WebhookSender, error) {
return NewSender(logger), nil
}
emailFn := func(n alertingReceivers.Metadata) (alertingReceivers.EmailSender, error) {
emailFn := func(alertingReceivers.Metadata) (alertingReceivers.EmailSender, error) {
return NewSender(logger), nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestSendWebhook(t *testing.T) {
testErr := errors.New("test")
cmd = alertingReceivers.SendWebhookSettings{
URL: server.URL,
Validation: func(body []byte, statusCode int) error { return testErr },
Validation: func([]byte, int) error { return testErr },
}

require.ErrorIs(t, s.SendWebhook(context.Background(), &cmd), testErr)
Expand Down
2 changes: 1 addition & 1 deletion pkg/distributor/otel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func TestHandlerOTLPPush(t *testing.T) {
maxMsgSize: 100000,
series: sampleSeries,
metadata: sampleMetadata,
verifyFunc: func(_ *testing.T, pushReq *Request) error {
verifyFunc: func(*testing.T, *Request) error {
return httpgrpc.Errorf(http.StatusTooManyRequests, "go slower")
},
responseCode: http.StatusTooManyRequests,
Expand Down
2 changes: 1 addition & 1 deletion pkg/distributor/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ func TestOTLPPushHandlerErrorsAreReportedCorrectlyViaHttpgrpc(t *testing.T) {
srv, err := dskit_server.New(cfg)
require.NoError(t, err)

push := func(ctx context.Context, req *Request) error {
push := func(_ context.Context, req *Request) error {
// Trigger conversion of incoming request to WriteRequest.
wr, err := req.WriteRequest()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/frontend/querymiddleware/remote_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (r *remoteReadRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
if err != nil {
return nil, err
}
handler := r.middleware.Wrap(HandlerFunc(func(ctx context.Context, req MetricsQueryRequest) (Response, error) {
handler := r.middleware.Wrap(HandlerFunc(func(context.Context, MetricsQueryRequest) (Response, error) {
// We do not need to do anything here as this middleware is used for
// validation only and previous middlewares would have already returned errors.
return nil, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/frontend/querymiddleware/remote_read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func TestRemoteReadRoundTripperCallsDownstreamOnAll(t *testing.T) {
t.Run(name, func(t *testing.T) {
roundTripper := &mockRoundTripper{}
countMiddleWareCalls := 0
middleware := MetricsQueryMiddlewareFunc(func(next MetricsQueryHandler) MetricsQueryHandler {
middleware := MetricsQueryMiddlewareFunc(func(MetricsQueryHandler) MetricsQueryHandler {
countMiddleWareCalls++
return tc.handler
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func TestIngester_StartReadRequest(t *testing.T) {
utilizationLimiter = &fakeUtilizationBasedLimiter{limitingReason: "cpu"}
)

setupIngester := func(tc testCase) *failingIngester {
setupIngester := func(testCase) *failingIngester {
cfg := defaultIngesterTestConfig(t)
cfg.ReadCircuitBreaker = CircuitBreakerConfig{
Enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/api/consistency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func BenchmarkReadConsistencyServerUnaryInterceptor(b *testing.B) {
ctx := metadata.NewIncomingContext(context.Background(), md)

for n := 0; n < b.N; n++ {
_, _ = ReadConsistencyServerUnaryInterceptor(ctx, nil, nil, func(ctx context.Context, req any) (any, error) {
_, _ = ReadConsistencyServerUnaryInterceptor(ctx, nil, nil, func(context.Context, any) (any, error) {
return nil, nil
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/streamingpromql/functions/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type InstantVectorFunction func(seriesData types.InstantVectorSeriesData, pool *

// floatTransformationFunc is not needed elsewhere, so it is not exported yet
func floatTransformationFunc(transform func(f float64) float64) InstantVectorFunction {
return func(seriesData types.InstantVectorSeriesData, pool *pooling.LimitingPool) (types.InstantVectorSeriesData, error) {
return func(seriesData types.InstantVectorSeriesData, _ *pooling.LimitingPool) (types.InstantVectorSeriesData, error) {
for i := range seriesData.Floats {
seriesData.Floats[i].F = transform(seriesData.Floats[i].F)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ func TestFunctionOverInstantVector(t *testing.T) {
}

metadataFuncCalled := false
mustBeCalledMetadata := func(seriesMetadata []types.SeriesMetadata, pool *pooling.LimitingPool) ([]types.SeriesMetadata, error) {
mustBeCalledMetadata := func(seriesMetadata []types.SeriesMetadata, _ *pooling.LimitingPool) ([]types.SeriesMetadata, error) {
require.Equal(t, len(inner.series), len(seriesMetadata))
metadataFuncCalled = true
return nil, nil
}

seriesDataFuncCalledTimes := 0
mustBeCalledSeriesData := func(seriesData types.InstantVectorSeriesData, pool *pooling.LimitingPool) (types.InstantVectorSeriesData, error) {
mustBeCalledSeriesData := func(types.InstantVectorSeriesData, *pooling.LimitingPool) (types.InstantVectorSeriesData, error) {
seriesDataFuncCalledTimes++
return types.InstantVectorSeriesData{}, nil
}
Expand Down

0 comments on commit a29d34e

Please sign in to comment.