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

chore: keep pointer receiver consistent in generated go code #7219

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jedevc
Copy link
Member

@jedevc jedevc commented Apr 30, 2024

Alternative to #7216 - turns out, #7216 is an issue but for the opposite reason.

MarshalJSON should always be defined on the base, not on a pointer receiver - we had mismatched between the object + interface in our codegen, this PR updates our interface to be the pointer receiver.

Sorry @aweris 😢

Copy link
Contributor

@sipsma sipsma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will change the behavior such that previously we'd return "" for nil structs but now we will return null.

No tests are failing, which is good, but it seems like it might at least trigger this log (though just in theory, worth confirmation): https://github.com/sipsma/dagger/blob/df31953deab1f0deb8f1b9ed8872f595b0de67f2/core/interface.go#L28-L28

Maybe it's worth removing that log if it's now expected to get hit? Just worth a double check cc @vito

Copy link
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label May 17, 2024
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 this pull request may close these issues.

None yet

2 participants