diff options
author | Gabriel Aszalos <gabriel.aszalos@gmail.com> | 2017-10-17 19:57:01 +0200 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2017-10-17 20:23:14 +0000 |
commit | 5f740d6875ab6961381f2f4614b21ff6ddf448a4 (patch) | |
tree | 0d0a30a2736541e9b88984673034049e7d3e003a /src/flag | |
parent | 58cf881c1c61544d467b265950a942ec2aeb9d28 (diff) | |
download | go-5f740d6875ab6961381f2f4614b21ff6ddf448a4.tar.gz go-5f740d6875ab6961381f2f4614b21ff6ddf448a4.zip |
flag: simplify switch-case in isZeroValue
Simplifies the switch statement in the isZeroValue function by merging
the case branches.
Change-Id: I5b27939b62808dadac0cef632567b17e0e2b9a1d
Reviewed-on: https://go-review.googlesource.com/71390
Run-TryBot: Gabriel Aszalos <gabriel.aszalos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/flag')
-rw-r--r-- | src/flag/flag.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/flag/flag.go b/src/flag/flag.go index 5544a25282..fde7411f82 100644 --- a/src/flag/flag.go +++ b/src/flag/flag.go @@ -400,11 +400,7 @@ func isZeroValue(flag *Flag, value string) bool { } switch value { - case "false": - return true - case "": - return true - case "0": + case "false", "", "0": return true } return false |