diff options
author | Paramtamtam <[email protected]> | 2019-12-24 10:48:49 +0500 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-24 10:48:49 +0500 |
commit | fbd2022729ab7ffe4eee8ba8b7357ba179e4d010 (patch) | |
tree | fa6b66b18259282b2efe00a41c445a3fa40aa701 /service/http/h2c_test.go | |
parent | 3f7d8bc007a4efdd48bb16253c2686006f0f9cda (diff) | |
parent | 75a817edcff22e721dcc3a7fa5590b866f630403 (diff) |
Merge branch 'master' into master
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) |