mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
refactoring: rename SortByKeys to SortByKey
This commit is contained in:
1 parent
a6d39a3bba
commit
ca40b5d6c6
5 files changed
+25
-19
No files matched your search
@@ -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