Skip to content

Commit

Permalink
Use gofmt -s on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Fuhrimann authored and markbates committed Jan 9, 2018
1 parent c1c166e commit ed4f737
Show file tree
Hide file tree
Showing 41 changed files with 188 additions and 189 deletions.
2 changes: 1 addition & 1 deletion gothic/gothic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
2 changes: 1 addition & 1 deletion provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions providers/amazon/amazon.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"net/http"
"net/url"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions providers/bitbucket/bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"net/http"
"net/url"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand All @@ -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
Expand Down Expand Up @@ -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"`
Expand Down
10 changes: 5 additions & 5 deletions providers/box/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"io"
"net/http"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand All @@ -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
Expand Down
16 changes: 8 additions & 8 deletions providers/cloudfoundry/cf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions providers/dailymotion/dailymotion.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"net/http"
"net/url"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions providers/deezer/deezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"net/http"
"net/url"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions providers/digitalocean/digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"io/ioutil"
"net/http"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions providers/discord/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/markbates/goth"
"golang.org/x/oauth2"

"net/http"
"fmt"
"net/http"
)

const (
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions providers/dropbox/dropbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"net/http"
"strings"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"`
Expand Down
16 changes: 8 additions & 8 deletions providers/facebook/facebook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
Expand Down Expand Up @@ -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"`
Expand Down
10 changes: 5 additions & 5 deletions providers/fitbit/fitbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"io"
"net/http"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion providers/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions providers/gplus/gplus.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"net/url"
"strings"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion providers/heroku/heroku.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"io"
"net/http"

"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"fmt"
)

const (
Expand Down
Loading

0 comments on commit ed4f737

Please sign in to comment.