chore: anchor golangci exclusion paths to directories (#39116)

Co-authored-by: Claude (Opus 5) <noreply@anthropic.com>
This commit is contained in:
silverwind
2026-08-25 18:36:45 +02:00
committed by GitHub
parent c8660364d9
commit 1680ac24e6
5 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ func AssetsCors() func(next http.Handler) http.Handler {
func FileHandlerFunc() http.HandlerFunc {
assetFS := AssetFS()
return func(resp http.ResponseWriter, req *http.Request) {
if req.Method != "GET" && req.Method != "HEAD" {
if req.Method != http.MethodGet && req.Method != http.MethodHead {
resp.WriteHeader(http.StatusMethodNotAllowed)
return
}
+2 -2
View File
@@ -10,9 +10,9 @@ package public
import (
"sync"
_ "embed"
"gitea.dev/modules/assetfs"
_ "embed"
)
//go:embed bindata.dat
+1 -1
View File
@@ -28,7 +28,7 @@ func TestParseAcceptEncoding(t *testing.T) {
for _, kase := range kases {
t.Run(kase.Header, func(t *testing.T) {
assert.EqualValues(t, kase.Expected, parseAcceptEncoding(kase.Header))
assert.Equal(t, kase.Expected, parseAcceptEncoding(kase.Header))
})
}
}
+1 -1
View File
@@ -115,7 +115,7 @@ func IsViteDevMode() bool {
now := time.Now()
lastCheck := viteDevModeCheck.Load()
if lastCheck != nil && time.Now().Sub(lastCheck.time) < time.Second {
if lastCheck != nil && now.Sub(lastCheck.time) < time.Second {
return lastCheck.isDev
}