imp error cli
parent
56344e64e5
commit
943bd7e769
|
@ -92,7 +92,11 @@ func invoke(m string, path string, bodyo interface{}) (*json.Decoder, error) {
|
||||||
for k, m := range api.Methods {
|
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("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{}
|
ret := %s{}
|
||||||
err = dec.Decode(%sret)
|
err = dec.Decode(%sret)
|
||||||
if err != nil{
|
if err != nil{
|
||||||
|
|
Loading…
Reference in New Issue