From c3a892fb6f8f8cd2786cd5205bcf002c1e6890ec Mon Sep 17 00:00:00 2001 From: Brandon Forster Date: Thu, 30 Jan 2020 09:06:01 -0600 Subject: [PATCH] #196: Explicitly ignored unused values. Signed-off-by: Brandon Forster --- clients/scheduler/interval_action_test.go | 12 ++++++------ clients/scheduler/interval_test.go | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/clients/scheduler/interval_action_test.go b/clients/scheduler/interval_action_test.go index 6ee2dd3e..626d3b6f 100644 --- a/clients/scheduler/interval_action_test.go +++ b/clients/scheduler/interval_action_test.go @@ -160,7 +160,7 @@ func TestIntervalActionRestClient_IntervalAction(t *testing.T) { if err != nil { t.Fatalf("marshaling error: %s", err.Error()) } - w.Write(data) + _, _ = w.Write(data) })) badJSONServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -175,7 +175,7 @@ func TestIntervalActionRestClient_IntervalAction(t *testing.T) { t.Fatalf("expected uri path is %s, actual uri path is %s", expectedURL, r.URL.EscapedPath()) } - w.Write([]byte{1, 2, 3, 4}) + _, _ = w.Write([]byte{1, 2, 3, 4}) })) defer ts.Close() @@ -254,7 +254,7 @@ func TestIntervalActionRestClient_IntervalActionForName(t *testing.T) { if err != nil { t.Fatalf("marshaling error: %s", err.Error()) } - w.Write(data) + _, _ = w.Write(data) })) defer ts.Close() @@ -297,7 +297,7 @@ func TestIntervalActionRestClient_IntervalActions(t *testing.T) { if err != nil { t.Fatalf("marshaling error: %s", err.Error()) } - w.Write(data) + _, _ = w.Write(data) })) badJSONServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -312,7 +312,7 @@ func TestIntervalActionRestClient_IntervalActions(t *testing.T) { t.Fatalf("expected uri path is %s, actual uri path is %s", expectedURL, r.URL.EscapedPath()) } - w.Write([]byte{1, 2, 3, 4}) + _, _ = w.Write([]byte{1, 2, 3, 4}) })) defer ts.Close() @@ -389,7 +389,7 @@ func TestIntervalActionRestClient_IntervalActionsForTargetByName(t *testing.T) { if err != nil { t.Fatalf("marshaling error: %s", err.Error()) } - w.Write(data) + _, _ = w.Write(data) })) defer ts.Close() diff --git a/clients/scheduler/interval_test.go b/clients/scheduler/interval_test.go index 6bd3738a..4fa20682 100644 --- a/clients/scheduler/interval_test.go +++ b/clients/scheduler/interval_test.go @@ -173,7 +173,7 @@ func TestIntervalRestClient_Interval(t *testing.T) { if err != nil { t.Fatalf("marshaling error: %s", err.Error()) } - w.Write(data) + _, _ = w.Write(data) })) badJSONServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -188,7 +188,7 @@ func TestIntervalRestClient_Interval(t *testing.T) { t.Fatalf("expected uri path is %s, actual uri path is %s", expectedURL, r.URL.EscapedPath()) } - w.Write([]byte{1, 2, 3, 4}) + _, _ = w.Write([]byte{1, 2, 3, 4}) })) defer ts.Close() @@ -267,7 +267,7 @@ func TestIntervalRestClient_IntervalForName(t *testing.T) { if err != nil { t.Fatalf("marshaling error: %s", err.Error()) } - w.Write(data) + _, _ = w.Write(data) })) defer ts.Close() @@ -310,7 +310,7 @@ func TestIntervalRestClient_Intervals(t *testing.T) { if err != nil { t.Fatalf("marshaling error: %s", err.Error()) } - w.Write(data) + _, _ = w.Write(data) })) badJSONServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -325,7 +325,7 @@ func TestIntervalRestClient_Intervals(t *testing.T) { t.Fatalf("expected uri path is %s, actual uri path is %s", expectedURL, r.URL.EscapedPath()) } - w.Write([]byte{1, 2, 3, 4}) + _, _ = w.Write([]byte{1, 2, 3, 4}) })) defer ts.Close() @@ -410,7 +410,7 @@ func TestIntervalRestClient_Update(t *testing.T) { type MockEndpoint struct { } -func (e MockEndpoint) Monitor(params types.EndpointParams) chan string { +func (e MockEndpoint) Monitor(_ types.EndpointParams) chan string { return make(chan string, 1) } @@ -420,7 +420,7 @@ func testHttpServer(t *testing.T, matchingRequestMethod string, matchingRequestU w.WriteHeader(http.StatusOK) if r.Method == matchingRequestMethod && r.RequestURI == matchingRequestUri { - w.Write([]byte("Ok")) + _, _ = w.Write([]byte("Ok")) } else if r.Method != matchingRequestMethod { t.Fatalf("expected method %s to be invoked by client, %s invoked", matchingRequestMethod, r.Method) } else if r.RequestURI == matchingRequestUri {