aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs
diff options
context:
space:
mode:
authorPaul Chaignon <paul.chaignon@gmail.com>2020-04-04 16:06:31 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-04-06 08:39:56 +0200
commitb4280ab91fcf76860b124009be57ff45d08751f2 (patch)
tree8b363f4a8c3a1c5d01a3193bbce18a9620ed64c0 /pkg/vcs
parentd9ed075d1a287f63cfa1dc84cbf609e624b26bc7 (diff)
pkg/vcs: Fix golangci-lint formatting error
pkg/vcs/vcs.go:186:2: var `gitSshRepoRe` should be `gitSSHRepoRe` gitSshRepoRe = regexp.MustCompile(`^(git|ssh|http|https|ftp|ftps)@[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)+(:[a-zA-Z0-9-_]+)?(/[a-zA-Z0-9-_./]+)?(/)?$`) ^ Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Diffstat (limited to 'pkg/vcs')
-rw-r--r--pkg/vcs/vcs.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/vcs/vcs.go b/pkg/vcs/vcs.go
index aa38be27d..45751f598 100644
--- a/pkg/vcs/vcs.go
+++ b/pkg/vcs/vcs.go
@@ -154,7 +154,7 @@ func Patch(dir string, patch []byte) error {
// CheckRepoAddress does a best-effort approximate check of a git repo address.
func CheckRepoAddress(repo string) bool {
- return gitRepoRe.MatchString(repo) || gitSshRepoRe.MatchString(repo)
+ return gitRepoRe.MatchString(repo) || gitSSHRepoRe.MatchString(repo)
}
// CheckBranch does a best-effort approximate check of a git branch name.
@@ -182,8 +182,9 @@ func runSandboxedEnv(dir, command string, env []string, args ...string) ([]byte,
var (
// nolint: lll
- gitRepoRe = regexp.MustCompile(`^(git|ssh|http|https|ftp|ftps)://[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)+(:[0-9]+)?(/[a-zA-Z0-9-_./]+)?(/)?$`)
- gitSshRepoRe = regexp.MustCompile(`^(git|ssh|http|https|ftp|ftps)@[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)+(:[a-zA-Z0-9-_]+)?(/[a-zA-Z0-9-_./]+)?(/)?$`)
+ gitRepoRe = regexp.MustCompile(`^(git|ssh|http|https|ftp|ftps)://[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)+(:[0-9]+)?(/[a-zA-Z0-9-_./]+)?(/)?$`)
+ // nolint: lll
+ gitSSHRepoRe = regexp.MustCompile(`^(git|ssh|http|https|ftp|ftps)@[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)+(:[a-zA-Z0-9-_]+)?(/[a-zA-Z0-9-_./]+)?(/)?$`)
gitBranchRe = regexp.MustCompile("^[a-zA-Z0-9-_/.]{2,200}$")
gitHashRe = regexp.MustCompile("^[a-f0-9]{8,40}$")
releaseTagRe = regexp.MustCompile(`^v([0-9]+).([0-9]+)(?:\.([0-9]+))?$`)