mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-08 06:32:28 +08:00
refactoring: rename SortByKeys to SortByKey
This commit is contained in:
@@ -541,7 +541,7 @@ func ExampleGetOrSet() {
|
||||
// b
|
||||
}
|
||||
|
||||
func ExampleSortByKeys() {
|
||||
func ExampleSortByKey() {
|
||||
m := map[int]string{
|
||||
3: "c",
|
||||
1: "a",
|
||||
@@ -549,7 +549,9 @@ func ExampleSortByKeys() {
|
||||
2: "b",
|
||||
}
|
||||
|
||||
result := SortByKeys(m)
|
||||
result := SortByKey(m, func(a, b int) bool {
|
||||
return a < b
|
||||
})
|
||||
|
||||
fmt.Println(result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user