Documentation ¶
Overview ¶
option-gen is a tool for auto-generating with struct field functions.
option-gen can be generated for individual types, rather than the entire package by specifying a comment on the type or filed definition of the form:
// +gen:option=true
You can not participate in the generation by setting the field a comment on the type definition of the form:
// +gen:option=true type Struct struct { // +option=false Field string }
You can also specify the field name that needs to be generated a comment on the type definition of the form:
// +gen:option:fields=field1,field2,field3
Option names and suffixes can be customized by setting the field a comment on the type definition of the form:
// +gen:option:name=StructOptionName // +gen:option:suffix=StructOptionNameSuffix
Click to show internal directories.
Click to hide internal directories.