From 5f740d6875ab6961381f2f4614b21ff6ddf448a4 Mon Sep 17 00:00:00 2001 From: Gabriel Aszalos Date: Tue, 17 Oct 2017 19:57:01 +0200 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/flag/flag.go | 6 +----- 1 file changed, 1 insertion(+), 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 -- 2.48.1