Skip to content

Commit

Permalink
Merge pull request mwitkow#1 from benclive/dyn-bool
Browse files Browse the repository at this point in the history
Setting default value for bool flags
  • Loading branch information
daniellowtw committed Feb 15, 2019
2 parents a4cf664 + 3b00d5d commit 46696ef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dynbool.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func DynBool(flagSet *flag.FlagSet, name string, value bool, usage string) *DynB
v := boolToInt(value)
dynValue := &DynBoolValue{ptr: &v}
flag := flagSet.VarPF(dynValue, name, "", usage)
flag.NoOptDefVal = "true"
MarkFlagDynamic(flag)
return dynValue
}
Expand Down

0 comments on commit 46696ef

Please sign in to comment.