From 7ac060af1863205e7dfcc103b90711767e45e2a8 Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Mon, 21 Oct 2019 23:13:41 -0700 Subject: update documentation to new way of specifying defaults --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index c516c51..0ad03bc 100644 --- a/README.md +++ b/README.md @@ -142,10 +142,9 @@ Options: ```go var args struct { - Foo string + Foo string `default:"abc"` Bar bool } -args.Foo = "default value" arg.MustParse(&args) ``` @@ -307,9 +306,8 @@ func (n *NameDotName) MarshalText() ([]byte, error) { func main() { var args struct { - Name NameDotName + Name NameDotName `default:"file.txt"` } - args.Name = NameDotName{"file", "txt"} // set default value arg.MustParse(&args) fmt.Printf("%#v\n", args.Name) } -- cgit v1.2.3