-
Notifications
You must be signed in to change notification settings - Fork 15
/
sort.go
50 lines (37 loc) · 850 Bytes
/
sort.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package proto
import (
"github.com/duke-git/lancet/v2/slice"
"github.com/suyuan32/goctls/rpc/parser"
)
func SortImport(data map[string]parser.Import) (result []string) {
result = []string{}
for k, _ := range data {
result = append(result, k)
}
slice.Sort(result)
return result
}
func SortEnum(data map[string]parser.Enum) (result []string) {
result = []string{}
for k, _ := range data {
result = append(result, k)
}
slice.Sort(result)
return result
}
func SortMessage(data map[string]parser.Message) (result []string) {
result = []string{}
for k, _ := range data {
result = append(result, k)
}
slice.Sort(result)
return result
}
func SortService(data map[string]parser.Service) (result []string) {
result = []string{}
for k, _ := range data {
result = append(result, k)
}
slice.Sort(result)
return result
}