Skip to content

Commit 689493e

Browse files
committed
enable mirror
1 parent 4d23231 commit 689493e

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ linters:
1313
- gocritic
1414
- govet
1515
- ineffassign
16+
- mirror
1617
- nakedret
1718
- nolintlint
1819
- revive

models/asymkey/ssh_key_commit_verification.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func ParseCommitWithSSHSignature(ctx context.Context, c *git.Commit, committer *
6565
}
6666

6767
func verifySSHCommitVerification(sig, payload string, k *PublicKey, committer, signer *user_model.User, email string) *CommitVerification {
68-
if err := sshsig.Verify(bytes.NewBuffer([]byte(payload)), []byte(sig), []byte(k.Content), "git"); err != nil {
68+
if err := sshsig.Verify(bytes.NewBufferString(payload), []byte(sig), []byte(k.Content), "git"); err != nil {
6969
return nil
7070
}
7171

models/asymkey/ssh_key_verify.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ func VerifySSHKey(ctx context.Context, ownerID int64, fingerprint, token, signat
3030
return "", ErrKeyNotExist{}
3131
}
3232

33-
err = sshsig.Verify(bytes.NewBuffer([]byte(token)), []byte(signature), []byte(key.Content), "gitea")
33+
err = sshsig.Verify(bytes.NewBufferString(token), []byte(signature), []byte(key.Content), "gitea")
3434
if err != nil {
3535
// edge case for Windows based shells that will add CR LF if piped to ssh-keygen command
3636
// see https://github.com/PowerShell/PowerShell/issues/5974
37-
if sshsig.Verify(bytes.NewBuffer([]byte(token+"\r\n")), []byte(signature), []byte(key.Content), "gitea") != nil {
37+
if sshsig.Verify(bytes.NewBufferString(token+"\r\n"), []byte(signature), []byte(key.Content), "gitea") != nil {
3838
log.Error("Unable to validate token signature. Error: %v", err)
3939
return "", ErrSSHInvalidTokenSignature{
4040
Fingerprint: key.Fingerprint,

modules/indexer/code/bleve/token/path/path.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ func generatePathTokens(input analysis.TokenStream, reversed bool) analysis.Toke
5353

5454
for i := 0; i < len(input); i++ {
5555
var sb strings.Builder
56-
sb.WriteString(string(input[0].Term))
56+
sb.Write(input[0].Term)
5757

5858
for j := 1; j < i; j++ {
5959
sb.WriteString("/")
60-
sb.WriteString(string(input[j].Term))
60+
sb.Write(input[j].Term)
6161
}
6262

6363
term := sb.String()

modules/templates/helper_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
func TestSubjectBodySeparator(t *testing.T) {
1717
test := func(input, subject, body string) {
18-
loc := mailSubjectSplit.FindIndex([]byte(input))
18+
loc := mailSubjectSplit.FindStringIndex(input)
1919
if loc == nil {
2020
assert.Empty(t, subject, "no subject found, but one expected")
2121
assert.Equal(t, body, input)

0 commit comments

Comments
 (0)