增加map数组转换为url query方法
This commit is contained in:
parent
e95f609c0f
commit
1c9c8be53c
13
string.go
13
string.go
@ -133,3 +133,16 @@ func (s *stringOperate) RemoveDuplicates(sourceList []string) []string {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// Map2Query map参数转换为url query
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:51 2022/10/10
|
||||
func (s *stringOperate) Map2Query(data map[string]string) string {
|
||||
list := make([]string, 0)
|
||||
for k, v := range data {
|
||||
list = append(list, k+"="+v)
|
||||
}
|
||||
return strings.Join(list, "&")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user