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

Fix receivers defined on cgo type aliases #517

Closed
wants to merge 1 commit into from

Conversation

masih
Copy link
Member

@masih masih commented Feb 18, 2025

As of Go 1.24, the compiler will now always fail if receivers are defined on cgo-generated type aliases. Fix the issue by wrapping the cgo-generated types and access to underlying type via delegate field. Note that such types cannot be embedded in go structs. Hence, the explicit field.

See:

As of Go 1.24, the compiler will now always fail if receivers are
defined on cgo-generated type aliases. Fix the issue by wrapping the
cgo-generated types and access to underlying type via `delegate` field.
Note that such types cannot be embedded in go structs. Hence, the
explicit field.

See:
 * https://tip.golang.org/doc/go1.24#compiler
@masih masih force-pushed the masih/fix-receiver-cgo branch from dc3e71e to 679f917 Compare February 19, 2025 11:48
@masih masih marked this pull request as ready for review February 19, 2025 12:14
@Stebalien
Copy link
Member

This adds a lot of pointer indirection and that makes me a bit nervous. How about something like #518?

@masih
Copy link
Member Author

masih commented Feb 24, 2025

How about something like #518?

That works too 👍

@masih masih closed this Feb 24, 2025
@masih masih deleted the masih/fix-receiver-cgo branch February 24, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

2 participants