]> Cypherpunks repositories - gostls13.git/commit
flag: add implicit boolFlag interface
authorRick Arnold <rickarnoldjr@gmail.com>
Sat, 22 Dec 2012 18:34:48 +0000 (13:34 -0500)
committerRuss Cox <rsc@golang.org>
Sat, 22 Dec 2012 18:34:48 +0000 (13:34 -0500)
commita6d986bd8a5db918a92456b4a4c44075c13a20da
treede6cca2b3ce635827554960168b03ec3c0ff32b3
parent9aef20e823f43eadc2171ea4cf713dddf60cd4dd
flag: add implicit boolFlag interface

Any flag.Value that has an IsBoolFlag method that returns true
will be treated as a bool flag type during parsing.

Fixes #4262.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6944064
src/pkg/flag/flag.go
src/pkg/flag/flag_test.go