mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: address golangci var-naming issues
Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit is contained in:
@@ -139,7 +139,7 @@ func (e Error) Error() string {
|
||||
return e.Message + " (" + e.Cause + ")"
|
||||
}
|
||||
|
||||
func (e Error) toJsonString() string {
|
||||
func (e Error) toJSONString() string {
|
||||
b, _ := json.Marshal(e)
|
||||
return string(b)
|
||||
}
|
||||
@@ -156,6 +156,6 @@ func (e Error) WriteTo(w http.ResponseWriter) error {
|
||||
w.Header().Add("X-Etcd-Index", fmt.Sprint(e.Index))
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(e.StatusCode())
|
||||
_, err := w.Write([]byte(e.toJsonString() + "\n"))
|
||||
_, err := w.Write([]byte(e.toJSONString() + "\n"))
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ func TestErrorWriteTo(t *testing.T) {
|
||||
}
|
||||
|
||||
gbody := strings.TrimSuffix(rr.Body.String(), "\n")
|
||||
if err.toJsonString() != gbody {
|
||||
t.Errorf("HTTP body %q, want %q", gbody, err.toJsonString())
|
||||
if err.toJSONString() != gbody {
|
||||
t.Errorf("HTTP body %q, want %q", gbody, err.toJSONString())
|
||||
}
|
||||
|
||||
wheader := http.Header(map[string][]string{
|
||||
|
||||
Reference in New Issue
Block a user