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

Ambiguous struct value always passed by reference #27

Closed
diamondburned opened this issue Aug 15, 2021 · 1 comment
Closed

Ambiguous struct value always passed by reference #27

diamondburned opened this issue Aug 15, 2021 · 1 comment

Comments

@diamondburned
Copy link
Owner

When #26 was implemented, all struct types now keep a Go pointer field in it.
This means that, no matter how the Go struct value is transferred around, the
actual C value is always passed by reference. This can be very confusing for
some Go code.

The workaround is probably just to add a piece of documentation into every
single generated record struct to clarify this. The caller is responsible for
calling the Copy() method, if there is one.

@diamondburned
Copy link
Owner Author

Fixed with a comment on every record struct.

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

1 participant