mirror of
https://github.com/openfaas/faas.git
synced 2025-06-23 07:13:23 +00:00
Migrate to Go modules
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
2e2250afe8
commit
7ce266adc0
11
gateway/vendor/github.com/prometheus/common/expfmt/text_parse.go
generated
vendored
11
gateway/vendor/github.com/prometheus/common/expfmt/text_parse.go
generated
vendored
@ -299,6 +299,17 @@ func (p *TextParser) startLabelName() stateFn {
|
||||
p.parseError(fmt.Sprintf("expected '=' after label name, found %q", p.currentByte))
|
||||
return nil
|
||||
}
|
||||
// Check for duplicate label names.
|
||||
labels := make(map[string]struct{})
|
||||
for _, l := range p.currentMetric.Label {
|
||||
lName := l.GetName()
|
||||
if _, exists := labels[lName]; !exists {
|
||||
labels[lName] = struct{}{}
|
||||
} else {
|
||||
p.parseError(fmt.Sprintf("duplicate label names for metric %q", p.currentMF.GetName()))
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return p.startLabelValue
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user