liuxiaolong
2021-01-20 2b337fa6e928c209aafe616dcdde351595c63c1e
sbusClient.go
@@ -36,6 +36,12 @@
   Body                 []byte                 `json:"body"`
}
type reply struct {
   Success          bool                   `json:"success"`
   Msg             string                   `json:"msg"`
   Data             interface{}             `json:"data"`
}
func (sc SBusClient) DoGetRequest(url string, params map[string]string, headers map[string]string) ([]byte, error) {
   if sc.nodes == nil || len(sc.nodes) == 0 {
      return nil, errors.New("invalid netNodes")
@@ -165,13 +171,7 @@
      return nil, fmt.Errorf("doReq s.SendandrecvTimeout result n:%d", n)
   } else {
      if len(ret) > 0 {
         var retMsg MsgInfo
         err = json.Unmarshal(ret[0].Data, &retMsg)
         if err != nil {
            logPrint("doReq unmarshal to MsgInfo err:", err)
            return nil, err
         }
         return retMsg.Body, nil
         return ret[0].Data, nil
      }
      return nil, fmt.Errorf("no any response")
   }