aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/auth
diff options
context:
space:
mode:
authordelvh <leon@kske.dev>2022-10-24 21:29:17 +0200
committerGitHub <noreply@github.com>2022-10-24 20:29:17 +0100
commit0ebb45cfe7606adf021ad359d6fbfcefc54360a5 (patch)
tree541b75d083213e93bbbfadbdc5d560c739543903 /routers/web/auth
parent7c11a73833f3aa9783015e5e13871d3c298d3ef6 (diff)
downloadgitea-0ebb45cfe7606adf021ad359d6fbfcefc54360a5.tar.gz
gitea-0ebb45cfe7606adf021ad359d6fbfcefc54360a5.zip
Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551)
Found using `find . -type f -name '*.go' -print -exec vim {} -c ':%s/fmt\.Errorf(\(.*\)%v\(.*\)err/fmt.Errorf(\1%w\2err/g' -c ':wq' \;` Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/web/auth')
-rw-r--r--routers/web/auth/auth.go2
-rw-r--r--routers/web/auth/oauth.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go
index b48bdb9951..25d70d7c47 100644
--- a/routers/web/auth/auth.go
+++ b/routers/web/auth/auth.go
@@ -70,7 +70,7 @@ func AutoSignIn(ctx *context.Context) (bool, error) {
u, err := user_model.GetUserByName(ctx, uname)
if err != nil {
if !user_model.IsErrUserNotExist(err) {
- return false, fmt.Errorf("GetUserByName: %v", err)
+ return false, fmt.Errorf("GetUserByName: %w", err)
}
return false, nil
}
diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go
index 9c929d990e..4fba8d8e8c 100644
--- a/routers/web/auth/oauth.go
+++ b/routers/web/auth/oauth.go
@@ -303,7 +303,7 @@ func InfoOAuth(ctx *context.Context) {
func getOAuthGroupsForUser(user *user_model.User) ([]string, error) {
orgs, err := org_model.GetUserOrgsList(user)
if err != nil {
- return nil, fmt.Errorf("GetUserOrgList: %v", err)
+ return nil, fmt.Errorf("GetUserOrgList: %w", err)
}
var groups []string
@@ -311,7 +311,7 @@ func getOAuthGroupsForUser(user *user_model.User) ([]string, error) {
groups = append(groups, org.Name)
teams, err := org.LoadTeams()
if err != nil {
- return nil, fmt.Errorf("LoadTeams: %v", err)
+ return nil, fmt.Errorf("LoadTeams: %w", err)
}
for _, team := range teams {
if team.IsMember(user.ID) {