MCPcopy
hub / github.com/silenceper/wechat / OrderParam

Function OrderParam

util/param.go:9–33  ·  view source on GitHub ↗

OrderParam order params

(p map[string]string, bizKey string)

Source from the content-addressed store, hash-verified

7
8// OrderParam order params
9func OrderParam(p map[string]string, bizKey string) (returnStr string) {
10 keys := make([]string, 0, len(p))
11 for k := range p {
12 if k == "sign" {
13 continue
14 }
15 keys = append(keys, k)
16 }
17 sort.Strings(keys)
18 var buf bytes.Buffer
19 for _, k := range keys {
20 if p[k] == "" {
21 continue
22 }
23 if buf.Len() > 0 {
24 buf.WriteByte('&')
25 }
26 buf.WriteString(k)
27 buf.WriteByte('=')
28 buf.WriteString(p[k])
29 }
30 buf.WriteString(bizKey)
31 returnStr = buf.String()
32 return
33}

Callers 1

ParamSignFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…