Skip to content

After Perfsprint Analyzer got updated, building the linter doesn't work anymore #4161

@mdonkers

Description

@mdonkers

Welcome

Description of the problem

Perfsprint linter got updated, which breaks current usage. Before it had a Analyzer instance defined:
https://github.com/catenacyber/perfsprint/blob/18f87061773e90f98fd9d24a3f0dbebc9f23bab7/analyzer/analyzer.go#L17

With version 0.3.0, this got replace by the New() method:
https://github.com/catenacyber/perfsprint/blob/fc24f10e1bd98e69c4e44fd8019309e6199459e9/analyzer/analyzer.go#L26

Including tools such as e.g. OpenTelemetry Collector has (https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/baf4ccef1abfc46b048930f0272cc1112ebd45d6/internal/tools/go.mod#L8) will then fail the build with:

$ go build -o collector/.tools/golangci-lint -trimpath github.com/golangci/golangci-lint/cmd/golangci-lint
# github.com/golangci/golangci-lint/pkg/golinters
/home/miel/.go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/perfsprint.go:11:16: undefined: analyzer.Analyzer

Version of golangci-lint

$ golangci-lint --version
[email protected]

Configuration

# paste configuration file or CLI flags here

Go environment

$ go version && go env
go version go1.21.1 linux/amd64
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/miel/.cache/go-build'
GOENV='/home/miel/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/miel/.go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/miel/.go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='collector/internal/tools/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1880704451=/tmp/go-build -gno-record-gcc-switches'

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here

A minimal reproducible example or link to a public repository

// add your code here

Validation

  • Yes, I've included all information above (version, config, etc.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesRelates to an upstream dependency

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions