package tool import ( "encoding/json" "io" ) type JsonParse struct { } func Decode(io io.ReadCloser, v interface{}) error { return json.NewDecoder(io).Decode(v) }
Go gin json parse 的封装
6 min read
package tool import ( "encoding/json" "io" ) type JsonParse struct { } func Decode(io io.ReadCloser, v interface{}) error { return json.NewDecoder(io).Decode(v) }