From f09b41c7da79d6045ac16eda3fe745b54e23c371 Mon Sep 17 00:00:00 2001 From: Benoit Gagnon Date: Thu, 24 Oct 2019 10:47:35 -0400 Subject: [PATCH] use regexp.MustCompile Co-Authored-By: David Genest --- pkg/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/git.go b/pkg/git.go index 375a5b8..00ac845 100644 --- a/pkg/git.go +++ b/pkg/git.go @@ -178,7 +178,7 @@ func (p *GitPackage) Install(ctx context.Context, name, dir, version string) (st // If the ref resolution failed and "version" looks like a SHA1, assume it is one // and proceed. - commitShaPattern, _ := regexp.Compile("^([0-9a-f]{40})$") + commitShaPattern := regexp.MustCompile("^([0-9a-f]{40})$") if commitSha == "" && commitShaPattern.MatchString(version) { commitSha = version }