Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: switch to re.MatchString(string) instead re.Match([]byte(string)) #574

Merged
merged 1 commit into from Sep 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions rule/file-header.go
Expand Up @@ -42,9 +42,9 @@ func (r *FileHeaderRule) Apply(file *lint.File, arguments lint.Arguments) []lint
comment := ""
for _, c := range g.List {
text := c.Text
if multiRegexp.Match([]byte(text)) {
if multiRegexp.MatchString(text) {
text = text[2 : len(text)-2]
} else if singleRegexp.Match([]byte(text)) {
} else if singleRegexp.MatchString(text) {
text = text[2:]
}
comment += text
Expand All @@ -55,7 +55,7 @@ func (r *FileHeaderRule) Apply(file *lint.File, arguments lint.Arguments) []lint
panic(err.Error())
}

if !regex.Match([]byte(comment)) {
if !regex.MatchString(comment) {
return failure
}
return nil
Expand Down