fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

all: ignore error from http.ResponseWriter.Write

We are writing a final buffer in all cases. The usual reason this fails
is the user hanging up which is not useful to log.

+19 -19
+1 -1
cmd/zoekt-sourcegraph-indexserver/index_test.go
··· 33 33 http.Error(w, fmt.Sprintf("got URL %v want %v", got, want), http.StatusBadRequest) 34 34 return 35 35 } 36 - w.Write(response) 36 + _, _ = w.Write(response) 37 37 })) 38 38 defer server.Close() 39 39
+18 -18
web/server.go
··· 106 106 // "print" for the show file functionality. 107 107 Top *template.Template 108 108 109 - repolist *template.Template 110 - search *template.Template 111 - result *template.Template 112 - print *template.Template 113 - about *template.Template 114 - robots *template.Template 109 + repolist *template.Template 110 + search *template.Template 111 + result *template.Template 112 + print *template.Template 113 + about *template.Template 114 + robots *template.Template 115 115 116 116 startTime time.Time 117 117 ··· 147 147 } 148 148 149 149 for k, v := range map[string]**template.Template{ 150 - "results": &s.result, 151 - "print": &s.print, 152 - "search": &s.search, 153 - "repolist": &s.repolist, 154 - "about": &s.about, 155 - "robots": &s.robots, 150 + "results": &s.result, 151 + "print": &s.print, 152 + "search": &s.search, 153 + "repolist": &s.repolist, 154 + "about": &s.about, 155 + "robots": &s.robots, 156 156 } { 157 157 *v = s.Top.Lookup(k) 158 158 if *v == nil { ··· 302 302 return err 303 303 } 304 304 305 - w.Write(buf.Bytes()) 305 + _, _ = w.Write(buf.Bytes()) 306 306 return nil 307 307 } 308 308 ··· 380 380 if err := s.search.Execute(&buf, &d); err != nil { 381 381 return err 382 382 } 383 - w.Write(buf.Bytes()) 383 + _, _ = w.Write(buf.Bytes()) 384 384 return nil 385 385 } 386 386 ··· 406 406 if err := s.about.Execute(&buf, &d); err != nil { 407 407 return err 408 408 } 409 - w.Write(buf.Bytes()) 409 + _, _ = w.Write(buf.Bytes()) 410 410 return nil 411 411 } 412 412 ··· 422 422 if err := s.robots.Execute(&buf, &data); err != nil { 423 423 return err 424 424 } 425 - w.Write(buf.Bytes()) 425 + _, _ = w.Write(buf.Bytes()) 426 426 return nil 427 427 } 428 428 ··· 531 531 return err 532 532 } 533 533 534 - w.Write(buf.Bytes()) 534 + _, _ = w.Write(buf.Bytes()) 535 535 return nil 536 536 } 537 537 ··· 603 603 return err 604 604 } 605 605 606 - w.Write(buf.Bytes()) 606 + _, _ = w.Write(buf.Bytes()) 607 607 return nil 608 608 }