diff --git a/internal/codespaces/api/api_test.go b/internal/codespaces/api/api_test.go index 6975f9c65..af394cf7e 100644 --- a/internal/codespaces/api/api_test.go +++ b/internal/codespaces/api/api_test.go @@ -168,8 +168,9 @@ func createFakeSearchReposServer(t *testing.T, wantSearchText string, wantSort s responseRepos, } - data, _ := json.Marshal(response) - w.Write(data) + if err := json.NewEncoder(w).Encode(response); err != nil { + t.Error(err) + } })) }