Skip to content

Commit 534e9fa

Browse files
authored
Merge pull request #42 from moznion/doc
📝 doc
2 parents c591ab2 + a353d89 commit 534e9fa

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Usage of gonstructor:
3636
[optional] Output file name (default "srcdir/<type>_gen.go"). See also "-type" option's description.'
3737
-propagateInitFuncReturns
3838
[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.
39+
-returnValue
40+
[optional] return "value" instead of pointer
41+
-setterPrefix string
42+
[optional] prefix for setter methods in builder pattern (e.g., 'With' generates WithFoo instead of Foo)
3943
-type value
4044
[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.
4145
-version

cmd/gonstructor/gonstructor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func main() {
3939
withGetter := flag.Bool("withGetter", false, "[optional] generate a constructor along with getter functions for each field")
4040
initFunc := flag.String("init", "", "[optional] name of function to call on object after creating it")
4141
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.`)
42-
returnValue := flag.Bool("returnValue", false, "[optional] return value instead of pointer")
42+
returnValue := flag.Bool("returnValue", false, "[optional] return \"value\" instead of pointer")
4343
setterPrefix := flag.String("setterPrefix", "", "[optional] prefix for setter methods in builder pattern (e.g., 'With' generates WithFoo instead of Foo)")
4444

4545
flag.Parse()

0 commit comments

Comments
 (0)