diff options
| author | Zeke Lu <lvzecai@gmail.com> | 2022-10-25 23:18:45 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-10-26 18:59:00 +0000 |
| commit | 29674d87e697e10b658d5676a2f547d555c2c534 (patch) | |
| tree | c99ac2e0c8ce8b87cfebd1a613aab80a8bd4ac28 /src/testing/example.go | |
| parent | 2a2b163bb9125389c5f70e65aec21816e2ea09c5 (diff) | |
| download | go-29674d87e697e10b658d5676a2f547d555c2c534.tar.xz | |
flag: clarify that the main func at pkg.go.dev is part of a testing suite
flag.Example() has this comment:
... one must execute, typically at the start of main (not init!):
flag.Parse()
We don't run it here because this is not a main function
This example function will be renamed to "main" at pkg.go.dev, which
makes the comment confusing.
See https://pkg.go.dev/flag#example-package.
This change modify the comment to clarify this situation.
Change-Id: I17357fdaaefe54791fff8fbbf6a33003af207f88
GitHub-Last-Rev: eeea8ce39cda3321d51c6cfe29fbcb2444fbf9cd
GitHub-Pull-Request: golang/go#56411
Reviewed-on: https://go-review.googlesource.com/c/go/+/445315
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/testing/example.go')
0 files changed, 0 insertions, 0 deletions
