Skip to content

Commit

Permalink
Update module github.com/golangci/golangci-lint to v1.60.0 (#5841)
Browse files Browse the repository at this point in the history
* Manually fixed new linter errors
* Change go version check to not be triggered by newly released Go
versions, for more stable PRs
* Refactor lint target in the Makefile to split into independent targets

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/golangci/golangci-lint](https://togithub.com/golangci/golangci-lint)
| `v1.59.1` -> `v1.60.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgolangci%2fgolangci-lint/v1.60.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgolangci%2fgolangci-lint/v1.60.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgolangci%2fgolangci-lint/v1.59.1/v1.60.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgolangci%2fgolangci-lint/v1.59.1/v1.60.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>golangci/golangci-lint
(github.com/golangci/golangci-lint)</summary>

###
[`v1.60.0`](https://togithub.com/golangci/golangci-lint/compare/v1.59.1...v1.60.0)

[Compare
Source](https://togithub.com/golangci/golangci-lint/compare/v1.59.1...v1.60.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/jaegertracing/jaeger).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiY2hhbmdlbG9nOmRlcGVuZGVuY2llcyJdfQ==-->

---------

Signed-off-by: Mend Renovate <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
  • Loading branch information
renovate-bot and yurishkuro authored Aug 14, 2024
1 parent d8f21f8 commit f440f1e
Show file tree
Hide file tree
Showing 21 changed files with 136 additions and 115 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ linters-settings:
# looks useful, but requires refactoring: "calls to log.Fatal only in main() or init() functions"
- name: deep-exit
disabled: true
# this rule conflicts with nolintlint which does insist on no-space in //nolint
- name: comment-spacings
disabled: true
testifylint:
disable:
- float-compare
Expand Down
32 changes: 25 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ nocover:
@echo Verifying that all packages have test files to count in coverage
@scripts/check-test-files.sh $(ALL_PKGS)

.PHONY: goleak
goleak:
@echo Verifying that all packages with tests have goleak in their TestMain
@scripts/check-goleak-files.sh $(ALL_PKGS)

.PHONY: fmt
fmt: $(GOFUMPT)
@echo Running import-order-cleanup on ALL_SRC ...
Expand All @@ -196,12 +191,35 @@ fmt: $(GOFUMPT)
@./scripts/updateLicense.py $(ALL_SRC) $(SCRIPTS_SRC)

.PHONY: lint
lint: $(LINT) goleak
lint: lint-license lint-imports lint-semconv lint-goversion lint-goleak lint-go

.PHONY: lint-license
lint-license:
@echo Verifying that all files have license headers
@./scripts/updateLicense.py $(ALL_SRC) $(SCRIPTS_SRC) > $(FMT_LOG)
@[ ! -s "$(FMT_LOG)" ] || (echo "License check failures, run 'make fmt'" | cat - $(FMT_LOG) && false)

.PHONY: lint-imports
lint-imports:
@echo Verifying that all Go files have correctly ordered imports
@./scripts/import-order-cleanup.py -o stdout -t $(ALL_SRC) > $(IMPORT_LOG)
@[ ! -s "$(FMT_LOG)" -a ! -s "$(IMPORT_LOG)" ] || (echo "License check or import ordering failures, run 'make fmt'" | cat - $(FMT_LOG) $(IMPORT_LOG) && false)
@[ ! -s "$(IMPORT_LOG)" ] || (echo "Import ordering failures, run 'make fmt'" | cat - $(IMPORT_LOG) && false)

.PHONY: lint-semconv
lint-semconv:
./scripts/check-semconv-version.sh

.PHONY: lint-goversion
lint-goversion:
./scripts/check-go-version.sh

.PHONY: lint-goleak
lint-goleak:
@echo Verifying that all packages with tests have goleak in their TestMain
@scripts/check-goleak-files.sh $(ALL_PKGS)

.PHONY: lint-go
lint-go: $(LINT)
$(LINT) -v run

.PHONY: build-examples
Expand Down
2 changes: 1 addition & 1 deletion cmd/collector/app/handler/grpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (c *batchConsumer) consume(ctx context.Context, batch *model.Batch) error {
})
if err != nil {
if errors.Is(err, processor.ErrBusy) {
return status.Errorf(codes.ResourceExhausted, err.Error())
return status.Error(codes.ResourceExhausted, err.Error())
}
c.logger.Error("cannot process spans", zap.Error(err))
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/collector/app/span_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ func TestSpanProcessorCountSpan(t *testing.T) {
time.Second,
time.Millisecond,
)
assert.Greater(t, p.spansProcessed.Load(), uint64(0))
assert.Positive(t, p.spansProcessed.Load())
}

for i := 0; i < 10000; i++ {
Expand Down
4 changes: 2 additions & 2 deletions cmd/ingester/app/consumer/deadlock_detector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestNoClosingSignalIfMessagesProcessedInInterval(t *testing.T) {
w := f.startMonitoringForPartition(1)

w.incrementMsgCount()
assert.Zero(t, len(w.closePartitionChannel()))
assert.Empty(t, w.closePartitionChannel())
w.close()
}

Expand Down Expand Up @@ -160,6 +160,6 @@ func TestApiCompatibilityWhenDeadlockDetectorDisabled(t *testing.T) {

w.incrementMsgCount()
w.incrementAllPartitionMsgCount()
assert.Zero(t, len(w.closePartitionChannel()))
assert.Empty(t, w.closePartitionChannel())
w.close()
}
5 changes: 3 additions & 2 deletions cmd/query/app/apiv3/grpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package apiv3

import (
"context"
"errors"
"fmt"

"github.com/gogo/protobuf/types"
Expand Down Expand Up @@ -59,11 +60,11 @@ func (h *Handler) GetTrace(request *api_v3.GetTraceRequest, stream api_v3.QueryS
func (h *Handler) FindTraces(request *api_v3.FindTracesRequest, stream api_v3.QueryService_FindTracesServer) error {
query := request.GetQuery()
if query == nil {
return status.Errorf(codes.InvalidArgument, "missing query")
return status.Error(codes.InvalidArgument, "missing query")
}
if query.GetStartTimeMin() == nil ||
query.GetStartTimeMax() == nil {
return fmt.Errorf("start time min and max are required parameters")
return errors.New("start time min and max are required parameters")
}

queryParams := &spanstore.TraceQueryParameters{
Expand Down
13 changes: 7 additions & 6 deletions cmd/query/app/apiv3/http_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package apiv3

import (
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -105,7 +106,7 @@ func TestHTTPGatewayTryHandleError(t *testing.T) {
gw.Logger = logger
w = httptest.NewRecorder()
const e = "some err"
assert.True(t, gw.tryHandleError(w, fmt.Errorf(e), http.StatusInternalServerError))
assert.True(t, gw.tryHandleError(w, errors.New(e), http.StatusInternalServerError))
assert.Contains(t, log.String(), e, "logs error if status code is 500")
assert.Contains(t, string(w.Body.String()), e, "writes error message to body")
}
Expand All @@ -118,7 +119,7 @@ func TestHTTPGatewayOTLPError(t *testing.T) {
const simErr = "simulated error"
gw.returnSpansTestable(nil, w,
func(_ []*model.Span) (ptrace.Traces, error) {
return ptrace.Traces{}, fmt.Errorf(simErr)
return ptrace.Traces{}, errors.New(simErr)
},
)
assert.Contains(t, w.Body.String(), simErr)
Expand All @@ -138,7 +139,7 @@ func TestHTTPGatewayGetTraceErrors(t *testing.T) {
const simErr = "simulated error"
gw.reader.
On("GetTrace", matchContext, matchTraceID).
Return(nil, fmt.Errorf(simErr)).Once()
Return(nil, errors.New(simErr)).Once()

r, err = http.NewRequest(http.MethodGet, "/api/v3/traces/123", nil)
require.NoError(t, err)
Expand Down Expand Up @@ -247,7 +248,7 @@ func TestHTTPGatewayFindTracesErrors(t *testing.T) {
gw := setupHTTPGatewayNoServer(t, "", tenancy.Options{})
gw.reader.
On("FindTraces", matchContext, qp).
Return(nil, fmt.Errorf(simErr)).Once()
Return(nil, errors.New(simErr)).Once()

gw.router.ServeHTTP(w, r)
assert.Contains(t, w.Body.String(), simErr)
Expand All @@ -260,7 +261,7 @@ func TestHTTPGatewayGetServicesErrors(t *testing.T) {
const simErr = "simulated error"
gw.reader.
On("GetServices", matchContext).
Return(nil, fmt.Errorf(simErr)).Once()
Return(nil, errors.New(simErr)).Once()

r, err := http.NewRequest(http.MethodGet, "/api/v3/services", nil)
require.NoError(t, err)
Expand All @@ -276,7 +277,7 @@ func TestHTTPGatewayGetOperationsErrors(t *testing.T) {
const simErr = "simulated error"
gw.reader.
On("GetOperations", matchContext, qp).
Return(nil, fmt.Errorf(simErr)).Once()
Return(nil, errors.New(simErr)).Once()

r, err := http.NewRequest(http.MethodGet, "/api/v3/operations?service=foo&span_kind=server", nil)
require.NoError(t, err)
Expand Down
6 changes: 3 additions & 3 deletions cmd/query/app/http_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,9 @@ func TestSearchByTraceIDNotFound(t *testing.T) {

func TestSearchByTraceIDFailure(t *testing.T) {
ts := initializeTestServer(t)
whatsamattayou := "https://youtu.be/WrKFOCg13QQ"
whatsamattayou := "whatsamattayou"
ts.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")).
Return(nil, fmt.Errorf(whatsamattayou)).Once()
Return(nil, errors.New(whatsamattayou)).Once()

var response structuredResponse
err := getJSON(ts.server.URL+`/api/traces?traceID=1`, &response)
Expand Down Expand Up @@ -763,7 +763,7 @@ func TestMetricsReaderError(t *testing.T) {
tc.mockedQueryMethod,
mock.AnythingOfType("*context.valueCtx"),
mock.AnythingOfType(tc.mockedQueryMethodParamType),
).Return(tc.mockedResponse, fmt.Errorf(tc.wantErrorMessage)).Once()
).Return(tc.mockedResponse, errors.New(tc.wantErrorMessage)).Once()

// Test
var response metrics.MetricFamily
Expand Down
3 changes: 1 addition & 2 deletions cmd/query/app/query_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package app

import (
"fmt"
"net/http"
"regexp"
"testing"
Expand Down Expand Up @@ -174,7 +173,7 @@ func TestParseTraceQuery(t *testing.T) {
} else {
matched, matcherr := regexp.MatchString(test.errMsg, err.Error())
require.NoError(t, matcherr)
assert.True(t, matched, fmt.Sprintf("Error \"%s\" should match \"%s\"", err.Error(), test.errMsg))
assert.True(t, matched, "Error \"%s\" should match \"%s\"", err.Error(), test.errMsg)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion crossdock/services/tracehandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func TestCreateTracesLoop(t *testing.T) {
}
time.Sleep(time.Millisecond)
}
assert.Greater(t, h.CallCount(), int64(0))
assert.Positive(t, h.CallCount())
}

func TestValidateAdaptiveSamplingTraces(t *testing.T) {
Expand Down
45 changes: 22 additions & 23 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/jaegertracing/jaeger/internal/tools
go 1.22.3

require (
github.com/golangci/golangci-lint v1.59.1
github.com/golangci/golangci-lint v1.60.0
github.com/josephspurrier/goversioninfo v1.4.0
github.com/vektra/mockery/v2 v2.44.1
mvdan.cc/gofumpt v0.6.0
Expand All @@ -16,11 +16,11 @@ require (
github.com/Abirdcfly/dupword v0.0.14 // indirect
github.com/Antonboom/errname v0.1.13 // indirect
github.com/Antonboom/nilnil v0.1.9 // indirect
github.com/Antonboom/testifylint v1.3.1 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/Crocmagnon/fatcontext v0.2.2 // indirect
github.com/Antonboom/testifylint v1.4.3 // indirect
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
github.com/Crocmagnon/fatcontext v0.4.0 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect
github.com/akavel/rsrc v0.10.2 // indirect
Expand All @@ -33,7 +33,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bkielbasa/cyclop v1.2.1 // indirect
github.com/blizzy78/varnamelen v0.8.0 // indirect
github.com/bombsimon/wsl/v4 v4.2.1 // indirect
github.com/bombsimon/wsl/v4 v4.4.1 // indirect
github.com/breml/bidichk v0.2.7 // indirect
github.com/breml/errchkjson v0.3.6 // indirect
github.com/butuzov/ireturn v0.3.0 // indirect
Expand Down Expand Up @@ -67,7 +67,7 @@ require (
github.com/go-viper/mapstructure/v2 v2.0.0 // indirect
github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gofrs/flock v0.12.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect
Expand All @@ -92,7 +92,7 @@ require (
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
github.com/jinzhu/copier v0.3.5 // indirect
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
github.com/jjti/go-spancheck v0.6.1 // indirect
github.com/jjti/go-spancheck v0.6.2 // indirect
github.com/julz/importas v0.1.0 // indirect
github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect
github.com/kisielk/errcheck v1.7.0 // indirect
Expand All @@ -114,18 +114,18 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mgechev/revive v1.3.7 // indirect
github.com/mgechev/revive v1.3.9 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moricho/tparallel v0.3.1 // indirect
github.com/moricho/tparallel v0.3.2 // indirect
github.com/nakabonne/nestif v0.3.1 // indirect
github.com/nishanths/exhaustive v0.12.0 // indirect
github.com/nishanths/predeclared v0.2.2 // indirect
github.com/nunnatsa/ginkgolinter v0.16.2 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polyfloyd/go-errorlint v1.5.2 // indirect
github.com/polyfloyd/go-errorlint v1.6.0 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
Expand All @@ -136,22 +136,22 @@ require (
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
github.com/rs/zerolog v1.29.0 // indirect
github.com/ryancurrah/gomodguard v1.3.2 // indirect
github.com/ryancurrah/gomodguard v1.3.3 // indirect
github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect
github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
github.com/sashamelentyev/usestdlibvars v1.26.0 // indirect
github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect
github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 // indirect
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sivchari/containedctx v1.0.3 // indirect
github.com/sivchari/tenv v1.7.1 // indirect
github.com/sivchari/tenv v1.10.0 // indirect
github.com/sonatard/noctx v0.0.2 // indirect
github.com/sourcegraph/go-diff v0.7.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.15.0 // indirect
Expand All @@ -160,7 +160,6 @@ require (
github.com/stretchr/objx v0.5.2 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect
github.com/tdakkota/asciicheck v0.2.0 // indirect
github.com/tetafro/godot v1.4.16 // indirect
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect
Expand All @@ -169,30 +168,30 @@ require (
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
github.com/ultraware/funlen v0.1.0 // indirect
github.com/ultraware/whitespace v0.1.1 // indirect
github.com/uudashr/gocognit v1.1.2 // indirect
github.com/uudashr/gocognit v1.1.3 // indirect
github.com/xen0n/gosmopolitan v1.2.2 // indirect
github.com/yagipy/maintidx v1.0.0 // indirect
github.com/yeya24/promlinter v0.3.0 // indirect
github.com/ykadowak/zerologlint v0.1.5 // indirect
gitlab.com/bosi/decorder v0.4.2 // indirect
go-simpler.org/musttag v0.12.2 // indirect
go-simpler.org/sloglint v0.7.1 // indirect
go-simpler.org/sloglint v0.7.2 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/automaxprocs v1.5.3 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.22.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.4.7 // indirect
honnef.co/go/tools v0.5.0 // indirect
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect
)
Loading

0 comments on commit f440f1e

Please sign in to comment.