build: fix gocritic lint issue dupbranchbody

This commit is contained in:
albertony 2024-05-31 16:10:19 +02:00 committed by Nick Craig-Wood
parent 64e8013c1b
commit 86e9a56d73
2 changed files with 2 additions and 14 deletions

View File

@ -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) {

View File

@ -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