From 890f5b88982c722dc216f1ed88f2ab2c9cdc3df4 Mon Sep 17 00:00:00 2001 From: Suraj Nath <9503187+electron0zero@users.noreply.github.com> Date: Sat, 12 Oct 2024 03:04:38 +0530 Subject: [PATCH] fix lint --- modules/frontend/tag_handlers.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/frontend/tag_handlers.go b/modules/frontend/tag_handlers.go index 3c916264142..b61bc4beb8f 100644 --- a/modules/frontend/tag_handlers.go +++ b/modules/frontend/tag_handlers.go @@ -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 @@ -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)