Skip to content

Commit f4d7f87

Browse files
committed
merge cleanups
1 parent dfcd4af commit f4d7f87

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

expfmt/decode_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ func TestProtoDecoder(t *testing.T) {
373373
model.NameValidationScheme = model.LegacyValidation
374374
var smpls model.Vector
375375
err := dec.Decode(&smpls)
376-
if err == io.EOF {
376+
if err != nil && errors.Is(err, io.EOF) {
377377
break
378378
}
379379
if scenario.legacyNameFail {

model/metric.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,14 @@ var (
7575
// goroutines are started.
7676
NameValidationScheme = LegacyValidation
7777

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+
7882
// MetricNameRE is a regular expression matching valid metric
7983
// names. Note that the IsValidMetricName function performs the same
8084
// check but faster than a match with this regular expression.
8185
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
9086
)
9187

9288
// A Metric is similar to a LabelSet, but the key difference is that a Metric is

model/silence.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,8 @@ func (s *Silence) Validate() error {
8080
return fmt.Errorf("at least one matcher required")
8181
}
8282
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 6440f53 (Try the library-wide setting)
87-
if err := m.Validate(false); err != nil {
88-
return fmt.Errorf("invalid matcher: %s", err)
89-
=======
9083
if err := m.Validate(); err != nil {
91-
return fmt.Errorf("invalid matcher: %s", err)
92-
>>>>>>> 6440f53 (Try the library-wide setting)
84+
return fmt.Errorf("invalid matcher: %w", err)
9385
}
9486
}
9587
if s.StartsAt.IsZero() {

0 commit comments

Comments
 (0)