Skip to content

Commit

Permalink
ling: gocritic (badRegexp, regexpSimplify)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Sep 16, 2024
1 parent 3d455e3 commit 92efb8a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,12 @@ linters-settings:
- equalFold #
- unnecessaryBlock #
- ptrToRefParam #
- badRegexp #
- preferStringWriter #
- stringXbytes #
- appendAssign #
- tooManyResultsChecker
- unnecessaryDefer
- docStub
- regexpSimplify
- preferFprint

linters:
Expand Down
2 changes: 1 addition & 1 deletion pkg/fflag/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type FeatureRegister struct {
features map[string]*Feature
}

var featureNameRexp = regexp.MustCompile(`^[a-z0-9_\.]+$`)
var featureNameRexp = regexp.MustCompile(`^[a-z0-9_.]+$`)

func validateFeatureName(featureName string) error {
if featureName == "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/hubtest/regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

var (
variableRE = regexp.MustCompile(`(?P<variable>[^ =]+) == .*`)
variableRE = regexp.MustCompile(`(?P<variable>[^ =]+) == .*`)
parserResultRE = regexp.MustCompile(`^results\["[^"]+"\]\["(?P<parser>[^"]+)"\]\[[0-9]+\]\.Evt\..*`)
scenarioResultRE = regexp.MustCompile(`^results\[[0-9]+\].Overflow.Alert.GetScenario\(\) == "(?P<scenario>[^"]+)"`)
)

0 comments on commit 92efb8a

Please sign in to comment.