diff options
author | Valery Piashchynski <[email protected]> | 2019-11-17 18:13:15 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2019-11-17 18:13:15 +0300 |
commit | a7982f6e692e9dc40f035d5f1486cb2bbae71f88 (patch) | |
tree | ab4b32c190bc8bffd9b1b99b806e03192729c59a /service/http/h2c_test.go | |
parent | c463235f55cdae5fa7c63a87e7cc73c6e535d27a (diff) |
finish the check
Diffstat (limited to 'service/http/h2c_test.go')
-rw-r--r-- | service/http/h2c_test.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/service/http/h2c_test.go b/service/http/h2c_test.go index d806e5ff..7bbc30ac 100644 --- a/service/http/h2c_test.go +++ b/service/http/h2c_test.go @@ -36,7 +36,12 @@ func Test_Service_H2C(t *testing.T) { // should do nothing s.(*Service).Stop() - go func() { c.Serve() }() + go func() { + err := c.Serve() + if err != nil { + t.Errorf("error serving: %v", err) + } + }() time.Sleep(time.Millisecond * 100) defer c.Stop() @@ -49,7 +54,12 @@ func Test_Service_H2C(t *testing.T) { r, err := http.DefaultClient.Do(req) assert.NoError(t, err) - defer r.Body.Close() + defer func() { + err := r.Body.Close() + if err != nil { + t.Errorf("fail to close the Body: error %v", err) + } + }() assert.Equal(t, "101 Switching Protocols", r.Status) |