Avoid package cmp to allow builds with golang v1.20

This commit is contained in:
Holger Obermaier 2023-09-19 17:00:16 +02:00
parent 8da5c692bb
commit 75b705aa87

View File

@ -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 {