File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ package misc
55
66import (
77 "errors"
8- "fmt"
98
109 "code.gitea.io/gitea/modules/git"
1110 asymkey_service "code.gitea.io/gitea/services/asymkey"
@@ -58,13 +57,10 @@ func SigningKey(ctx *context.APIContext) {
5857 return
5958 }
6059 if format != git .KeyTypeOpenPGP {
61- ctx .APIErrorNotFound (errors . New ( "SSH keys are used for signing, not GPG" ) )
60+ ctx .APIErrorNotFound ("SSH keys are used for signing, not GPG" )
6261 return
6362 }
64- _ , err = ctx .Write ([]byte (content ))
65- if err != nil {
66- ctx .APIErrorInternal (fmt .Errorf ("Error writing key content %w" , err ))
67- }
63+ _ , _ = ctx .Write ([]byte (content ))
6864}
6965
7066// SigningKey returns the public key of the default signing key if it exists
@@ -116,8 +112,5 @@ func SigningKeySSH(ctx *context.APIContext) {
116112 ctx .APIErrorNotFound (errors .New ("GPG keys are used for signing, not SSH" ))
117113 return
118114 }
119- _ , err = ctx .Write ([]byte (content ))
120- if err != nil {
121- ctx .APIErrorInternal (fmt .Errorf ("Error writing key content %w" , err ))
122- }
115+ _ , _ = ctx .Write ([]byte (content ))
123116}
You can’t perform that action at this time.
0 commit comments