]> Cypherpunks repositories - gostls13.git/commit
flag: disallow setting flags multiple times
authorRob Pike <r@golang.org>
Sun, 19 Oct 2014 17:33:22 +0000 (10:33 -0700)
committerRob Pike <r@golang.org>
Sun, 19 Oct 2014 17:33:22 +0000 (10:33 -0700)
commit8c29633368994eb56f19d9d15f1a3433f5e9306a
treee110b07d1ddbd82553cf44196d839250370d6339
parent3c5fd98918e0c1c22566b19769a0a370b1321737
flag: disallow setting flags multiple times
This is a day 1 error in the flag package: It did not check
that a flag was set at most once on the command line.
Because user-defined flags may have more general
properties, the check applies only to the standard flag
types in this package: bool, string, etc.

Fixes #8960.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/156390043
src/flag/flag.go
src/flag/flag_test.go