summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPavel Borzenkov <[email protected]>2018-11-20 12:32:32 +0300
committerPavel Borzenkov <[email protected]>2018-11-20 12:32:32 +0300
commita6af419fff15e031332604d9d99a9318881e99a7 (patch)
tree091e3c1bf1decbc9a2fa7dd00bbacbe67ef6b2b7 /README.md
parentf1aabd5026533b5f61cabc38a5fd8a1af3148342 (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.md8
1 files 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]