File tree Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ func TestProtoDecoder(t *testing.T) {
373
373
model .NameValidationScheme = model .LegacyValidation
374
374
var smpls model.Vector
375
375
err := dec .Decode (& smpls )
376
- if err == io .EOF {
376
+ if err != nil && errors . Is ( err , io .EOF ) {
377
377
break
378
378
}
379
379
if scenario .legacyNameFail {
Original file line number Diff line number Diff line change @@ -75,18 +75,14 @@ var (
75
75
// goroutines are started.
76
76
NameValidationScheme = LegacyValidation
77
77
78
+ // NameEscapingScheme defines the way that names will be
79
+ // escaped when presented to systems that do not support UTF-8 names.
80
+ NameEscapingScheme = ValueEncodingEscaping
81
+
78
82
// MetricNameRE is a regular expression matching valid metric
79
83
// names. Note that the IsValidMetricName function performs the same
80
84
// check but faster than a match with this regular expression.
81
85
MetricNameRE = regexp .MustCompile (`^[a-zA-Z_:][a-zA-Z0-9_:]*$` )
82
- // NameValidationScheme determines the default method of name validation to be
83
- // used. To avoid need for locking, this value should be set once, probably in
84
- // an init(), before multiple goroutines are started.
85
- NameValidationScheme = LegacyValidation
86
-
87
- // NameEscapingScheme defines the way that names will be
88
- // escaped when presented to systems that do not support UTF-8 names.
89
- NameEscapingScheme = ValueEncodingEscaping
90
86
)
91
87
92
88
// A Metric is similar to a LabelSet, but the key difference is that a Metric is
Original file line number Diff line number Diff line change @@ -80,16 +80,8 @@ func (s *Silence) Validate() error {
80
80
return fmt .Errorf ("at least one matcher required" )
81
81
}
82
82
for _ , m := range s .Matchers {
83
- << << << < HEAD
84
- if err := m .Validate (false ); err != nil {
85
- return fmt .Errorf ("invalid matcher: %w" , err )
86
- || || || | parent of 6440 f53 (Try the library - wide setting )
87
- if err := m .Validate (false ); err != nil {
88
- return fmt .Errorf ("invalid matcher: %s" , err )
89
- == == == =
90
83
if err := m .Validate (); err != nil {
91
- return fmt .Errorf ("invalid matcher: %s" , err )
92
- >> >> >> > 6440 f53 (Try the library - wide setting )
84
+ return fmt .Errorf ("invalid matcher: %w" , err )
93
85
}
94
86
}
95
87
if s .StartsAt .IsZero () {
You can’t perform that action at this time.
0 commit comments