Minor fixes (#396)

* Add missing word

* Rename `boolPtr` to `forkPtr`

This is in order to be consistent with the other flags `wordPtr` &
`numbPtr` which are based on the name of the flag and not the type of
the flag.
This commit is contained in:
Gautam Kotian 2021-09-20 15:37:55 +02:00 committed by GitHub
parent eac6776159
commit 15c92ee528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -14,5 +14,5 @@ Thanks for your interest in contributing to Go by Example!
first_.
* We're not going to change the navigation of the site, in particular adding
a "previous section" link or an "index" link other than the on the title
a "previous section" link or an "index" link other than the one on the title
text.

View File

@ -26,7 +26,7 @@ func main() {
// This declares `numb` and `fork` flags, using a
// similar approach to the `word` flag.
numbPtr := flag.Int("numb", 42, "an int")
boolPtr := flag.Bool("fork", false, "a bool")
forkPtr := flag.Bool("fork", false, "a bool")
// It's also possible to declare an option that uses an
// existing var declared elsewhere in the program.
@ -45,7 +45,7 @@ func main() {
// to get the actual option values.
fmt.Println("word:", *wordPtr)
fmt.Println("numb:", *numbPtr)
fmt.Println("fork:", *boolPtr)
fmt.Println("fork:", *forkPtr)
fmt.Println("svar:", svar)
fmt.Println("tail:", flag.Args())
}