mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
This commit is contained in:
@@ -164,7 +164,6 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error {
|
||||
if err == nil && len(source.AttributeAvatar) > 0 {
|
||||
_ = user_service.UploadAvatar(usr, su.Avatar)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -410,7 +410,7 @@ func loadOrCreateAsymmetricKey() (interface{}, error) {
|
||||
return err
|
||||
}
|
||||
|
||||
f, err := os.OpenFile(keyPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
|
||||
f, err := os.OpenFile(keyPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@@ -139,10 +139,8 @@ func ClearProviders() {
|
||||
goth.ClearProviders()
|
||||
}
|
||||
|
||||
var (
|
||||
// ErrAuthSourceNotActived login source is not actived error
|
||||
ErrAuthSourceNotActived = errors.New("auth source is not actived")
|
||||
)
|
||||
// ErrAuthSourceNotActived login source is not actived error
|
||||
var ErrAuthSourceNotActived = errors.New("auth source is not actived")
|
||||
|
||||
// used to create different types of goth providers
|
||||
func createProvider(providerName string, source *Source) (goth.Provider, error) {
|
||||
|
@@ -13,8 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// OpenIDProvider is a GothProvider for OpenID
|
||||
type OpenIDProvider struct {
|
||||
}
|
||||
type OpenIDProvider struct{}
|
||||
|
||||
// Name provides the technical name for this provider
|
||||
func (o *OpenIDProvider) Name() string {
|
||||
|
@@ -107,5 +107,4 @@ func init() {
|
||||
return microsoftonline.New(clientID, secret, callbackURL, scopes...)
|
||||
},
|
||||
))
|
||||
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ func (source *Source) Callout(request *http.Request, response http.ResponseWrite
|
||||
|
||||
// don't use the default gothic begin handler to prevent issues when some error occurs
|
||||
// normally the gothic library will write some custom stuff to the response instead of our own nice error page
|
||||
//gothic.BeginAuthHandler(response, request)
|
||||
// gothic.BeginAuthHandler(response, request)
|
||||
|
||||
gothRWMutex.RLock()
|
||||
defer gothRWMutex.RUnlock()
|
||||
|
@@ -51,10 +51,8 @@ const (
|
||||
// Authenticators contains available SMTP authentication type names.
|
||||
var Authenticators = []string{PlainAuthentication, LoginAuthentication, CRAMMD5Authentication}
|
||||
|
||||
var (
|
||||
// ErrUnsupportedLoginType login source is unknown error
|
||||
ErrUnsupportedLoginType = errors.New("Login source is unknown")
|
||||
)
|
||||
// ErrUnsupportedLoginType login source is unknown error
|
||||
var ErrUnsupportedLoginType = errors.New("Login source is unknown")
|
||||
|
||||
// Authenticate performs an SMTP authentication.
|
||||
func Authenticate(a smtp.Auth, source *Source) error {
|
||||
|
Reference in New Issue
Block a user