From 178239a666b6d020212706d1e944e5c15ca37d17 Mon Sep 17 00:00:00 2001 From: Beatriz Vieira Date: Sat, 31 Jul 2021 17:52:25 -0300 Subject: [PATCH] refactor: fix lint gosimple S1007 --- sv/message.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sv/message.go b/sv/message.go index 050ecf9..6def635 100644 --- a/sv/message.go +++ b/sv/message.go @@ -82,7 +82,7 @@ func (p MessageProcessorImpl) Validate(message string) error { subject, body := splitCommitMessageContent(message) msg := p.Parse(subject, body) - if !regexp.MustCompile("^[a-z+]+(\\(.+\\))?!?: .+$").MatchString(subject) { + if !regexp.MustCompile(`^[a-z+]+(\(.+\))?!?: .+$`).MatchString(subject) { return fmt.Errorf("subject [%s] should be valid according with conventional commits", subject) } @@ -229,7 +229,7 @@ func (p MessageProcessorImpl) Parse(subject, body string) CommitMessage { } func parseSubjectMessage(message string) (string, string, string, bool) { - regex := regexp.MustCompile("([a-z]+)(\\((.*)\\))?(!)?: (.*)") + regex := regexp.MustCompile(`([a-z]+)(\((.*)\))?(!)?: (.*)`) result := regex.FindStringSubmatch(message) if len(result) != 6 { return "", "", message, false