Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Libs(Go): add convenience constructor for static nullable strings
Fixes <#1198> While this isn't quite the type of change that was requested in #1198, I'm hopeful it'll reduce a bit of the friction. A new constructor is now available as `svix.StaticNullableString()` which gives an `openapi.NullableString`. Note that the return type (not a pointer) is inconsistent with the rest of the functions that act as primative constructors, and in fact goes against the convention of constructors returning pointers to the value they initialize. The issue was raised, however, that all the places in the lib where a `NullableString` is needed, we'd have to dereference it anyway. Since this alt constructor is all about convenience, we may as well break convention. _In for a penny, in for a pound..._ The net effect is instead of: ```go appIn := svix.ApplicationIn{ ... Uid: *svix.NullableString(svix.String("myuid")) } ``` folks will now be able to write: ```go appIn := svix.ApplicationIn{ ... Uid: svix.StaticNullableString("myuid") } ```
- Loading branch information