mirror of https://github.com/golang/go.git
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>
This commit is contained in:
parent
58cf881c1c
commit
5f740d6875
|
|
@ -400,11 +400,7 @@ func isZeroValue(flag *Flag, value string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch value {
|
switch value {
|
||||||
case "false":
|
case "false", "", "0":
|
||||||
return true
|
|
||||||
case "":
|
|
||||||
return true
|
|
||||||
case "0":
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue