errcheck; sort some stuff out

This commit is contained in:
Zach Ramsay
2017-10-03 18:49:20 -04:00
committed by Ethan Buchman
parent 563faa98de
commit d7cb291fb2
26 changed files with 61 additions and 154 deletions

View File

@ -782,8 +782,5 @@ func writeListOfEndpoints(w http.ResponseWriter, r *http.Request, funcMap map[st
buf.WriteString("</body></html>")
w.Header().Set("Content-Type", "text/html")
w.WriteHeader(200)
_, err := w.Write(buf.Bytes())
if err != nil {
// ignore error
}
_, _ := w.Write(buf.Bytes()) // error ignored
}

View File

@ -56,7 +56,7 @@ func WriteRPCResponseHTTPError(w http.ResponseWriter, httpCode int, res types.RP
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(httpCode)
_, _ = w.Write(jsonBytes) // ignoring error
_, _ = w.Write(jsonBytes) // error ignored
}
func WriteRPCResponseHTTP(w http.ResponseWriter, res types.RPCResponse) {
@ -66,7 +66,7 @@ func WriteRPCResponseHTTP(w http.ResponseWriter, res types.RPCResponse) {
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(200)
_, _ = w.Write(jsonBytes) // ignoring error
_, _ = w.Write(jsonBytes) // error ignored
}
//-----------------------------------------------------------------------------