MCPcopy Create free account
hub / github.com/chanxuehong/wechat / DecodeJSONHttpResponse

Function DecodeJSONHttpResponse

internal/debug/api/debug.go:33–47  ·  view source on GitHub ↗
(r io.Reader, v interface{})

Source from the content-addressed store, hash-verified

31}
32
33func DecodeJSONHttpResponse(r io.Reader, v interface{}) error {
34 body, err := ioutil.ReadAll(r)
35 if err != nil {
36 return err
37 }
38
39 body2 := body
40 buf := bytes.NewBuffer(make([]byte, 0, len(body2)+1024))
41 if err := json.Indent(buf, body2, "", " "); err == nil {
42 body2 = buf.Bytes()
43 }
44 log.Printf("[WECHAT_DEBUG] [API] http response body:\n%s\n", body2)
45
46 return json.Unmarshal(body, v)
47}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…