-
Notifications
You must be signed in to change notification settings - Fork 59
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
SUP-1681: Webhook event type definition for struct literal creation #175
Conversation
…1-Webhook-Type-Literals
This change also means that the aliased types cannot have their own fields, they must use all and only the fields of their "event" types. |
Would require a |
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.
What if we just exported the inner fields so they could be accessed? I don't know if keeping them private is that useful
👆 I think thats a nice approach; similar to what I had implemented first without the inner field type declaration? Would allow for creation like this:
|
Yeah I think that seems okay. And that should be backwards compatible as well right? |
Correct - same process in creating these struct instances as before; export just gives the chance to create them with the inner fields (i.e with declaring the |
Feat (Webhook event types): Webhook event type definitions for allowing creation via struct literals
PR checklist:
examples/
folder -> No services alteredCHANGELOG.md
updated with pending release informationIn previous version of Go-Buildkite; the
type
s of agent, build, job webhook events were created as structs without inner field exporting; meaning that instances of these types couldn't be created in a struct literal manner. A instance of the base type was required first before adding its sub-fields:This PR exports the inner types so that instances can be struct literal created while also keeping the above consuming model above in place - for example:
Addresses #170