Upgrade Azure Go SDK to v14.6.0

This commit is contained in:
Pengfei Ni
2018-04-24 14:31:34 +08:00
parent 3dbcd1ddce
commit b1b930a39b
134 changed files with 14672 additions and 21634 deletions

View File

@@ -78,13 +78,16 @@ func (m *Message) Put(options *PutMessageOptions) error {
if err != nil {
return err
}
defer readAndCloseBody(resp.body)
err = xmlUnmarshal(resp.body, m)
defer readAndCloseBody(resp.Body)
err = checkRespCode(resp, []int{http.StatusCreated})
if err != nil {
return err
}
return checkRespCode(resp.statusCode, []int{http.StatusCreated})
err = xmlUnmarshal(resp.Body, m)
if err != nil {
return err
}
return nil
}
// UpdateMessageOptions is the set of options can be specified for Update Messsage
@@ -125,10 +128,10 @@ func (m *Message) Update(options *UpdateMessageOptions) error {
if err != nil {
return err
}
defer readAndCloseBody(resp.body)
defer readAndCloseBody(resp.Body)
m.PopReceipt = resp.headers.Get("x-ms-popreceipt")
nextTimeStr := resp.headers.Get("x-ms-time-next-visible")
m.PopReceipt = resp.Header.Get("x-ms-popreceipt")
nextTimeStr := resp.Header.Get("x-ms-time-next-visible")
if nextTimeStr != "" {
nextTime, err := time.Parse(time.RFC1123, nextTimeStr)
if err != nil {
@@ -137,7 +140,7 @@ func (m *Message) Update(options *UpdateMessageOptions) error {
m.NextVisible = TimeRFC1123(nextTime)
}
return checkRespCode(resp.statusCode, []int{http.StatusNoContent})
return checkRespCode(resp, []int{http.StatusNoContent})
}
// Delete operation deletes the specified message.
@@ -157,8 +160,8 @@ func (m *Message) Delete(options *QueueServiceOptions) error {
if err != nil {
return err
}
readAndCloseBody(resp.body)
return checkRespCode(resp.statusCode, []int{http.StatusNoContent})
defer readAndCloseBody(resp.Body)
return checkRespCode(resp, []int{http.StatusNoContent})
}
type putMessageRequest struct {