Skip to content
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

could not load export data: no export data for "github.com/ethereum/go-ethereum/metrics" #27897

Closed
yangyile1990 opened this issue Aug 10, 2023 · 7 comments · Fixed by #27909
Labels

Comments

@yangyile1990
Copy link

golangci-lint run
WARN [runner] Can't run linter goanalysis_metalinter: buildir: failed to load package metrics: could not load export data: no export data for "github.com/ethereum/go-ethereum/metrics"
ERRO Running error: 1 error occurred:
* can't run linter goanalysis_metalinter: buildir: failed to load package metrics: could not load export data: no export data for "github.com/ethereum/go-ethereum/metrics"

@yangyile1990
Copy link
Author

yangyile1990 commented Aug 10, 2023

Cannot use 'namedMetric.less' (type func(namedMetric, namedMetric) bool) as the type func(a namedMetric, b namedMetric) int

slices.SortFunc(namedMetrics, namedMetric.less)

func SortFunc[S ~[]E, E any](x S, cmp func(a, b E) int) {
n := len(x)
pdqsortCmpFunc(x, 0, n, bits.Len(uint(n)), cmp)
}

func (m namedMetric) less(other namedMetric) bool {
return m.name < other.name
}

@karalabe
Copy link
Member

I assume your dependencies are wonky. Make sure you have the versions we depend on if you use go-ethereum as a library.

@yangyile1990
Copy link
Author

But i don't know the reason.
my mod is:

github.com/ethereum/go-ethereum v1.12.1

golang.org/x/exp v0.0.0-20230810033253-352e893a4cad // indirect

then it failed.

@karalabe
Copy link
Member

Do you have other deps too? Maybe something pulls in a newer version of the exp?

@karalabe
Copy link
Member

Checked it out, and our dep for exp is v0.0.0-20230515195305-f3d0a9c9a5cc, if I update to your version it indeed fails. Seems you have some other thing that forces the update?

@karalabe
Copy link
Member

Yeah, the upstream golang/x/ext broke their API signatures. They ack in in the commit that it's going to be nasty, but that's life. Anyway, opened a PR above to update out dependency too and fix all the broken code.

@yangyile1990
Copy link
Author

thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants