Skip to content

Commit

Permalink
Sort set keys by another method
Browse files Browse the repository at this point in the history
  • Loading branch information
louischan-oursky committed Aug 23, 2024
2 parents 2a08308 + 2c4a349 commit 771a9ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/lib/saml/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ func TestSAMLService(t *testing.T) {
Field: "NameIDPolicy/Format",
Actual: format,
Expected: []string{
"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
},
Reason: "unsupported NameIDPolicy Format",
})
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/setutil/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package setutil

import (
"cmp"
"sort"
"slices"
)

type Set[T cmp.Ordered] map[T]struct{}
Expand Down Expand Up @@ -48,7 +48,7 @@ func (s Set[T]) Keys() []T {
for k, _ := range s {
keys = append(keys, k)
}
sort.Slice(keys, cmp.Less)
slices.SortFunc(keys, cmp.Compare[T])
return keys
}

Expand Down

0 comments on commit 771a9ec

Please sign in to comment.