You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The gentypes tool was previously limited to generating optional types for local
types that implemented the MarshalMsgpack and UnmarshalMsgpack methods. Thi
made it impossible to generate optional types for types from external modules.
This commit enhances the generator to support third-party types by introducing
the following new flags:
* -force: To bypass the check for MarshalMsgpack and UnmarshalMsgpack methods.
* -imports: To add necessary imports for the third-party type and custom functions.
* -marshal-func: To specify a custom marshal function.
* -unmarshal-func: To specify a custom unmarshal function.
The generator code has been refactored to use a GenerateOptions struct for
better organization.
Additionally, this commit:
* Adds a new test case for generating an optional type for uuid.UUID.
* Updates the README.md with documentation for the new flags and an example.
* Moves test files to a more appropriate internal/test directory.
Closes #TNTP-3734.
0 commit comments