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 9d787f9edd
commit eb27dbde13

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"
}