]> Cypherpunks repositories - gostls13.git/commitdiff
flag: fix error in documentation example.
authorRob Pike <r@golang.org>
Fri, 25 Mar 2011 18:28:31 +0000 (11:28 -0700)
committerRob Pike <r@golang.org>
Fri, 25 Mar 2011 18:28:31 +0000 (11:28 -0700)
Fixes #1615.
This time for sure.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/4275079

src/pkg/flag/flag.go

index 14f4d522c6a4ea23c70d12808c03834cc175e830..19a3104553f379e5b1b244dac12514d557886142 100644 (file)
@@ -56,7 +56,7 @@
 
                flag.Bool(...)  // global options
                flag.Parse()  // parse leading command
-               subcmd := flag.Arg[0]
+               subcmd := flag.Arg(0)
                switch subcmd {
                        // add per-subcommand options
                }