-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat(gengapic): add support for AutoPopulatedFields UUID4 #1460
feat(gengapic): add support for AutoPopulatedFields UUID4 #1460
Conversation
503ad10
to
754ab1b
Compare
Co-authored-by: Noah Dietz <[email protected]>
…pic-generator-go into gengapic-autopopulatedfields
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.
Since we are adding a net new dependency to generated code, can you also include the dep for bazel here: https://github.com/googleapis/gapic-generator-go/blob/main/rules_go_gapic/go_gapic.bzl#L156-L157
"@com_github_google_uuid//:go_default_library"
I think should do it.
@noahdietz Updated with the UUID dependency, thank you. I locally ran the bazel targets for the "usual suspects" set of gapic libraries:
|
internal/gengapic/gengapic.go
Outdated
p("if req != nil && req.%s == nil {", f) | ||
} else { | ||
// Type will be string if field does not have explicit presence. | ||
p("if req != nil && req.%s == \"\" {", f) |
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.
p("if req != nil && req.%s == \"\" {", f) | |
p("if req != nil && req.Get%s() == \"\" {", f) |
But we may want to use buildAccessor
to get this string instead of just doing snakeToCmael...
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.
Updated with buildAccessor
, PTAL, thanks!
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.
Please check the update .want
files to verify the output now looks good, thanks!
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.
I'm sorry @quartzmo I should've been more explicit in my comments
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.
LGTM great work and thanks for your patience with my review. Add that test we spoke about offline and you are good to go.
No description provided.