mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-27 07:39:05 +01:00
Avoid package cmp to allow builds with golang v1.20
This commit is contained in:
parent
8da5c692bb
commit
75b705aa87
@ -2,7 +2,6 @@ package sinks
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"cmp"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -102,7 +101,13 @@ func (s *HttpSink) Write(m lp.CCMetric) error {
|
|||||||
slices.SortFunc(
|
slices.SortFunc(
|
||||||
key_value_store,
|
key_value_store,
|
||||||
func(a key_value, b key_value) int {
|
func(a key_value, b key_value) int {
|
||||||
return cmp.Compare(a.key, b.key)
|
if a.key < b.key {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
if a.key > b.key {
|
||||||
|
return +1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
for i := range key_value_store {
|
for i := range key_value_store {
|
||||||
|
Loading…
Reference in New Issue
Block a user