Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Usage of gonstructor:
[optional] Output file name (default "srcdir/<type>_gen.go"). See also "-type" option's description.'
-propagateInitFuncReturns
[optional] If this option is specified, the generated constructor propagates the return values that come from the init function specified by the "-init" option, e.g. when the init function returns an "error" value, the generated constructor returns (*YourStructType, error). Known issue: If this option is used with the multiple --type options, probably it won't be the expected result.
-returnValue
[optional] return "value" instead of pointer
-setterPrefix string
[optional] prefix for setter methods in builder pattern (e.g., 'With' generates WithFoo instead of Foo)
-type value
[mandatory] A type name. It accepts this option occurs multiple times to output the generated code of the multi types into a single file. If this option is given multiple times, the "-output" option becomes mandatory.
-version
Expand Down
2 changes: 1 addition & 1 deletion cmd/gonstructor/gonstructor.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func main() {
withGetter := flag.Bool("withGetter", false, "[optional] generate a constructor along with getter functions for each field")
initFunc := flag.String("init", "", "[optional] name of function to call on object after creating it")
propagateInitFuncReturns := flag.Bool("propagateInitFuncReturns", false, `[optional] If this option is specified, the generated constructor propagates the return values that come from the init function specified by the "-init" option, e.g. when the init function returns an "error" value, the generated constructor returns (*YourStructType, error). Known issue: If this option is used with the multiple --type options, probably it won't be the expected result.`)
returnValue := flag.Bool("returnValue", false, "[optional] return value instead of pointer")
returnValue := flag.Bool("returnValue", false, "[optional] return \"value\" instead of pointer")
setterPrefix := flag.String("setterPrefix", "", "[optional] prefix for setter methods in builder pattern (e.g., 'With' generates WithFoo instead of Foo)")

flag.Parse()
Expand Down
Loading