File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ linters:
7272 desc : " Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
7373 - pkg : " io/ioutil"
7474 desc : " Use corresponding 'os' or 'io' functions instead."
75- # - pkg: "regexp"
76- # desc: "Use github.com/grafana/regexp instead of regexp"
75+ - pkg : " regexp"
76+ desc : " Use github.com/grafana/regexp instead of regexp"
7777 - pkg : " github.com/pkg/errors"
7878 desc : " Use 'errors' or 'fmt' instead of github.com/pkg/errors"
7979 - pkg : " gzip"
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ import (
3232func Fuzz (in []byte ) int {
3333 parser := NewTextParser (model .UTF8Validation )
3434 _ , err := parser .TextToMetricFamilies (bytes .NewReader (in ))
35-
3635 if err != nil {
3736 return 0
3837 }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ toolchain go1.24.1
77require (
88 github.com/alecthomas/kingpin/v2 v2.4.0
99 github.com/google/go-cmp v0.7.0
10+ github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc
1011 github.com/julienschmidt/httprouter v1.3.0
1112 github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
1213 github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
1111github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
1212github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8 =
1313github.com/google/go-cmp v0.7.0 /go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU =
14+ github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc h1:GN2Lv3MGO7AS6PrRoT6yV5+wkrOpcszoIsO4+4ds248 =
15+ github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc /go.mod h1:+JKpmjMGhpgPL+rXZ5nsZieVzvarn86asRlBg4uNGnk =
1416github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA =
1517github.com/jpillora/backoff v1.0.0 /go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4 =
1618github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U =
Original file line number Diff line number Diff line change @@ -16,9 +16,10 @@ package model
1616import (
1717 "encoding/json"
1818 "fmt"
19- "regexp"
2019 "strings"
2120 "unicode/utf8"
21+
22+ "github.com/grafana/regexp"
2223)
2324
2425const (
Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ import (
1717 "encoding/json"
1818 "errors"
1919 "fmt"
20- "regexp"
2120 "sort"
2221 "strconv"
2322 "strings"
2423 "unicode/utf8"
2524
25+ "github.com/grafana/regexp"
2626 dto "github.com/prometheus/client_model/go"
2727 "google.golang.org/protobuf/proto"
2828 "gopkg.in/yaml.v2"
Original file line number Diff line number Diff line change @@ -17,8 +17,9 @@ import (
1717 "encoding/json"
1818 "errors"
1919 "fmt"
20- "regexp"
2120 "time"
21+
22+ "github.com/grafana/regexp"
2223)
2324
2425// Matcher describes a matches the value of a given label.
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ package model
1616import (
1717 "encoding/json"
1818 "reflect"
19- "regexp"
2019 "testing"
2120
21+ "github.com/grafana/regexp"
2222 "github.com/stretchr/testify/require"
2323)
2424
Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ import (
1818 "context"
1919 "fmt"
2020 "log/slog"
21- "regexp"
2221 "strings"
2322 "testing"
2423 "time"
2524
25+ "github.com/grafana/regexp"
2626 "github.com/stretchr/testify/require"
2727 "gopkg.in/yaml.v2"
2828)
You can’t perform that action at this time.
0 commit comments