mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-11-28 08:38:51 +02:00
Use slices instead of sort pkg (#4992)
Co-authored-by: Robert Pająk <pellared@hotmail.com>
This commit is contained in:
parent
ec8e6ea61f
commit
a7034da631
@ -6,7 +6,7 @@ package baggage
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"sort"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -611,11 +611,11 @@ func TestBaggageString(t *testing.T) {
|
|||||||
for i, m := range members {
|
for i, m := range members {
|
||||||
parts := strings.Split(m, propertyDelimiter)
|
parts := strings.Split(m, propertyDelimiter)
|
||||||
if len(parts) > 1 {
|
if len(parts) > 1 {
|
||||||
sort.Strings(parts[1:])
|
slices.Sort(parts[1:])
|
||||||
members[i] = strings.Join(parts, propertyDelimiter)
|
members[i] = strings.Join(parts, propertyDelimiter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort.Strings(members)
|
slices.Sort(members)
|
||||||
return strings.Join(members, listDelimiter)
|
return strings.Join(members, listDelimiter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user