1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +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:
TheFox0x7
2025-04-01 12:14:01 +02:00
committed by GitHub
parent 56e42be36d
commit ee3c82f874
294 changed files with 848 additions and 805 deletions

View File

@@ -64,7 +64,7 @@ func TestWebhookProxy(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.req, func(t *testing.T) {
req, err := http.NewRequest("POST", tt.req, nil)
req, err := http.NewRequest(http.MethodPost, tt.req, nil)
require.NoError(t, err)
u, err := webhookProxy(allowedHostMatcher)(req)
@@ -91,7 +91,7 @@ func TestWebhookDeliverAuthorizationHeader(t *testing.T) {
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
assert.Equal(t, "/webhook", r.URL.Path)
assert.Equal(t, "Bearer s3cr3t-t0ken", r.Header.Get("Authorization"))
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
done <- struct{}{}
}))
t.Cleanup(s.Close)
@@ -152,11 +152,11 @@ func TestWebhookDeliverHookTask(t *testing.T) {
assert.Len(t, body, 2147)
default:
w.WriteHeader(404)
w.WriteHeader(http.StatusNotFound)
t.Fatalf("unexpected url path %s", r.URL.Path)
return
}
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
done <- struct{}{}
}))
t.Cleanup(s.Close)