@@ -14,15 +14,15 @@ func TestListDirMD(t *testing.T) {
1414 mux := http .NewServeMux ()
1515
1616 mux .HandleFunc ("/repos/org/repo/contents/docs" , func (w http.ResponseWriter , r * http.Request ) {
17- json .NewEncoder (w ).Encode ([]DirEntry {
17+ _ = json .NewEncoder (w ).Encode ([]DirEntry {
1818 {Name : "guide.md" , Path : "docs/guide.md" , Type : "file" },
1919 {Name : "image.png" , Path : "docs/image.png" , Type : "file" },
2020 {Name : "sub" , Path : "docs/sub" , Type : "dir" },
2121 })
2222 })
2323
2424 mux .HandleFunc ("/repos/org/repo/contents/docs/sub" , func (w http.ResponseWriter , r * http.Request ) {
25- json .NewEncoder (w ).Encode ([]DirEntry {
25+ _ = json .NewEncoder (w ).Encode ([]DirEntry {
2626 {Name : "nested.md" , Path : "docs/sub/nested.md" , Type : "file" },
2727 {Name : "data.json" , Path : "docs/sub/data.json" , Type : "file" },
2828 })
@@ -64,7 +64,7 @@ func TestListDirMD_DepthLimit(t *testing.T) {
6464 mux := http .NewServeMux ()
6565 mux .HandleFunc ("/repos/org/repo/contents/" , func (w http.ResponseWriter , r * http.Request ) {
6666 callCount ++
67- json .NewEncoder (w ).Encode ([]DirEntry {
67+ _ = json .NewEncoder (w ).Encode ([]DirEntry {
6868 {Name : "file.md" , Path : r .URL .Path [len ("/repos/org/repo/contents/" ):] + "/file.md" , Type : "file" },
6969 {Name : "deeper" , Path : r .URL .Path [len ("/repos/org/repo/contents/" ):] + "/deeper" , Type : "dir" },
7070 })
@@ -134,7 +134,7 @@ func TestGetREADME_WithRef(t *testing.T) {
134134 mux := http .NewServeMux ()
135135 mux .HandleFunc ("/repos/org/repo/readme" , func (w http.ResponseWriter , r * http.Request ) {
136136 receivedRef = r .URL .Query ().Get ("ref" )
137- json .NewEncoder (w ).Encode (FileResponse {
137+ _ = json .NewEncoder (w ).Encode (FileResponse {
138138 Content : "VEVTVA==" ,
139139 Encoding : "base64" ,
140140 SHA : "sha123" ,
@@ -171,7 +171,7 @@ func TestListDirMD_WithRef(t *testing.T) {
171171 mux := http .NewServeMux ()
172172 mux .HandleFunc ("/repos/org/repo/contents/docs" , func (w http.ResponseWriter , r * http.Request ) {
173173 receivedRef = r .URL .Query ().Get ("ref" )
174- json .NewEncoder (w ).Encode ([]DirEntry {
174+ _ = json .NewEncoder (w ).Encode ([]DirEntry {
175175 {Name : "guide.md" , Path : "docs/guide.md" , Type : "file" },
176176 })
177177 })
@@ -206,7 +206,7 @@ func TestFetchPeribolosRepos(t *testing.T) {
206206 t .Run ("success" , func (t * testing.T ) {
207207 mux := http .NewServeMux ()
208208 mux .HandleFunc ("/repos/myorg/.github/contents/peribolos.yaml" , func (w http.ResponseWriter , r * http.Request ) {
209- json .NewEncoder (w ).Encode (FileResponse {
209+ _ = json .NewEncoder (w ).Encode (FileResponse {
210210 Content : b64 (peribolosYAML ),
211211 Encoding : "base64" ,
212212 })
@@ -234,7 +234,7 @@ func TestFetchPeribolosRepos(t *testing.T) {
234234 t .Run ("missing org in peribolos" , func (t * testing.T ) {
235235 mux := http .NewServeMux ()
236236 mux .HandleFunc ("/repos/otherorg/.github/contents/peribolos.yaml" , func (w http.ResponseWriter , r * http.Request ) {
237- json .NewEncoder (w ).Encode (FileResponse {
237+ _ = json .NewEncoder (w ).Encode (FileResponse {
238238 Content : b64 (peribolosYAML ),
239239 Encoding : "base64" ,
240240 })
@@ -254,7 +254,7 @@ func TestFetchPeribolosRepos(t *testing.T) {
254254 mux := http .NewServeMux ()
255255 mux .HandleFunc ("/repos/noorg/.github/contents/peribolos.yaml" , func (w http.ResponseWriter , r * http.Request ) {
256256 w .WriteHeader (http .StatusNotFound )
257- w .Write ([]byte (`{"message":"Not Found"}` ))
257+ _ , _ = w .Write ([]byte (`{"message":"Not Found"}` ))
258258 })
259259
260260 server := httptest .NewServer (mux )
@@ -271,7 +271,7 @@ func TestFetchPeribolosRepos(t *testing.T) {
271271func TestGetRepoMetadata (t * testing.T ) {
272272 mux := http .NewServeMux ()
273273 mux .HandleFunc ("/repos/org/myrepo" , func (w http.ResponseWriter , r * http.Request ) {
274- json .NewEncoder (w ).Encode (Repo {
274+ _ = json .NewEncoder (w ).Encode (Repo {
275275 Name : "myrepo" ,
276276 FullName : "org/myrepo" ,
277277 Description : "A test repo" ,
@@ -305,7 +305,7 @@ func TestContextCancellationDuringRetry(t *testing.T) {
305305 callCount ++
306306 w .Header ().Set ("Retry-After" , "60" )
307307 w .WriteHeader (http .StatusTooManyRequests )
308- w .Write ([]byte (`{"message":"rate limited"}` ))
308+ _ , _ = w .Write ([]byte (`{"message":"rate limited"}` ))
309309 })
310310 server := httptest .NewServer (mux )
311311 defer server .Close ()
0 commit comments