From a6af419fff15e031332604d9d99a9318881e99a7 Mon Sep 17 00:00:00 2001 From: Pavel Borzenkov Date: Tue, 20 Nov 2018 12:32:32 +0300 Subject: [PATCH] README: update TextUnmarshaler example Values are much more convenient to use in argument structs, so update README to use them instead of pointers in the example as we now support this. Signed-off-by: Pavel Borzenkov --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8980ba1..8e68ca7 100644 --- a/README.md +++ b/README.md @@ -288,10 +288,10 @@ func (n *NameDotName) MarshalText() (text []byte, err error) { func main() { var args struct { - Name *NameDotName + Name NameDotName } // set default - args.Name = &NameDotName{"file", "txt"} + args.Name = NameDotName{"file", "txt"} arg.MustParse(&args) fmt.Printf("%#v\n", args.Name) } @@ -305,10 +305,10 @@ Options: --help, -h display this help and exit $ ./example -&main.NameDotName{Head:"file", Tail:"txt"} +main.NameDotName{Head:"file", Tail:"txt"} $ ./example --name=foo.bar -&main.NameDotName{Head:"foo", Tail:"bar"} +main.NameDotName{Head:"foo", Tail:"bar"} $ ./example --name=oops Usage: example [--name NAME]