diff options
author | Ben Burwell <ben@benburwell.com> | 2019-09-23 14:26:34 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-09-23 14:26:34 -0400 |
commit | f312016e0b70f38b48e509472680bbf6cde64179 (patch) | |
tree | 086fa9961c091dae5fb00d684965d47db8ce1d9a /client | |
parent | 5d3f80f17a10fcfd6b5fd4fb4a2d42afaf7dc789 (diff) |
Simplify
Diffstat (limited to 'client')
-rw-r--r-- | client/client_test.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/client/client_test.go b/client/client_test.go index b6af2b9..a724857 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -9,13 +9,12 @@ import ( ) func TestEncode(t *testing.T) { - var hf http.HandlerFunc = func(w http.ResponseWriter, r *http.Request) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("response")) - } - server := httptest.NewServer(hf) + })) defer server.Close() - c := CaesarClient{Endpoint: server.URL} // HL - r, err := c.EncodeMessage(strings.NewReader("secret message")) + client := CaesarClient{Endpoint: server.URL} // HL + r, err := client.EncodeMessage(strings.NewReader("secret message")) if err != nil { t.Errorf("should not have gotten error: %v", err) } |