diff --git a/src/processGoClientOutput.go b/src/processGoClientOutput.go index 0c8bbb9..3a19f23 100644 --- a/src/processGoClientOutput.go +++ b/src/processGoClientOutput.go @@ -92,7 +92,11 @@ func invoke(m string, path string, bodyo interface{}) (*json.Decoder, error) { for k, m := range api.Methods { b.WriteString(fmt.Sprintf("func %s(req %s) (res %s, err error){\n", k, APIParamTypeDecToString(m.ReqType), APIParamTypeDecToString(m.ResType))) - b.WriteString(fmt.Sprintf(` dec, err := invoke("%s", "%s", req) + b.WriteString(fmt.Sprintf(`var dec *json.Decoder + dec, err = invoke("%s", "%s", req) + if err!=nil{ + return + } ret := %s{} err = dec.Decode(%sret) if err != nil{