Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Commit

Permalink
Fix azure.NewFutureFromResponse to always return tracker (#334)
Browse files Browse the repository at this point in the history
* Fix azure.NewFutureFromResponse to always return tracker

When creating a future always include the polling tracker even if
there's a failure; this allows the underlying response to be obtained
by the caller.

* Fix linter
  • Loading branch information
jhendrixMSFT authored Oct 15, 2018
1 parent ea233b6 commit 4b7f49d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ before_install:
- curl -L -o $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v$DEP_VERSION/dep-linux-amd64 && chmod +x $GOPATH/bin/dep

install:
- go get -u github.com/golang/lint/golint
- go get -u golang.org/x/lint/golint
- go get -u github.com/stretchr/testify
- go get -u github.com/GoASTScanner/gas
- dep ensure
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## v11.1.1

### Bug Fixes

- When creating a future always include the polling tracker even if there's a failure; this allows the underlying response to be obtained by the caller.

## v11.1.0

### New Features
Expand Down
5 changes: 1 addition & 4 deletions autorest/azure/async.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ func NewFuture(req *http.Request) Future {
// with the initial response from an asynchronous operation.
func NewFutureFromResponse(resp *http.Response) (Future, error) {
pt, err := createPollingTracker(resp)
if err != nil {
return Future{}, err
}
return Future{pt: pt}, nil
return Future{pt: pt}, err
}

// Response returns the last HTTP response.
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
)

// Number contains the semantic version of this SDK.
const Number = "v11.1.0"
const Number = "v11.1.1"

var (
userAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s",
Expand Down

0 comments on commit 4b7f49d

Please sign in to comment.