mirror of https://github.com/golang/go.git
flag: clarify that the main func in playground is a test example
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" in playground, which
makes the comment confusing.
I can not find a way to keep the name. So I will simply add more
comments to clarify this situation.
This commit is contained in:
parent
55eaae452c
commit
15fc09d440
|
|
@ -78,6 +78,7 @@ func Example() {
|
|||
// to enable the flag package to see the flags defined there, 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 and
|
||||
// We don't run it here because this is not a main function (it's renamed to
|
||||
// "main" in playground, but bear in mind that this is a test example) and
|
||||
// the testing suite has already parsed the flags.
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue