mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
labels: avoid lint warning on New()
This code is a bit cleaner. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
1695a7ee2f
commit
a19b369f9e
|
@ -357,9 +357,7 @@ func EmptyLabels() Labels {
|
||||||
// The caller has to guarantee that all label names are unique.
|
// The caller has to guarantee that all label names are unique.
|
||||||
func New(ls ...Label) Labels {
|
func New(ls ...Label) Labels {
|
||||||
set := make(Labels, 0, len(ls))
|
set := make(Labels, 0, len(ls))
|
||||||
for _, l := range ls {
|
set = append(set, ls...)
|
||||||
set = append(set, l)
|
|
||||||
}
|
|
||||||
sort.Sort(set)
|
sort.Sort(set)
|
||||||
|
|
||||||
return set
|
return set
|
||||||
|
|
Loading…
Reference in a new issue