diff options
author | Anton Titov <[email protected]> | 2019-12-23 14:52:14 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-23 14:52:14 +0300 |
commit | e90fb03d058c4d61418dc2ef49660c7ba4badbd3 (patch) | |
tree | 00b16331b9ff3b3b846ba22989dddde721cc959d | |
parent | 2093cb9058f94668fff0a97beb76b0cab66c7b63 (diff) | |
parent | 921e1f55e23ab75b8250045916c8d1ffad1b8bde (diff) |
Merge pull request #206 from ValeryPiashchynski/Fix_warning_and_issues
[wip] Fixed the issues and warnings from linters
-rw-r--r-- | service/container_test.go | 4 | ||||
-rw-r--r-- | service/http/h2c_test.go | 7 | ||||
-rw-r--r-- | service/http/handler_test.go | 5 | ||||
-rw-r--r-- | static_pool_test.go | 1 | ||||
-rw-r--r-- | worker.go | 1 |
5 files changed, 13 insertions, 5 deletions
diff --git a/service/container_test.go b/service/container_test.go index ad4c1e64..5350de41 100644 --- a/service/container_test.go +++ b/service/container_test.go @@ -456,9 +456,7 @@ func TestContainer_NoInit(t *testing.T) { assert.NoError(t, c.Init(&testCfg{`{"test":"something", "test2":"something-else"}`})) } -type testInitD struct { - c *testInitC -} +type testInitD struct {} type DCfg struct { V string diff --git a/service/http/h2c_test.go b/service/http/h2c_test.go index e2669845..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() diff --git a/service/http/handler_test.go b/service/http/handler_test.go index 4efcdd00..994a663c 100644 --- a/service/http/handler_test.go +++ b/service/http/handler_test.go @@ -1043,6 +1043,7 @@ func TestHandler_Multipart_POST(t *testing.T) { } err = w.WriteField("arr[x][y][e]", "f") + if err != nil { t.Errorf("error writing the field: error %v", err) } @@ -1138,6 +1139,7 @@ func TestHandler_Multipart_PUT(t *testing.T) { } err = w.WriteField("name[]", "name1") + if err != nil { t.Errorf("error writing the field: error %v", err) } @@ -1234,6 +1236,7 @@ func TestHandler_Multipart_PATCH(t *testing.T) { go func() { err := hs.ListenAndServe() + if err != nil && err != http.ErrServerClosed { t.Errorf("error listening the interface: error %v", err) } @@ -1258,11 +1261,13 @@ func TestHandler_Multipart_PATCH(t *testing.T) { } err = w.WriteField("name[]", "name2") + if err != nil { t.Errorf("error writing the field: error %v", err) } err = w.WriteField("name[]", "name3") + if err != nil { t.Errorf("error writing the field: error %v", err) } diff --git a/static_pool_test.go b/static_pool_test.go index fd2827cc..1f185f58 100644 --- a/static_pool_test.go +++ b/static_pool_test.go @@ -205,7 +205,6 @@ func Test_StaticPool_Broken_FromOutside(t *testing.T) { if err != nil { t.Errorf("error killing the process: error %v", err) } - <-destructed for _, w := range p.Workers() { @@ -10,6 +10,7 @@ import ( "strconv" "strings" "sync" + "syscall" "time" ) |