Custom plug-in running error #5237
-
Welcome
Description of the problemI used golangci-lint with tag=v1.62.2, and confirmed that the go.mod version used to generate the custom plugin is the same as tag=v1.62.2, and the go version is the same. Why is it reporting an error?
Version of golangci-lint$ golangci-lint --version
# Paste output here
root@683283a55bb1:/work/test/example-plugin-linter# golangci-lint version
golangci-lint has version 1.62.2 built with go1.23.3 from 89476e7a on 2024-11-25T14:16:01Z Configuration# paste configuration file or CLI flags here Go environment$ go version && go env
# paste output here
go version go1.23.3 linux/amd64
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.3'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/root/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/work/test/example-plugin-linter/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 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1315462551=/tmp/go-build -gno-record-gcc-switches' Verbose output of running$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here
root@683283a55bb1:/work/test/example-plugin-linter# golangci-lint cache clean
root@683283a55bb1:/work/test/example-plugin-linter# golangci-lint run -v
INFO golangci-lint has version 1.62.2 built with go1.23.3 from 89476e7a on 2024-11-25T14:16:01Z
INFO [config_reader] Config search paths: [./ /work/test/example-plugin-linter /work/test /work / /root]
INFO [config_reader] Used config file .golangci.yml
Error: build linters: unable to load custom analyzer "example": example.so, plugin: not implemented
Failed executing command with error: build linters: unable to load custom analyzer "example": example.so, plugin: not implemented A minimal reproducible example or link to a public repository// add your code here Validation
Supporter
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Sorry, but I can see 0 error in the screenshot. The text inside the Maybe your screenshot is incomplete, so copy-paste the text (please no screenshot). |
Beta Was this translation helpful? Give feedback.
-
From your logs:
Your problem is that your plugin doesn't implement the right elements. |
Beta Was this translation helpful? Give feedback.
-
golangci-lint is a binary file downloaded using https://github.com/golangci/golangci-lint/releases/tag/v1.62.2 curl
From the error message, is it because the CGO_ENABLED=0 of the binary file downloaded by curl caused golangci-lint run to fail, while the binary file I generated myself succeeded with CGO_ENABLED=1 |
Beta Was this translation helpful? Give feedback.
You can read the documentation: https://golangci-lint.run/plugins/go-plugins/
You can also use the new plugin system https://golangci-lint.run/plugins/module-plugins/