]> Cypherpunks repositories - gostls13.git/commit
testing: comment out flag.Parse from example
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 16 Nov 2016 12:26:23 +0000 (12:26 +0000)
committerIan Lance Taylor <iant@golang.org>
Fri, 25 Nov 2016 16:41:34 +0000 (16:41 +0000)
commit111064925b34bfd60949c09f0d0b06c8f34430f2
treebca5661e83255c8f44f58186ed0812c6b4155a26
parentf7b2f58cda83634ccbe043b011f4899f859756cb
testing: comment out flag.Parse from example

The TestMain docs explain that flag.Parse() should be called if TestMain
itself depends on command-line flags.

The issue here is that the example implementation does not use any
flags, and thus the flag.Parse call is unnecessary. This leads to people
who use this example as a starting point for their own implementations
to forget that the call is not necessary in most cases.

Comment it out instead of removing the line to keep it as a reminder, as
suggested by Minux Ma.

Change-Id: I6ffc5413e7036366ae3cf0f069b7065e832a3b45
Reviewed-on: https://go-review.googlesource.com/33273
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/testing/testing.go