mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-10 02:38:07 -05:00
Update golangci-lint to v2.6.0 (#35801)
https://github.com/golangci/golangci-lint/releases/tag/v2.6.0 - `modernize` linter is enabled, this is the same as `gopls modernize` - ~~`perfsprint` linter is disabled because it conflicts with `modernize` (maybe there is a middle ground)~~ - gocritic `deprecatedComment` is disabled as it conflicts with `go-swagger`
This commit is contained in:
@@ -1262,8 +1262,8 @@ func GetUserByEmail(ctx context.Context, email string) (*User, error) {
|
||||
}
|
||||
|
||||
// Finally, if email address is the protected email address:
|
||||
if strings.HasSuffix(email, "@"+setting.Service.NoReplyAddress) {
|
||||
username := strings.TrimSuffix(email, "@"+setting.Service.NoReplyAddress)
|
||||
if before, ok := strings.CutSuffix(email, "@"+setting.Service.NoReplyAddress); ok {
|
||||
username := before
|
||||
user := &User{}
|
||||
has, err := db.GetEngine(ctx).Where("lower_name=?", username).Get(user)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user