Skip to content

Commit 4902a49

Browse files
committed
Format comment
1 parent f842162 commit 4902a49

File tree

21 files changed

+36
-36
lines changed

21 files changed

+36
-36
lines changed

examples/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ func main() {
113113
eveonline.New(os.Getenv("EVEONLINE_KEY"), os.Getenv("EVEONLINE_SECRET"), "http://localhost:3000/auth/eveonline/callback"),
114114
kakao.New(os.Getenv("KAKAO_KEY"), os.Getenv("KAKAO_SECRET"), "http://localhost:3000/auth/kakao/callback"),
115115

116-
//Pointed localhost.com to http://localhost:3000/auth/yahoo/callback through proxy as yahoo
116+
// Pointed localhost.com to http://localhost:3000/auth/yahoo/callback through proxy as yahoo
117117
// does not allow to put custom ports in redirection uri
118118
yahoo.New(os.Getenv("YAHOO_KEY"), os.Getenv("YAHOO_SECRET"), "http://localhost.com"),
119119
typetalk.New(os.Getenv("TYPETALK_KEY"), os.Getenv("TYPETALK_SECRET"), "http://localhost:3000/auth/typetalk/callback", "my"),
120120
slack.New(os.Getenv("SLACK_KEY"), os.Getenv("SLACK_SECRET"), "http://localhost:3000/auth/slack/callback"),
121121
stripe.New(os.Getenv("STRIPE_KEY"), os.Getenv("STRIPE_SECRET"), "http://localhost:3000/auth/stripe/callback"),
122122
wepay.New(os.Getenv("WEPAY_KEY"), os.Getenv("WEPAY_SECRET"), "http://localhost:3000/auth/wepay/callback", "view_user"),
123-
//By default paypal production auth urls will be used, please set PAYPAL_ENV=sandbox as environment variable for testing
124-
//in sandbox environment
123+
// By default paypal production auth urls will be used, please set PAYPAL_ENV=sandbox as environment variable for testing
124+
// in sandbox environment
125125
paypal.New(os.Getenv("PAYPAL_KEY"), os.Getenv("PAYPAL_SECRET"), "http://localhost:3000/auth/paypal/callback"),
126126
steam.New(os.Getenv("STEAM_KEY"), "http://localhost:3000/auth/steam/callback"),
127127
heroku.New(os.Getenv("HEROKU_KEY"), os.Getenv("HEROKU_SECRET"), "http://localhost:3000/auth/heroku/callback"),
@@ -133,7 +133,7 @@ func main() {
133133
discord.New(os.Getenv("DISCORD_KEY"), os.Getenv("DISCORD_SECRET"), "http://localhost:3000/auth/discord/callback", discord.ScopeIdentify, discord.ScopeEmail),
134134
meetup.New(os.Getenv("MEETUP_KEY"), os.Getenv("MEETUP_SECRET"), "http://localhost:3000/auth/meetup/callback"),
135135

136-
//Auth0 allocates domain per customer, a domain must be provided for auth0 to work
136+
// Auth0 allocates domain per customer, a domain must be provided for auth0 to work
137137
auth0.New(os.Getenv("AUTH0_KEY"), os.Getenv("AUTH0_SECRET"), "http://localhost:3000/auth/auth0/callback", os.Getenv("AUTH0_DOMAIN")),
138138
xero.New(os.Getenv("XERO_KEY"), os.Getenv("XERO_SECRET"), "http://localhost:3000/auth/xero/callback"),
139139
vk.New(os.Getenv("VK_KEY"), os.Getenv("VK_SECRET"), "http://localhost:3000/auth/vk/callback"),

gothic/gothic_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func Test_CompleteUserAuthWithSessionDeducedProvider(t *testing.T) {
149149
a := assert.New(t)
150150

151151
res := httptest.NewRecorder()
152-
// Inteintionally omit a provider argument, force looking in session.
152+
// Intentionally omit a provider argument, force looking in session.
153153
req, err := http.NewRequest("GET", "/auth/callback", nil)
154154
a.NoError(err)
155155

provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ type Provider interface {
1717
UnmarshalSession(string) (Session, error)
1818
FetchUser(Session) (User, error)
1919
Debug(bool)
20-
RefreshToken(refreshToken string) (*oauth2.Token, error) //Get new access token based on the refresh token
21-
RefreshTokenAvailable() bool //Refresh token is provided by auth provider or not
20+
RefreshToken(refreshToken string) (*oauth2.Token, error) // Get new access token based on the refresh token
21+
RefreshTokenAvailable() bool // Refresh token is provided by auth provider or not
2222
}
2323

2424
const NoAuthUrlErrorMessage = "an AuthURL has not been set"

providers/apple/apple_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ nNFzkp23qt9IJDivieB/BBJct1UvhoICg5eZDhSR+x7UH3Uhog8qgoIC
7171
})
7272
a.NoError(err)
7373
a.NotZero(ss)
74-
//fmt.Printf("signed secret: %s", *ss)
74+
// fmt.Printf("signed secret: %s", *ss)
7575
}
7676

7777
func TestAuthorize(t *testing.T) {

providers/auth0/auth0_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func Test_SessionFromJSON(t *testing.T) {
5454
}
5555

5656
func Test_FetchUser(t *testing.T) {
57-
//t.Parallel()
57+
// t.Parallel()
5858
a := assert.New(t)
5959

6060
httpmock.Activate()

providers/azuread/azuread.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func userFromReader(r io.Reader, user *goth.User) error {
177177
user.LastName = u.LastName
178178
user.NickName = u.Name
179179
user.Location = u.Location
180-
user.UserID = u.UserPrincipalName //AzureAD doesn't provide separate user_id
180+
user.UserID = u.UserPrincipalName // AzureAD doesn't provide separate user_id
181181

182182
return nil
183183
}

providers/fitbit/fitbit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
123123
return user, fmt.Errorf("%s responded with a %d trying to fetch user information", p.providerName, resp.StatusCode)
124124
}
125125

126-
//err = userFromReader(io.TeeReader(resp.Body, os.Stdout), &user)
126+
// err = userFromReader(io.TeeReader(resp.Body, os.Stdout), &user)
127127
err = userFromReader(resp.Body, &user)
128128
return user, err
129129
}

providers/gplus/gplus.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ func userFromReader(reader io.Reader, user *goth.User) error {
137137
user.LastName = u.LastName
138138
user.NickName = u.Name
139139
user.Email = u.Email
140-
//user.Description = u.Bio
140+
// user.Description = u.Bio
141141
user.AvatarURL = u.Picture
142142
user.UserID = u.ID
143-
//user.Location = u.Location.Name
143+
// user.Location = u.Location.Name
144144

145145
return err
146146
}

providers/influxcloud/influxcloud_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func Test_BeginAuth(t *testing.T) {
6363
session, err := provider.BeginAuth("test_state")
6464
s := session.(*Session)
6565
a.NoError(err)
66-
//FIXME: we really need to be able to run this against the acceptance server, too.
66+
// FIXME: we really need to be able to run this against the acceptance server, too.
6767
// How should we do this? Maybe a test envvar switch?
6868
a.Contains(s.AuthURL, "cloud.influxdata.com/oauth/authorize")
6969
a.Contains(s.AuthURL, fmt.Sprintf("client_id=%s", os.Getenv("INFLUXCLOUD_KEY")))
@@ -76,7 +76,7 @@ func Test_SessionFromJSON(t *testing.T) {
7676

7777
provider := influxcloudProvider()
7878

79-
//FIXME: What is this testing exactly?
79+
// FIXME: What is this testing exactly?
8080
s, err := provider.UnmarshalSession(`{"AuthURL":"http://github.com/auth_url","AccessToken":"1234567890"}`)
8181
a.NoError(err)
8282
session := s.(*Session)

providers/linkedin/linkedin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const (
2121
authURL string = "https://www.linkedin.com/oauth/v2/authorization"
2222
tokenURL string = "https://www.linkedin.com/oauth/v2/accessToken"
2323

24-
//userEndpoint requires scope "r_liteprofile"
24+
// userEndpoint requires scope "r_liteprofile"
2525
userEndpoint string = "//api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams))"
26-
//emailEndpoint requires scope "r_emailaddress"
26+
// emailEndpoint requires scope "r_emailaddress"
2727
emailEndpoint string = "//api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))"
2828
)
2929

providers/openidConnect/openidConnect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ type RefreshTokenResponse struct {
9595
// The OAuth spec defines the refresh token as an optional response field in the
9696
// refresh token flow. As a result, a new refresh token may not be returned in a successful
9797
// response.
98-
//See more: https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/
98+
// See more: https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/
9999
RefreshToken string `json:"refresh_token,omitempty"`
100100
}
101101

providers/oura/oura.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
111111
return user, NewAPIError(resp.StatusCode, fmt.Sprintf("%s responded with a %d trying to fetch user information", p.providerName, resp.StatusCode))
112112
}
113113

114-
//err = userFromReader(io.TeeReader(resp.Body, os.Stdout), &user)
114+
// err = userFromReader(io.TeeReader(resp.Body, os.Stdout), &user)
115115
err = userFromReader(resp.Body, &user)
116116
return user, err
117117
}

providers/paypal/paypal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ const (
2020
sandbox string = "sandbox"
2121
envKey string = "PAYPAL_ENV"
2222

23-
//Endpoints for paypal sandbox env
23+
// Endpoints for paypal sandbox env
2424
authURLSandbox string = "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize"
2525
tokenURLSandbox string = "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/tokenservice"
2626
endpointProfileSandbox string = "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/userinfo"
2727

28-
//Endpoints for paypal production env
28+
// Endpoints for paypal production env
2929
authURLProduction string = "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize"
3030
tokenURLProduction string = "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/tokenservice"
3131
endpointProfileProduction string = "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/userinfo"

providers/salesforce/salesforce.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var (
2525
AuthURL string = "https://login.salesforce.com/services/oauth2/authorize"
2626
TokenURL string = "https://login.salesforce.com/services/oauth2/token"
2727

28-
//endpointProfile string = "https://api.salesforce.com/2.0/users/me"
28+
// endpointProfile string = "https://api.salesforce.com/2.0/users/me"
2929
)
3030

3131
// Provider is the implementation of `goth.Provider` for accessing Salesforce.
@@ -95,7 +95,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
9595
return user, err
9696
}
9797

98-
//creating dynamic url to retrieve user information
98+
// creating dynamic url to retrieve user information
9999
userURL := url.Scheme + "://" + url.Host + "/" + url.Path
100100
req, err := http.NewRequest("GET", userURL, nil)
101101
if err != nil {

providers/soundcloud/soundcloud.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func userFromReader(r io.Reader, user *goth.User) error {
145145
if err != nil {
146146
return err
147147
}
148-
//Soundcloud does not provide the email_id
148+
// Soundcloud does not provide the email_id
149149
user.Name = u.Name
150150
user.NickName = u.NickName
151151
user.UserID = strconv.Itoa(u.ID)

providers/spotify/spotify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
150150
return user, fmt.Errorf("%s responded with a %d trying to fetch user information", p.providerName, resp.StatusCode)
151151
}
152152

153-
//err = userFromReader(io.TeeReader(resp.Body, os.Stdout), &user)
153+
// err = userFromReader(io.TeeReader(resp.Body, os.Stdout), &user)
154154
err = userFromReader(resp.Body, &user)
155155
return user, err
156156
}

providers/stripe/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string,
4343
s.AccessToken = token.AccessToken
4444
s.RefreshToken = token.RefreshToken
4545
s.ExpiresAt = token.Expiry
46-
s.ID = token.Extra("stripe_user_id").(string) //Required to get the user info from sales force
46+
s.ID = token.Extra("stripe_user_id").(string) // Required to get the user info from sales force
4747
return token.AccessToken, err
4848
}
4949

providers/stripe/stripe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func userFromReader(r io.Reader, user *goth.User) error {
138138
if err != nil {
139139
return err
140140
}
141-
user.Email = u.Email //email is not provided by yahoo
141+
user.Email = u.Email // email is not provided by yahoo
142142
user.Name = u.Name
143143
user.NickName = u.Name
144144
user.UserID = u.ID

providers/xero/xero.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var (
4747
authorizeURL = "https://api.xero.com/oauth/Authorize"
4848
tokenURL = "https://api.xero.com/oauth/AccessToken"
4949
endpointProfile = "https://api.xero.com/api.xro/2.0/"
50-
//userAgentString should be changed to match the name of your Application
50+
// userAgentString should be changed to match the name of your Application
5151
userAgentString = os.Getenv("XERO_USER_AGENT") + " (goth-xero 1.0)"
5252
privateKeyFilePath = os.Getenv("XERO_PRIVATE_KEY_PATH")
5353
)
@@ -60,10 +60,10 @@ func New(clientKey, secret, callbackURL string) *Provider {
6060
ClientKey: clientKey,
6161
Secret: secret,
6262
CallbackURL: callbackURL,
63-
//Method determines how you will connect to Xero.
64-
//Options are public, private, and partner
65-
//Use public if this is your first time.
66-
//More details here: https://developer.xero.com/documentation/getting-started/api-application-types
63+
// Method determines how you will connect to Xero.
64+
// Options are public, private, and partner
65+
// Use public if this is your first time.
66+
// More details here: https://developer.xero.com/documentation/getting-started/api-application-types
6767
Method: os.Getenv("XERO_METHOD"),
6868
providerName: "xero",
6969
}

providers/yahoo/yahoo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func userFromReader(r io.Reader, user *goth.User) error {
138138
if err != nil {
139139
return err
140140
}
141-
user.Email = "" //email is not provided by yahoo
141+
user.Email = "" // email is not provided by yahoo
142142
user.Name = u.Profile.NickName
143143
user.NickName = u.Profile.NickName
144144
user.UserID = u.Profile.ID

providers/yammer/session.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string,
3838
"redirect_uri": CondVal(p.config.RedirectURL),
3939
"scope": CondVal(strings.Join(p.config.Scopes, " ")),
4040
}
41-
//Cant use standard auth2 implementation as yammer returns access_token as json rather than string
42-
//stand methods are throwing exception
43-
//token, err := p.config.Exchange(goth.ContextForClient(p.Client), params.Get("code"))
41+
// Cant use standard auth2 implementation as yammer returns access_token as json rather than string
42+
// stand methods are throwing exception
43+
// token, err := p.config.Exchange(goth.ContextForClient(p.Client), params.Get("code"))
4444
autData, err := retrieveAuthData(p, tokenURL, v)
4545
if err != nil {
4646
return "", err

0 commit comments

Comments
 (0)