From 86e9a56d7389150bc5a6cbee9f91757d1830ee3d Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Fri, 31 May 2024 16:10:19 +0200 Subject: [PATCH] build: fix gocritic lint issue dupbranchbody --- fs/countsuffix.go | 8 +------- fs/sizesuffix.go | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/fs/countsuffix.go b/fs/countsuffix.go index 232a2ff43..b3e1daa9e 100644 --- a/fs/countsuffix.go +++ b/fs/countsuffix.go @@ -81,13 +81,7 @@ func (x CountSuffix) Unit(unit string) string { if val == "off" { return val } - var suffixUnit string - if suffix != "" && unit != "" { - suffixUnit = suffix + unit - } else { - suffixUnit = suffix + unit - } - return val + " " + suffixUnit + return val + " " + suffix + unit } func (x *CountSuffix) multiplierFromSymbol(s byte) (found bool, multiplier float64) { diff --git a/fs/sizesuffix.go b/fs/sizesuffix.go index 0a2a5661c..c8d454e81 100644 --- a/fs/sizesuffix.go +++ b/fs/sizesuffix.go @@ -82,13 +82,7 @@ func (x SizeSuffix) unit(unit string) string { if val == "off" { return val } - var suffixUnit string - if suffix != "" && unit != "" { - suffixUnit = suffix + unit - } else { - suffixUnit = suffix + unit - } - return val + " " + suffixUnit + return val + " " + suffix + unit } // BitUnit turns SizeSuffix into a string with bit unit