diff options
| author | Cameron Moore <[email protected]> | 2016-09-09 08:42:53 -0500 |
|---|---|---|
| committer | Cameron Moore <[email protected]> | 2016-09-09 08:42:53 -0500 |
| commit | 5b54501df936f43e0d858576a9285b65f30407fa (patch) | |
| tree | 1adc4c7daa8182dacc9226e19bd4edc9310ee855 /flag_test.go | |
| parent | 6fd2ff4ff8dfcdf5556fbdc0ac0284408274b1a7 (diff) | |
Fix default values for custom fields
Fallback to the original default detection logic if we have an unknown
type.
Fixes #91
Diffstat (limited to 'flag_test.go')
| -rw-r--r-- | flag_test.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/flag_test.go b/flag_test.go index 1befb94..b294fc7 100644 --- a/flag_test.go +++ b/flag_test.go @@ -891,6 +891,7 @@ const defaultOutput = ` --A for bootstrapping, allo --StringSlice stringSlice string slice with zero default --Z int an int that defaults to zero --custom custom custom Value implementation + --customP custom a VarP with default (default 10) --maxT timeout set timeout for dial ` @@ -934,6 +935,9 @@ func TestPrintDefaults(t *testing.T) { var cv customValue fs.Var(&cv, "custom", "custom Value implementation") + cv2 := customValue(10) + fs.VarP(&cv2, "customP", "", "a VarP with default") + fs.PrintDefaults() got := buf.String() if got != defaultOutput { |
