mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-11 23:50:05 +01:00
use regexp.MustCompile
Co-Authored-By: David Genest <david.genest@gmail.com>
This commit is contained in:
parent
a44fae09a0
commit
f09b41c7da
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue