Skip to content

Commit

Permalink
Update CI to latest Go and Ubuntu images (#717)
Browse files Browse the repository at this point in the history
* Update CI to latest Go and Ubuntu images

* fix cov install

* gofmt
  • Loading branch information
jhendrixMSFT authored Jan 17, 2023
1 parent 2fa44cb commit 93a6fda
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 33 deletions.
2 changes: 1 addition & 1 deletion autorest/adal/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (t Token) WillExpireIn(d time.Duration) bool {
return !t.Expires().After(time.Now().Add(d))
}

//OAuthToken return the current access token
// OAuthToken return the current access token
func (t *Token) OAuthToken() string {
return t.AccessToken
}
Expand Down
32 changes: 16 additions & 16 deletions autorest/autorest.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ generated Go code.
The package breaks sending and responding to HTTP requests into three phases: Preparing, Sending,
and Responding. A typical pattern is:
req, err := Prepare(&http.Request{},
token.WithAuthorization())
req, err := Prepare(&http.Request{},
token.WithAuthorization())
resp, err := Send(req,
WithLogging(logger),
DoErrorIfStatusCode(http.StatusInternalServerError),
DoCloseIfError(),
DoRetryForAttempts(5, time.Second))
resp, err := Send(req,
WithLogging(logger),
DoErrorIfStatusCode(http.StatusInternalServerError),
DoCloseIfError(),
DoRetryForAttempts(5, time.Second))
err = Respond(resp,
ByDiscardingBody(),
ByClosing())
err = Respond(resp,
ByDiscardingBody(),
ByClosing())
Each phase relies on decorators to modify and / or manage processing. Decorators may first modify
and then pass the data along, pass the data first and then modify the result, or wrap themselves
around passing the data (such as a logger might do). Decorators run in the order provided. For
example, the following:
req, err := Prepare(&http.Request{},
WithBaseURL("https://microsoft.com/"),
WithPath("a"),
WithPath("b"),
WithPath("c"))
req, err := Prepare(&http.Request{},
WithBaseURL("https://microsoft.com/"),
WithPath("a"),
WithPath("b"),
WithPath("c"))
will set the URL to:
https://microsoft.com/a/b/c
https://microsoft.com/a/b/c
Preparers and Responders may be shared and re-used (assuming the underlying decorators support
sharing and re-use). Performant use is obtained by creating one or more Preparers and Responders
Expand Down
2 changes: 1 addition & 1 deletion autorest/azure/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func NewDeviceFlowConfig(clientID string, tenantID string) DeviceFlowConfig {
}
}

//AuthorizerConfig provides an authorizer from the configuration provided.
// AuthorizerConfig provides an authorizer from the configuration provided.
type AuthorizerConfig interface {
Authorizer() (autorest.Authorizer, error)
}
Expand Down
2 changes: 1 addition & 1 deletion autorest/azure/cli/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Token struct {

const accessTokensJSON = "accessTokens.json"

// ToADALToken converts an Azure CLI `Token`` to an `adal.Token``
// ToADALToken converts an Azure CLI `Token to an `adal.Token
func (t Token) ToADALToken() (converted adal.Token, err error) {
tokenExpirationDate, err := ParseExpirationDate(t.ExpiresOn)
if err != nil {
Expand Down
25 changes: 11 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ jobs:

strategy:
matrix:
Linux_Go115:
vm.image: 'ubuntu-18.04'
go.version: '1.15'
Linux_Go116:
vm.image: 'ubuntu-18.04'
go.version: '1.16'
Linux_Go117:
vm.image: 'ubuntu-18.04'
go.version: '1.17'
Linux_Go118:
vm.image: 'ubuntu-22.04'
go.version: '1.18.10'
Linux_Go119:
vm.image: 'ubuntu-22.04'
go.version: '1.19.5'
current_go: 'true'

pool:
Expand All @@ -41,11 +38,11 @@ jobs:
- script: |
set -e
export GO111MODULE=on
go get golang.org/x/lint/golint@latest
go get github.com/jstemmer/go-junit-report@latest
go get github.com/axw/gocov/gocov@latest
go get github.com/AlekSi/gocov-xml@latest
go get github.com/matm/gocov-html@latest
go install golang.org/x/lint/golint@latest
go install github.com/jstemmer/go-junit-report@latest
go install github.com/axw/gocov/gocov@latest
go install github.com/AlekSi/gocov-xml@latest
go install github.com/matm/gocov-html/cmd/gocov-html@latest
workingDirectory: '$(sdkPath)'
displayName: 'Install Dependencies'
Expand Down

0 comments on commit 93a6fda

Please sign in to comment.