-
Notifications
You must be signed in to change notification settings - Fork 569
support internalising structs #1229
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
support internalising structs #1229
Conversation
I've introduced #1230 which I hope will resolve the build failures, which appear unrelated to these changes. |
Thanks for your contribution. I think this could be well improved with the addition of a test (or a few) to demonstrate the new functionality, and that it's working fully as intended. |
@flimzy added some tests, works well. |
tests/js_test.go
Outdated
if a.Name != "foo" || a.Age != 952 { | ||
t.Fail() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and below: please use https://pkg.go.dev/github.com/google/go-cmp/cmp#Diff to do the comparison.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The change looks good to me, save for one minor suggestion. Thank you for the contribution! |
That description doesn't ring a bell. Would you mind separate issue and providing a reproduction example? |
sure, opened here #1231 |
This PR adds code that maps JavaScript object fields to Go struct fields.
Updated the $kindStruct case with a loop to dynamically map JavaScript object fields to corresponding Go struct fields.
Stuff I've tested,
possibly fixes #975