Update Azure Go SDK to v19.0.0

This commit is contained in:
Pengfei Ni
2018-07-24 17:00:27 +08:00
parent 5bf3b2119b
commit af1875fca6
103 changed files with 9156 additions and 8645 deletions

View File

@@ -78,7 +78,7 @@ func (m *Message) Put(options *PutMessageOptions) error {
if err != nil {
return err
}
defer readAndCloseBody(resp.Body)
defer drainRespBody(resp)
err = checkRespCode(resp, []int{http.StatusCreated})
if err != nil {
return err
@@ -114,7 +114,8 @@ func (m *Message) Update(options *UpdateMessageOptions) error {
return err
}
headers["Content-Length"] = strconv.Itoa(nn)
// visibilitytimeout is required for Update (zero or greater) so set the default here
query.Set("visibilitytimeout", "0")
if options != nil {
if options.VisibilityTimeout != 0 {
query.Set("visibilitytimeout", strconv.Itoa(options.VisibilityTimeout))
@@ -128,7 +129,7 @@ func (m *Message) Update(options *UpdateMessageOptions) error {
if err != nil {
return err
}
defer readAndCloseBody(resp.Body)
defer drainRespBody(resp)
m.PopReceipt = resp.Header.Get("x-ms-popreceipt")
nextTimeStr := resp.Header.Get("x-ms-time-next-visible")
@@ -160,7 +161,7 @@ func (m *Message) Delete(options *QueueServiceOptions) error {
if err != nil {
return err
}
defer readAndCloseBody(resp.Body)
defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusNoContent})
}