From eb27dbde135a4ef43b31d977613282b97a5d8830 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 3 Dec 2020 21:53:42 +0200 Subject: [PATCH] lib/flagutil: make golangci-lint happy by using strings.TrimPrefix instead of manual prefix removal via strings.HasPrefix --- lib/flagutil/usage.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/flagutil/usage.go b/lib/flagutil/usage.go index 0e1c56e48..3ddf1f77b 100644 --- a/lib/flagutil/usage.go +++ b/lib/flagutil/usage.go @@ -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" }