mirror of
https://github.com/go-gitea/gitea
synced 2025-07-12 13:37:20 +00:00
Enable addtional linters (#34085)
enable mirror, usestdlibbars and perfsprint part of: https://github.com/go-gitea/gitea/issues/34083 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -12,6 +12,7 @@ import (
|
||||
"crypto/x509"
|
||||
"encoding/base64"
|
||||
"encoding/pem"
|
||||
"errors"
|
||||
"fmt"
|
||||
"hash"
|
||||
"math/big"
|
||||
@ -121,7 +122,7 @@ func verifyTimestamp(req *http.Request) error {
|
||||
}
|
||||
|
||||
if diff > maxTimeDifference {
|
||||
return fmt.Errorf("time difference")
|
||||
return errors.New("time difference")
|
||||
}
|
||||
|
||||
return nil
|
||||
@ -190,7 +191,7 @@ func getAuthorizationData(req *http.Request) ([]byte, error) {
|
||||
tmp := make([]string, len(valueList))
|
||||
for k, v := range valueList {
|
||||
if k > len(tmp) {
|
||||
return nil, fmt.Errorf("invalid X-Ops-Authorization headers")
|
||||
return nil, errors.New("invalid X-Ops-Authorization headers")
|
||||
}
|
||||
tmp[k-1] = v
|
||||
}
|
||||
@ -267,7 +268,7 @@ func verifyDataOld(signature, data []byte, pub *rsa.PublicKey) error {
|
||||
}
|
||||
|
||||
if !slices.Equal(out[skip:], data) {
|
||||
return fmt.Errorf("could not verify signature")
|
||||
return errors.New("could not verify signature")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user