Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
electron0zero committed Oct 11, 2024
1 parent 5e799b2 commit 890f5b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/frontend/tag_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ import (
"google.golang.org/grpc/codes"
)

// regex patterns for tag values endpoints, precompile for performance
var (
tagNameRegexV1 = regexp.MustCompile(`.*/api/search/tag/([^/]+)/values`)
tagNameRegexV2 = regexp.MustCompile(`.*/api/v2/search/tag/([^/]+)/values`)
)

//nolint:all //deprecated

// streaming grpc handlers
Expand Down Expand Up @@ -442,10 +448,6 @@ func parseParams(req *http.Request) (string, string, uint32) {
return scope, q, uint32(duration)
}

// regex patterns for tag values endpoints, precompile for performance
var tagNameRegexV1 = regexp.MustCompile(`.*/api/search/tag/([^/]+)/values`)
var tagNameRegexV2 = regexp.MustCompile(`.*/api/v2/search/tag/([^/]+)/values`)

// extractTagName extracts the tagName based on the provided regex pattern
func extractTagName(path string, pattern *regexp.Regexp) string {
matches := pattern.FindStringSubmatch(path)
Expand Down

0 comments on commit 890f5b8

Please sign in to comment.