Skip to content

Commit

Permalink
chore: fix goconst
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Mar 4, 2024
1 parent dc96ad2 commit f663ce4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pkg/result/processors/base_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"github.com/golangci/golangci-lint/pkg/result"
)

const caseInsensitivePrefix = "(?i)"

type BaseRule struct {
Text string
Source string
Expand Down
2 changes: 1 addition & 1 deletion pkg/result/processors/exclude.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ExcludeOptions struct {
func NewExclude(opts ExcludeOptions) *Exclude {
p := &Exclude{name: "exclude"}

prefix := "(?i)"
prefix := caseInsensitivePrefix
if opts.CaseSensitive {
p.name = "exclude-case-sensitive"
prefix = ""
Expand Down
2 changes: 1 addition & 1 deletion pkg/result/processors/exclude_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewExcludeRules(log logutils.Log, files *fsutils.Files, opts ExcludeRulesOp
log: log,
}

prefix := "(?i)"
prefix := caseInsensitivePrefix
if opts.CaseSensitive {
prefix = ""
p.name = "exclude-rules-case-sensitive"
Expand Down
2 changes: 1 addition & 1 deletion pkg/result/processors/severity.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewSeverity(log logutils.Log, files *fsutils.Files, opts SeverityOptions) *
override: opts.Override,
}

prefix := "(?i)"
prefix := caseInsensitivePrefix
if opts.CaseSensitive {
prefix = ""
p.name = "severity-rules-case-sensitive"
Expand Down

0 comments on commit f663ce4

Please sign in to comment.