Fix errcheck issues in channels/app/admin_test.go (#28767)

This commit is contained in:
Ben Schumacher
2024-10-14 21:05:39 +02:00
committed by GitHub
parent a190fe8503
commit ff6de4bdab
2 changed files with 6 additions and 4 deletions
-1
View File
@@ -97,7 +97,6 @@ issues:
channels/api4/webhook_test.go|\
channels/api4/websocket_test.go|\
channels/app/admin.go|\
channels/app/admin_test.go|\
channels/app/app_test.go|\
channels/app/authorization_test.go|\
channels/app/auto_responder_test.go|\
+6 -3
View File
@@ -32,7 +32,8 @@ func TestGetLatestVersion(t *testing.T) {
require.NoError(t, jsonErr)
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write(validJSON)
_, err := w.Write(validJSON)
require.NoError(t, err)
}))
defer ts.Close()
@@ -62,7 +63,8 @@ func TestGetLatestVersion(t *testing.T) {
require.NoError(t, jsonErr)
updatedServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write(updatedJSON)
_, err := w.Write(updatedJSON)
require.NoError(t, err)
}))
defer ts.Close()
@@ -76,11 +78,12 @@ func TestGetLatestVersion(t *testing.T) {
th.App.ClearLatestVersionCache(th.Context)
errorServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(`
_, err := w.Write([]byte(`
{
"message": "internal server error"
}
`))
require.NoError(t, err)
}))
defer ts.Close()