mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
chore(lint): enable regexpSimplify rule from go-critic (#23405)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
parent
52ad029110
commit
a91a6594a1
3 changed files with 2 additions and 3 deletions
|
|
@ -67,7 +67,6 @@ linters:
|
|||
- paramTypeCombine
|
||||
- ptrToRefParam
|
||||
- rangeValCopy
|
||||
- regexpSimplify
|
||||
- sloppyReassign
|
||||
- tooManyResultsChecker
|
||||
- typeDefFirst
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ func (db *db) CreateRepoCertificate(ctx context.Context, certificates *appsv1.Re
|
|||
return nil, fmt.Errorf("invalid hostname in request: %s", certificate.ServerName)
|
||||
} else if certificate.CertType == "ssh" {
|
||||
// Matches "[hostname]:port" format
|
||||
reExtract := regexp.MustCompile(`^\[(.*)\]\:[0-9]+$`)
|
||||
reExtract := regexp.MustCompile(`^\[(.*)\]:\d+$`)
|
||||
matches := reExtract.FindStringSubmatch(certificate.ServerName)
|
||||
var hostnameToCheck string
|
||||
if len(matches) == 0 {
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ func WithEventHandlers(handlers EventHandlers) ClientOpts {
|
|||
}
|
||||
|
||||
func NewClient(rawRepoURL string, creds Creds, insecure bool, enableLfs bool, proxy string, noProxy string, opts ...ClientOpts) (Client, error) {
|
||||
r := regexp.MustCompile("(/|:)")
|
||||
r := regexp.MustCompile(`([/:])`)
|
||||
normalizedGitURL := NormalizeGitURL(rawRepoURL)
|
||||
if normalizedGitURL == "" {
|
||||
return nil, fmt.Errorf("repository %q cannot be initialized: %w", rawRepoURL, ErrInvalidRepoURL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue