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

Wrong type for anonymous func in identify/id.go #2480

Closed
bahner opened this issue Aug 14, 2023 · 5 comments
Closed

Wrong type for anonymous func in identify/id.go #2480

bahner opened this issue Aug 14, 2023 · 5 comments

Comments

@bahner
Copy link

bahner commented Aug 14, 2023

compile fails. I have no idea what causes the error. But it seems lilke an obvious error.

../../go/pkg/mod/github.com/libp2p/[email protected]/p2p/protocol/identify/id.go:559:25: type func(a multiaddr.Multiaddr, b multiaddr.Multiaddr) bool of func(a, b ma.Multiaddr) bool {…} does not match inferred type func(a multiaddr.Multiaddr, b multiaddr.Multiaddr) int for func(a E, b E) int
../../go/pkg/mod/github.com/libp2p/[email protected]/p2p/protocol/identify/obsaddr.go:217:22: type func(first *observedAddr, second *observedAddr) bool of func(first, second *observedAddr) bool {…} does not match inferred type func(a *observedAddr, b *observedAddr) int for func(a E, b E) int

@MarcoPolo
Copy link
Collaborator

Are you using Go 1.21? This looks like the change that was made in the slices package to the compare fn type.

Go 1.21 isn't supported until we release a new version with #2478 .

Please include your environment and a repro.

@bahner bahner changed the title Wrong type Wrong type for anonymous func in identify/id.go Aug 14, 2023
@bahner
Copy link
Author

bahner commented Aug 14, 2023

hepp! yes. I was just about to write: This works in go1.19, but not with go1.2* So it also fails with go1.20. But Im happy to wait a few days until 0.30 is out and follow up on this then. Feel free to leave it. I can work with 1.19 until then.

@bahner
Copy link
Author

bahner commented Aug 14, 2023

Related to this, I take it. #2369

@marten-seemann
Copy link
Contributor

This has been reported multiple times and has since been fixed.

@chenjia404
Copy link

I use go 1.20.7 same situation

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

No branches or pull requests

4 participants