mirror of
https://github.com/kongyuebin1/dongfeng-pay.git
synced 2025-12-13 12:39:58 +08:00
由gopath形式改为module
This commit is contained in:
26
shop/utils/sort_go.go
Normal file
26
shop/utils/sort_go.go
Normal file
@@ -0,0 +1,26 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/10/26 11:17
|
||||
** @Author : yuebin
|
||||
** @File : sort_go
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/10/26 11:17
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package utils
|
||||
|
||||
import (
|
||||
"sort"
|
||||
)
|
||||
|
||||
/*
|
||||
* 对map的key值进行排序
|
||||
*/
|
||||
func SortMap(m map[string]string) []string {
|
||||
var arr []string
|
||||
for k := range m {
|
||||
arr = append(arr, k)
|
||||
}
|
||||
sort.Strings(arr)
|
||||
return arr
|
||||
}
|
||||
Reference in New Issue
Block a user