lib/flagutil: make golangci-lint happy by using strings.TrimPrefix instead of manual prefix removal via strings.HasPrefix

This commit is contained in:
Aliaksandr Valialkin 2020-12-03 21:53:42 +02:00
parent bdac2171f1
commit 528587deef

View File

@ -31,9 +31,6 @@ func isHelpArg(arg string) bool {
if !strings.HasPrefix(arg, "-") {
return false
}
arg = arg[1:]
if strings.HasPrefix(arg, "-") {
arg = arg[1:]
}
arg = strings.TrimPrefix(arg[1:], "-")
return arg == "h" || arg == "help"
}