1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-14 14:37:20 +00:00

Run gopls modernize on codebase (#34751)

Recent modernize fixes:
https://github.com/golang/tools/commits/master/gopls/internal/analysis/modernize
This commit is contained in:
silverwind
2025-06-18 03:48:09 +02:00
committed by GitHub
parent 71e4740946
commit 1f35435b81
190 changed files with 369 additions and 696 deletions

View File

@ -181,7 +181,7 @@ nwIDAQAB
var data []byte
if version == "1.3" {
data = []byte(fmt.Sprintf(
data = fmt.Appendf(nil,
"Method:%s\nPath:%s\nX-Ops-Content-Hash:%s\nX-Ops-Sign:version=%s\nX-Ops-Timestamp:%s\nX-Ops-UserId:%s\nX-Ops-Server-API-Version:%s",
req.Method,
path.Clean(req.URL.Path),
@ -190,17 +190,17 @@ nwIDAQAB
req.Header.Get("X-Ops-Timestamp"),
username,
req.Header.Get("X-Ops-Server-Api-Version"),
))
)
} else {
sum := sha1.Sum([]byte(path.Clean(req.URL.Path)))
data = []byte(fmt.Sprintf(
data = fmt.Appendf(nil,
"Method:%s\nHashed Path:%s\nX-Ops-Content-Hash:%s\nX-Ops-Timestamp:%s\nX-Ops-UserId:%s",
req.Method,
base64.StdEncoding.EncodeToString(sum[:]),
req.Header.Get("X-Ops-Content-Hash"),
req.Header.Get("X-Ops-Timestamp"),
username,
))
)
}
for k := range req.Header {