From ed4f7378f4655f3c2200f93627e7edcf223b1445 Mon Sep 17 00:00:00 2001 From: Tobias Fuhrimann Date: Tue, 9 Jan 2018 23:00:53 +0100 Subject: [PATCH] Use gofmt -s on all files --- gothic/gothic.go | 2 +- provider_test.go | 2 +- providers/amazon/amazon.go | 10 +++---- providers/bitbucket/bitbucket.go | 12 ++++---- providers/box/box.go | 10 +++---- providers/cloudfoundry/cf.go | 16 +++++----- providers/dailymotion/dailymotion.go | 10 +++---- providers/deezer/deezer.go | 10 +++---- providers/digitalocean/digitalocean.go | 10 +++---- providers/discord/discord.go | 10 +++---- providers/dropbox/dropbox.go | 12 ++++---- providers/facebook/facebook.go | 16 +++++----- providers/fitbit/fitbit.go | 10 +++---- providers/gitlab/gitlab.go | 2 +- providers/gplus/gplus.go | 10 +++---- providers/heroku/heroku.go | 2 +- providers/instagram/instagram.go | 12 ++++---- providers/intercom/intercom.go | 8 ++--- providers/lastfm/lastfm.go | 8 ++--- providers/linkedin/linkedin.go | 12 ++++---- providers/meetup/meetup.go | 22 +++++++------- providers/meetup/meetup_test.go | 2 +- providers/meetup/session_test.go | 2 +- providers/onedrive/onedrive.go | 2 +- providers/openidConnect/openidConnect.go | 30 +++++++++---------- providers/openidConnect/openidConnect_test.go | 8 ++--- providers/openidConnect/session.go | 4 +-- providers/openidConnect/session_test.go | 5 ++-- providers/paypal/paypal.go | 2 +- providers/salesforce/salesforce.go | 10 +++---- providers/slack/slack.go | 12 ++++---- providers/soundcloud/soundcloud.go | 10 +++---- providers/spotify/spotify.go | 12 ++++---- providers/steam/session.go | 2 +- providers/steam/steam.go | 6 ++-- providers/stripe/stripe.go | 12 ++++---- providers/twitch/twitch.go | 10 +++---- providers/uber/uber.go | 10 +++---- providers/wepay/wepay.go | 10 +++---- providers/yahoo/yahoo.go | 4 +-- providers/yammer/yammer.go | 18 +++++------ 41 files changed, 188 insertions(+), 189 deletions(-) diff --git a/gothic/gothic.go b/gothic/gothic.go index 459690ca4..fe9118301 100644 --- a/gothic/gothic.go +++ b/gothic/gothic.go @@ -45,7 +45,7 @@ func init() { } /* -BeginAuthHandler is a convienence handler for starting the authentication process. +BeginAuthHandler is a convenience handler for starting the authentication process. It expects to be able to get the name of the provider from the query parameters as either "provider" or ":provider". diff --git a/provider_test.go b/provider_test.go index b7acceca2..8890577dc 100644 --- a/provider_test.go +++ b/provider_test.go @@ -28,7 +28,7 @@ func Test_GetProvider(t *testing.T) { a.NoError(err) a.Equal(p, provider) - p, err = goth.GetProvider("unknown") + _, err = goth.GetProvider("unknown") a.Error(err) a.Equal(err.Error(), "no provider for unknown exists") goth.ClearProviders() diff --git a/providers/amazon/amazon.go b/providers/amazon/amazon.go index 32ed5da83..08bcf3dc8 100644 --- a/providers/amazon/amazon.go +++ b/providers/amazon/amazon.go @@ -10,9 +10,9 @@ import ( "net/http" "net/url" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -36,10 +36,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "amazon", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "amazon", } p.config = newConfig(p, scopes) return p diff --git a/providers/bitbucket/bitbucket.go b/providers/bitbucket/bitbucket.go index 06d9c923c..c19734770 100644 --- a/providers/bitbucket/bitbucket.go +++ b/providers/bitbucket/bitbucket.go @@ -9,9 +9,9 @@ import ( "net/http" "net/url" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -26,10 +26,10 @@ const ( // one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "bitbucket", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "bitbucket", } p.config = newConfig(p, scopes) return p @@ -125,7 +125,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { func userFromReader(reader io.Reader, user *goth.User) error { u := struct { - ID string `json:"uuid"` + ID string `json:"uuid"` Links struct { Avatar struct { URL string `json:"href"` diff --git a/providers/box/box.go b/providers/box/box.go index fa18c1002..ce1d296a9 100644 --- a/providers/box/box.go +++ b/providers/box/box.go @@ -7,9 +7,9 @@ import ( "io" "net/http" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -33,10 +33,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "box", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "box", } p.config = newConfig(p, scopes) return p diff --git a/providers/cloudfoundry/cf.go b/providers/cloudfoundry/cf.go index b162637d3..5df0b32c6 100644 --- a/providers/cloudfoundry/cf.go +++ b/providers/cloudfoundry/cf.go @@ -10,10 +10,10 @@ import ( "net/http" "strings" + "fmt" "github.com/markbates/goth" "golang.org/x/net/context" "golang.org/x/oauth2" - "fmt" ) // Provider is the implementation of `goth.Provider` for accessing Cloud Foundry. @@ -35,13 +35,13 @@ type Provider struct { func New(uaaURL, clientKey, secret, callbackURL string, scopes ...string) *Provider { uaaURL = strings.TrimSuffix(uaaURL, "/") p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - AuthURL: uaaURL + "/oauth/authorize", - TokenURL: uaaURL + "/oauth/token", - UserInfoURL: uaaURL + "/userinfo", - providerName: "cloudfoundry", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + AuthURL: uaaURL + "/oauth/authorize", + TokenURL: uaaURL + "/oauth/token", + UserInfoURL: uaaURL + "/userinfo", + providerName: "cloudfoundry", } p.config = newConfig(p, scopes) return p diff --git a/providers/dailymotion/dailymotion.go b/providers/dailymotion/dailymotion.go index 193f3d889..492cfa8a6 100644 --- a/providers/dailymotion/dailymotion.go +++ b/providers/dailymotion/dailymotion.go @@ -10,9 +10,9 @@ import ( "net/http" "net/url" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -36,10 +36,10 @@ type Provider struct { // create one manually. func New(clientKey string, secret string, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "dailymotion", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "dailymotion", } p.config = newConfig(p, scopes) return p diff --git a/providers/deezer/deezer.go b/providers/deezer/deezer.go index d5bf91d4a..863adf234 100644 --- a/providers/deezer/deezer.go +++ b/providers/deezer/deezer.go @@ -11,9 +11,9 @@ import ( "net/http" "net/url" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -37,10 +37,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "deezer", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "deezer", } p.config = newConfig(p, scopes) return p diff --git a/providers/digitalocean/digitalocean.go b/providers/digitalocean/digitalocean.go index f9cfd7d4f..25c62c2df 100644 --- a/providers/digitalocean/digitalocean.go +++ b/providers/digitalocean/digitalocean.go @@ -9,9 +9,9 @@ import ( "io/ioutil" "net/http" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -25,10 +25,10 @@ const ( // one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "digitalocean", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "digitalocean", } p.config = newConfig(p, scopes) diff --git a/providers/discord/discord.go b/providers/discord/discord.go index ace776fe3..e26bb67d6 100644 --- a/providers/discord/discord.go +++ b/providers/discord/discord.go @@ -11,8 +11,8 @@ import ( "github.com/markbates/goth" "golang.org/x/oauth2" - "net/http" "fmt" + "net/http" ) const ( @@ -45,10 +45,10 @@ const ( // one manually. func New(clientKey string, secret string, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "discord", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "discord", } p.config = newConfig(p, scopes) return p diff --git a/providers/dropbox/dropbox.go b/providers/dropbox/dropbox.go index 61533d405..ec9973bb9 100644 --- a/providers/dropbox/dropbox.go +++ b/providers/dropbox/dropbox.go @@ -8,9 +8,9 @@ import ( "net/http" "strings" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -40,10 +40,10 @@ type Session struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "dropbox", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "dropbox", } p.config = newConfig(p, scopes) return p @@ -161,7 +161,7 @@ func newConfig(p *Provider, scopes []string) *oauth2.Config { func userFromReader(r io.Reader, user *goth.User) error { u := struct { - Name string `json:"display_name"` + Name string `json:"display_name"` NameDetails struct { NickName string `json:"familiar_name"` } `json:"name_details"` diff --git a/providers/facebook/facebook.go b/providers/facebook/facebook.go index e0cfdf1e3..266bbe220 100644 --- a/providers/facebook/facebook.go +++ b/providers/facebook/facebook.go @@ -11,12 +11,12 @@ import ( "net/http" "net/url" - "github.com/markbates/goth" - "golang.org/x/oauth2" - "fmt" "crypto/hmac" "crypto/sha256" "encoding/hex" + "fmt" + "github.com/markbates/goth" + "golang.org/x/oauth2" ) const ( @@ -30,10 +30,10 @@ const ( // one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "facebook", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "facebook", } p.config = newConfig(p, scopes) return p @@ -129,7 +129,7 @@ func userFromReader(reader io.Reader, user *goth.User) error { FirstName string `json:"first_name"` LastName string `json:"last_name"` Link string `json:"link"` - Picture struct { + Picture struct { Data struct { URL string `json:"url"` } `json:"data"` diff --git a/providers/fitbit/fitbit.go b/providers/fitbit/fitbit.go index 4c2992c5e..e88bdd402 100644 --- a/providers/fitbit/fitbit.go +++ b/providers/fitbit/fitbit.go @@ -7,9 +7,9 @@ import ( "io" "net/http" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -44,10 +44,10 @@ const ( // one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "fitbit", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "fitbit", } p.config = newConfig(p, scopes) return p diff --git a/providers/gitlab/gitlab.go b/providers/gitlab/gitlab.go index fe188c01a..533632e7f 100644 --- a/providers/gitlab/gitlab.go +++ b/providers/gitlab/gitlab.go @@ -11,9 +11,9 @@ import ( "net/url" "strconv" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) // These vars define the Authentication, Token, and Profile URLS for Gitlab. If diff --git a/providers/gplus/gplus.go b/providers/gplus/gplus.go index 06655c2f7..4726aa349 100644 --- a/providers/gplus/gplus.go +++ b/providers/gplus/gplus.go @@ -11,9 +11,9 @@ import ( "net/url" "strings" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -27,10 +27,10 @@ const ( // one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "gplus", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "gplus", } p.config = newConfig(p, scopes) return p diff --git a/providers/heroku/heroku.go b/providers/heroku/heroku.go index ca94f3434..bfb6c6002 100644 --- a/providers/heroku/heroku.go +++ b/providers/heroku/heroku.go @@ -7,9 +7,9 @@ import ( "io" "net/http" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( diff --git a/providers/instagram/instagram.go b/providers/instagram/instagram.go index 338f8ead0..3930ffad0 100644 --- a/providers/instagram/instagram.go +++ b/providers/instagram/instagram.go @@ -11,9 +11,9 @@ import ( "net/http" "net/url" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) var ( @@ -27,10 +27,10 @@ var ( // one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "instagram", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "instagram", } p.config = newConfig(p, scopes) return p @@ -118,7 +118,7 @@ func userFromReader(reader io.Reader, user *goth.User) error { ProfilePicture string `json:"profile_picture"` Bio string `json:"bio"` Website string `json:"website"` - Counts struct { + Counts struct { Media int `json:"media"` Follows int `json:"follows"` FollowedBy int `json:"followed_by"` diff --git a/providers/intercom/intercom.go b/providers/intercom/intercom.go index 3be6afb8d..fa747faec 100644 --- a/providers/intercom/intercom.go +++ b/providers/intercom/intercom.go @@ -24,10 +24,10 @@ var ( // New creates the new Intercom provider func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "intercom", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "intercom", } p.config = newConfig(p, scopes) return p diff --git a/providers/lastfm/lastfm.go b/providers/lastfm/lastfm.go index 98b883525..8624600a4 100644 --- a/providers/lastfm/lastfm.go +++ b/providers/lastfm/lastfm.go @@ -27,10 +27,10 @@ var ( // one manullay. func New(clientKey string, secret string, callbackURL string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "lastfm", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "lastfm", } return p } diff --git a/providers/linkedin/linkedin.go b/providers/linkedin/linkedin.go index d6db07fb3..ef59c2786 100644 --- a/providers/linkedin/linkedin.go +++ b/providers/linkedin/linkedin.go @@ -8,9 +8,9 @@ import ( "net/http" "net/url" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) //more details about linkedin fields: https://developer.linkedin.com/documents/profile-fields @@ -28,10 +28,10 @@ const ( // one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "linkedin", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "linkedin", } p.config = newConfig(p, scopes) return p @@ -125,7 +125,7 @@ func userFromReader(reader io.Reader, user *goth.User) error { LastName string `json:"lastName"` Headline string `json:"headline"` PictureURL string `json:"pictureUrl"` - Location struct { + Location struct { Name string `json:"name"` } `json:"location"` }{} diff --git a/providers/meetup/meetup.go b/providers/meetup/meetup.go index e3c5c500d..b2494231b 100644 --- a/providers/meetup/meetup.go +++ b/providers/meetup/meetup.go @@ -3,15 +3,15 @@ package meetup import ( - "net/http" - "golang.org/x/oauth2" - "github.com/markbates/goth" - "io/ioutil" - "encoding/json" "bytes" + "encoding/json" + "fmt" + "github.com/markbates/goth" + "golang.org/x/oauth2" "io" + "io/ioutil" + "net/http" "strconv" - "fmt" ) const ( @@ -25,10 +25,10 @@ const ( // one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "meetup", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "meetup", } // register this meetup.com provider as broken for oauth2 RetrieveToken oauth2.RegisterBrokenAuthHeaderProvider(tokenURL) @@ -92,7 +92,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { return user, err } - request.Header.Set("Authorization", "Bearer " + sess.AccessToken) + request.Header.Set("Authorization", "Bearer "+sess.AccessToken) response, err := p.Client().Do(request) if err != nil { return user, err diff --git a/providers/meetup/meetup_test.go b/providers/meetup/meetup_test.go index b08624a79..8a63b29f3 100644 --- a/providers/meetup/meetup_test.go +++ b/providers/meetup/meetup_test.go @@ -2,10 +2,10 @@ package meetup_test import ( "github.com/markbates/goth" + "github.com/markbates/goth/providers/meetup" "github.com/stretchr/testify/assert" "os" "testing" - "github.com/markbates/goth/providers/meetup" ) func Test_New(t *testing.T) { diff --git a/providers/meetup/session_test.go b/providers/meetup/session_test.go index 93d541534..c284e3802 100644 --- a/providers/meetup/session_test.go +++ b/providers/meetup/session_test.go @@ -2,9 +2,9 @@ package meetup_test import ( "github.com/markbates/goth" + "github.com/markbates/goth/providers/meetup" "github.com/stretchr/testify/assert" "testing" - "github.com/markbates/goth/providers/meetup" ) func Test_Implements_Session(t *testing.T) { diff --git a/providers/onedrive/onedrive.go b/providers/onedrive/onedrive.go index 3fb051f4c..2e4717184 100644 --- a/providers/onedrive/onedrive.go +++ b/providers/onedrive/onedrive.go @@ -10,9 +10,9 @@ import ( "net/http" "net/url" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( diff --git a/providers/openidConnect/openidConnect.go b/providers/openidConnect/openidConnect.go index 7ffd11c60..44419ba15 100644 --- a/providers/openidConnect/openidConnect.go +++ b/providers/openidConnect/openidConnect.go @@ -1,17 +1,17 @@ package openidConnect import ( - "net/http" - "strings" - "fmt" - "encoding/json" + "bytes" "encoding/base64" - "io/ioutil" + "encoding/json" "errors" - "golang.org/x/oauth2" + "fmt" "github.com/markbates/goth" + "golang.org/x/oauth2" + "io/ioutil" + "net/http" + "strings" "time" - "bytes" ) const ( @@ -89,14 +89,14 @@ func New(clientKey, secret, callbackURL, openIDAutoDiscoveryURL string, scopes . Secret: secret, CallbackURL: callbackURL, - UserIdClaims: []string{subjectClaim}, - NameClaims: []string{NameClaim}, - NickNameClaims: []string{NicknameClaim, PreferredUsernameClaim}, - EmailClaims: []string{EmailClaim}, - AvatarURLClaims:[]string{PictureClaim}, - FirstNameClaims:[]string{GivenNameClaim}, - LastNameClaims: []string{FamilyNameClaim}, - LocationClaims: []string{AddressClaim}, + UserIdClaims: []string{subjectClaim}, + NameClaims: []string{NameClaim}, + NickNameClaims: []string{NicknameClaim, PreferredUsernameClaim}, + EmailClaims: []string{EmailClaim}, + AvatarURLClaims: []string{PictureClaim}, + FirstNameClaims: []string{GivenNameClaim}, + LastNameClaims: []string{FamilyNameClaim}, + LocationClaims: []string{AddressClaim}, providerName: "openid-connect", } diff --git a/providers/openidConnect/openidConnect_test.go b/providers/openidConnect/openidConnect_test.go index c59f23722..aa7698077 100644 --- a/providers/openidConnect/openidConnect_test.go +++ b/providers/openidConnect/openidConnect_test.go @@ -1,13 +1,13 @@ package openidConnect import ( - "github.com/stretchr/testify/assert" - "os" - "testing" "fmt" "github.com/markbates/goth" - "net/http/httptest" + "github.com/stretchr/testify/assert" "net/http" + "net/http/httptest" + "os" + "testing" ) var ( diff --git a/providers/openidConnect/session.go b/providers/openidConnect/session.go index a34584fde..d223cf875 100644 --- a/providers/openidConnect/session.go +++ b/providers/openidConnect/session.go @@ -1,12 +1,12 @@ package openidConnect import ( + "encoding/json" "errors" "github.com/markbates/goth" - "encoding/json" + "golang.org/x/oauth2" "strings" "time" - "golang.org/x/oauth2" ) // Session stores data during the auth process with the OpenID Connect provider. diff --git a/providers/openidConnect/session_test.go b/providers/openidConnect/session_test.go index 691361bb6..9ad231f4c 100644 --- a/providers/openidConnect/session_test.go +++ b/providers/openidConnect/session_test.go @@ -1,9 +1,9 @@ package openidConnect import ( - "testing" - "github.com/stretchr/testify/assert" "github.com/markbates/goth" + "github.com/stretchr/testify/assert" + "testing" ) func Test_Implements_Session(t *testing.T) { @@ -44,4 +44,3 @@ func Test_String(t *testing.T) { a.Equal(s.String(), s.Marshal()) } - diff --git a/providers/paypal/paypal.go b/providers/paypal/paypal.go index 8ad92e0c1..999b6d003 100644 --- a/providers/paypal/paypal.go +++ b/providers/paypal/paypal.go @@ -165,7 +165,7 @@ func newConfig(provider *Provider, authURL, tokenURL string, scopes []string) *o func userFromReader(r io.Reader, user *goth.User) error { u := struct { - Name string `json:"name"` + Name string `json:"name"` Address struct { Locality string `json:"locality"` } `json:"address"` diff --git a/providers/salesforce/salesforce.go b/providers/salesforce/salesforce.go index 580e76e55..90007c755 100644 --- a/providers/salesforce/salesforce.go +++ b/providers/salesforce/salesforce.go @@ -8,9 +8,9 @@ import ( "net/http" "net/url" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -35,10 +35,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "salesforce", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "salesforce", } p.config = newConfig(p, scopes) return p diff --git a/providers/slack/slack.go b/providers/slack/slack.go index c5ff6e0a4..b7cf71e5b 100644 --- a/providers/slack/slack.go +++ b/providers/slack/slack.go @@ -10,9 +10,9 @@ import ( "net/http" "net/url" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -37,10 +37,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "slack", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "slack", } p.config = newConfig(p, scopes) return p @@ -160,7 +160,7 @@ func userFromReader(r io.Reader, user *goth.User) error { User struct { NickName string `json:"name"` ID string `json:"id"` - Profile struct { + Profile struct { Email string `json:"email"` Name string `json:"real_name"` AvatarURL string `json:"image_32"` diff --git a/providers/soundcloud/soundcloud.go b/providers/soundcloud/soundcloud.go index 62b975cb0..44afbe2d9 100644 --- a/providers/soundcloud/soundcloud.go +++ b/providers/soundcloud/soundcloud.go @@ -11,9 +11,9 @@ import ( "net/url" "strconv" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -37,10 +37,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "soundcloud", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "soundcloud", } p.config = newConfig(p, scopes) return p diff --git a/providers/spotify/spotify.go b/providers/spotify/spotify.go index 8656007ed..6b77350f6 100644 --- a/providers/spotify/spotify.go +++ b/providers/spotify/spotify.go @@ -7,9 +7,9 @@ import ( "io" "net/http" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -53,10 +53,10 @@ const ( // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "spotify", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "spotify", } p.config = newConfig(p, scopes) return p @@ -139,7 +139,7 @@ func userFromReader(r io.Reader, user *goth.User) error { DisplayName string `json:"display_name"` Email string `json:"email"` ID string `json:"id"` - Images []struct { + Images []struct { URL string `json:"url"` } `json:"images"` }{} diff --git a/providers/steam/session.go b/providers/steam/session.go index 3439b60c0..8f60dc296 100644 --- a/providers/steam/session.go +++ b/providers/steam/session.go @@ -47,7 +47,7 @@ func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, split := strings.Split(params.Get("openid.signed"), ",") for _, item := range split { - v.Set("openid."+item, params.Get("openid." + item)) + v.Set("openid."+item, params.Get("openid."+item)) } v.Set("openid.mode", "check_authentication") diff --git a/providers/steam/steam.go b/providers/steam/steam.go index 2af4dcdbf..79679defe 100644 --- a/providers/steam/steam.go +++ b/providers/steam/steam.go @@ -28,9 +28,9 @@ const ( // one manually. func New(apiKey string, callbackURL string) *Provider { p := &Provider{ - APIKey: apiKey, - CallbackURL: callbackURL, - providerName: "steam", + APIKey: apiKey, + CallbackURL: callbackURL, + providerName: "steam", } return p } diff --git a/providers/stripe/stripe.go b/providers/stripe/stripe.go index 02e20ec14..dbecfa039 100644 --- a/providers/stripe/stripe.go +++ b/providers/stripe/stripe.go @@ -7,9 +7,9 @@ import ( "io" "net/http" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -33,10 +33,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "stripe", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "stripe", } p.config = newConfig(p, scopes) return p @@ -130,7 +130,7 @@ func userFromReader(r io.Reader, user *goth.User) error { Name string `json:"display_name"` AvatarURL string `json:"business_logo"` ID string `json:"id"` - Address struct { + Address struct { Location string `json:"city"` } `json:"support_address"` }{} diff --git a/providers/twitch/twitch.go b/providers/twitch/twitch.go index d53152126..a19b283be 100644 --- a/providers/twitch/twitch.go +++ b/providers/twitch/twitch.go @@ -8,9 +8,9 @@ import ( "net/http" "strconv" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -60,10 +60,10 @@ const ( // one manually. func New(clientKey string, secret string, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "twitch", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "twitch", } p.config = newConfig(p, scopes) return p diff --git a/providers/uber/uber.go b/providers/uber/uber.go index fcb2b721e..706e123fd 100644 --- a/providers/uber/uber.go +++ b/providers/uber/uber.go @@ -7,9 +7,9 @@ import ( "io" "net/http" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -33,10 +33,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "uber", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "uber", } p.config = newConfig(p, scopes) return p diff --git a/providers/wepay/wepay.go b/providers/wepay/wepay.go index 74314e40e..9452ecd40 100644 --- a/providers/wepay/wepay.go +++ b/providers/wepay/wepay.go @@ -9,9 +9,9 @@ import ( "strconv" "strings" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -35,10 +35,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "wepay", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "wepay", } p.config = newConfig(p, scopes) return p diff --git a/providers/yahoo/yahoo.go b/providers/yahoo/yahoo.go index 878897725..8591c41cb 100644 --- a/providers/yahoo/yahoo.go +++ b/providers/yahoo/yahoo.go @@ -7,9 +7,9 @@ import ( "io" "net/http" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" ) const ( @@ -129,7 +129,7 @@ func userFromReader(r io.Reader, user *goth.User) error { NickName string `json:"nickname"` Location string `json:"location"` ID string `json:"guid"` - Image struct { + Image struct { ImageURL string `json:"imageURL"` } `json:"image"` } `json:"profile"` diff --git a/providers/yammer/yammer.go b/providers/yammer/yammer.go index 9ede479bd..acc07ac31 100644 --- a/providers/yammer/yammer.go +++ b/providers/yammer/yammer.go @@ -3,15 +3,15 @@ package yammer import ( + "bytes" + "encoding/json" "errors" - "net/http" - "strconv" + "fmt" "github.com/markbates/goth" "golang.org/x/oauth2" - "fmt" "io/ioutil" - "encoding/json" - "bytes" + "net/http" + "strconv" ) const ( @@ -35,10 +35,10 @@ type Provider struct { // create one manually. func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { p := &Provider{ - ClientKey: clientKey, - Secret: secret, - CallbackURL: callbackURL, - providerName: "yammer", + ClientKey: clientKey, + Secret: secret, + CallbackURL: callbackURL, + providerName: "yammer", } p.config = newConfig(p, scopes) return p