package utils import ( "encoding/json" "io" ) func ParseJson(body io.ReadCloser, result interface{}) { decoder := json.NewDecoder(body) err := decoder.Decode(result) if err != nil { panic(err) } }