diff options
Diffstat (limited to 'src/cmp/cmp_test.go')
| -rw-r--r-- | src/cmp/cmp_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmp/cmp_test.go b/src/cmp/cmp_test.go index e265464f4f..43d9ef365e 100644 --- a/src/cmp/cmp_test.go +++ b/src/cmp/cmp_test.go @@ -10,6 +10,7 @@ import ( "math" "slices" "sort" + "strings" "testing" "unsafe" ) @@ -158,8 +159,8 @@ func ExampleOr_sort() { // Sort by customer first, product second, and last by higher price slices.SortFunc(orders, func(a, b Order) int { return cmp.Or( - cmp.Compare(a.Customer, b.Customer), - cmp.Compare(a.Product, b.Product), + strings.Compare(a.Customer, b.Customer), + strings.Compare(a.Product, b.Product), cmp.Compare(b.Price, a.Price), ) }) |
