diff options
| author | Pavel Borzenkov <[email protected]> | 2018-11-20 12:32:32 +0300 |
|---|---|---|
| committer | Pavel Borzenkov <[email protected]> | 2018-11-20 12:32:32 +0300 |
| commit | a6af419fff15e031332604d9d99a9318881e99a7 (patch) | |
| tree | 091e3c1bf1decbc9a2fa7dd00bbacbe67ef6b2b7 /README.md | |
| parent | f1aabd5026533b5f61cabc38a5fd8a1af3148342 (diff) | |
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 <[email protected]>
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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] |
