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
5
5
6
6
import (
7
7
"errors"
8
- "fmt"
9
8
10
9
"code.gitea.io/gitea/modules/git"
11
10
asymkey_service "code.gitea.io/gitea/services/asymkey"
@@ -58,13 +57,10 @@ func SigningKey(ctx *context.APIContext) {
58
57
return
59
58
}
60
59
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" )
62
61
return
63
62
}
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 ))
68
64
}
69
65
70
66
// SigningKey returns the public key of the default signing key if it exists
@@ -116,8 +112,5 @@ func SigningKeySSH(ctx *context.APIContext) {
116
112
ctx .APIErrorNotFound (errors .New ("GPG keys are used for signing, not SSH" ))
117
113
return
118
114
}
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 ))
123
116
}
You can’t perform that action at this time.
0 commit comments