1
0
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:
dudaodong
2024-08-28 10:58:14 +08:00
parent a6d39a3bba
commit ca40b5d6c6
5 changed files with 25 additions and 19 deletions

View File

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