Skip to content

Running error: can't run linter goanalysis_metalinter (Version 1.59.1) #4964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chaseSpace opened this issue Aug 28, 2024 · 5 comments
Closed
Labels
question Further information is requested

Comments

@chaseSpace
Copy link

$ golangci-lint --version        
golangci-lint has version 1.59.1 built with go1.22.3 from 1a55854a on 2024-06-09T18:08:33Z
$  go version && go env
go version go1.20.14 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="/usr/local/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/usr/local/gopath"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.14"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/mnt/hgfs/gg/go-microsvc-template/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 -fdebug-prefix-map=/tmp/go-build4241019723=/tmp/go-build -gno-record-gcc-switches"

Details:

$ golangci-lint run --timeout 1m 
WARN [runner] Can't run linter goanalysis_metalinter: inspect: failed to load package : could not load export data: no export data for "microsvc/pkg/xkafka" 
ERRO Running error: can't run linter goanalysis_metalinter
inspect: failed to load package : could not load export data: no export data for "microsvc/pkg/xkafka" 

About microsvc/pkg/xkafka (no special code):

package xkafka

import (
	"context"
	"github.com/pkg/errors"
	"microsvc/consts"
	"microsvc/deploy"
	"microsvc/infra/xmq/define"
)

var _ define.MqProviderAPI = (*MqKafka)(nil)

type MqKafka struct {
}

func (m *MqKafka) Init(cc *deploy.MqConfig) error {
	return errors.New("implement me")
}

func (m *MqKafka) Stop() {
	//TODO implement me
}

func (m *MqKafka) Publish(topic consts.Topic, msg []byte) error {
	//TODO implement me
	panic("implement me")
}

func (m *MqKafka) Subscribe(topic consts.Topic, handler func(ctx context.Context, msg []byte) error) ([]byte, error) {
	//TODO implement me
	panic("implement me")
}

Originally posted by @chaseSpace in #4482 (comment)

Copy link

boring-cyborg bot commented Aug 28, 2024

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@chaseSpace
Copy link
Author

I cannot provide a minimum reproducible example as I do not know where it was triggered.

@chaseSpace chaseSpace changed the title Running error: can't run linter goanalysis_metalinter (Latest Version 1.59.1) Running error: can't run linter goanalysis_metalinter (Version 1.59.1) Aug 28, 2024
@chaseSpace
Copy link
Author

Even i upgrade to latest version 1.60.3, this problem still exists.

go-microsvc-template git:(main) ✗ curl -sSfL https://raw.gitmirror.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v1.60.3 
golangci/golangci-lint info checking GitHub for tag 'v1.60.3'
golangci/golangci-lint info found version: 1.60.3 for v1.60.3/linux/amd64
golangci/golangci-lint info installed /usr/bin/golangci-lint
➜  go-microsvc-template git:(main) ✗ golangci-lint --version          
golangci-lint has version 1.60.3 built with go1.23.0 from c2e095c0 on 2024-08-22T21:51:56Z
➜  go-microsvc-template git:(main) ✗ golangci-lint run --timeout 1m   
WARN [runner] Can't run linter goanalysis_metalinter: inspect: failed to load package : could not load export data: no export data for "microsvc/pkg/xkafka" 
ERRO Running error: can't run linter goanalysis_metalinter
inspect: failed to load package : could not load export data: no export data for "microsvc/pkg/xkafka" 

@ldez
Copy link
Member

ldez commented Aug 28, 2024

Please open an issue by following the issue form, thank you.

https://github.com/golangci/golangci-lint/issues/new/choose

@ldez ldez closed this as completed Aug 28, 2024
@ldez ldez added the question Further information is requested label Aug 28, 2024
@szaydel

This comment was marked as off-topic.

@golangci golangci locked and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants