1
0
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:
Tyler Yahn 2024-02-29 13:03:36 -08:00 committed by GitHub
parent ec8e6ea61f
commit a7034da631
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)
} }