summaryrefslogtreecommitdiff
path: root/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'example_test.go')
-rw-r--r--example_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/example_test.go b/example_test.go
index 2188253..f71fbeb 100644
--- a/example_test.go
+++ b/example_test.go
@@ -30,12 +30,11 @@ func Example_defaultValues() {
os.Args = split("./example")
var args struct {
- Foo string
+ Foo string `default:"abc"`
}
- args.Foo = "default value"
MustParse(&args)
fmt.Println(args.Foo)
- // output: default value
+ // output: abc
}
// This example demonstrates arguments that are required