Skip to content

Commit

Permalink
Fix errcheck issues in channels/app/admin_test.go (mattermost#28767)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzei authored Oct 14, 2024
1 parent a190fe8 commit ff6de4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion server/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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|\
Expand Down
9 changes: 6 additions & 3 deletions server/channels/app/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand All @@ -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()

Expand Down

0 comments on commit ff6de4b

Please sign in to comment.