From b4280ab91fcf76860b124009be57ff45d08751f2 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 4 Apr 2020 16:06:31 +0200 Subject: 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 --- pkg/vcs/vcs.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkg/vcs') 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]+))?$`) -- cgit mrf-deployment