From 311f14c7ebac531c3c8aac7a0e56fe9874e45bfc Mon Sep 17 00:00:00 2001 From: leyshon Date: Thu, 29 Aug 2019 15:37:25 +0100 Subject: [PATCH] Fixing linting errors: Making sure err is checked in azure_test and gofmt has been run --- providers/azure.go | 8 ++++---- providers/azure_test.go | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/providers/azure.go b/providers/azure.go index 6729e4f..48cea84 100644 --- a/providers/azure.go +++ b/providers/azure.go @@ -1,13 +1,13 @@ package providers import ( + "bytes" + "encoding/json" "errors" "fmt" + "io/ioutil" "net/http" "net/url" - "encoding/json" - "io/ioutil" - "bytes" "time" "github.com/bitly/go-simplejson" @@ -119,7 +119,7 @@ func (p *AzureProvider) Redeem(redirectURL, code string) (s *sessions.SessionSta if err != nil { return } - + s = &sessions.SessionState{ AccessToken: jsonResponse.AccessToken, IDToken: jsonResponse.IDToken, diff --git a/providers/azure_test.go b/providers/azure_test.go index 3f2b00d..24745f3 100644 --- a/providers/azure_test.go +++ b/providers/azure_test.go @@ -207,8 +207,9 @@ func TestAzureProviderGetEmailAddressIncorrectOtherMails(t *testing.T) { func TestAzureProviderRedeemReturnsIdToken(t *testing.T) { b := testAzureBackend(`{ "id_token": "testtoken1234", "expires_on": "1136239445", "refresh_token": "refresh1234" }`) - timestamp, err := time.Parse(time.RFC3339, "2006-01-02T22:04:05Z") defer b.Close() + timestamp, err := time.Parse(time.RFC3339, "2006-01-02T22:04:05Z") + assert.Equal(t, nil, err) bURL, _ := url.Parse(b.URL) p := testAzureProvider(bURL.Host)