MCPcopy Index your code
hub / github.com/FloatTech/AnimeAPI / structToStr

Function structToStr

qzone/util.go:20–36  ·  view source on GitHub ↗
(in interface{})

Source from the content-addressed store, hash-verified

18}
19
20func structToStr(in interface{}) (payload string) {
21 keys := make([]string, 0, 16)
22 v := reflect.ValueOf(in)
23 if v.Kind() == reflect.Ptr {
24 v = v.Elem()
25 }
26 t := v.Type()
27 for i := 0; i < t.NumField(); i++ {
28 field := t.Field(i)
29 get := field.Tag.Get("json")
30 if get != "" {
31 keys = append(keys, get+"="+url.QueryEscape(v.Field(i).Interface().(string)))
32 }
33 }
34 payload = strings.Join(keys, "&")
35 return
36}

Callers 4

EmotionPublishRawMethod · 0.85
UploadImageMethod · 0.85
EmotionMsglistRawMethod · 0.85
LikeRawMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…