From 7d92a8f6eb295f28cf9e77028b3e711144ab0234 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Thu, 5 Mar 2020 16:29:24 -0600 Subject: [PATCH] Simplify code per golangci-lint recommendation --- pkg/version/perl.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/version/perl.go b/pkg/version/perl.go index 3ad74fd..d1bfb5a 100644 --- a/pkg/version/perl.go +++ b/pkg/version/perl.go @@ -114,9 +114,7 @@ func removeLeadingZeros(s string) string { } func parsePerlVStringVersion(version string) (*Version, error) { - if strings.HasPrefix(version, "v") { - version = version[1:] - } + version = strings.TrimPrefix(version, "v") version = strings.ReplaceAll(version, "_", "") segments := strings.Split(version, ".") for i, s := range segments {