diff --git a/.gometalinter.json b/.gometalinter.json index b3eeb05a..f92d1291 100644 --- a/.gometalinter.json +++ b/.gometalinter.json @@ -10,6 +10,7 @@ "goimports", "ineffassign", "misspell", + "staticcheck", "structcheck", "unconvert", "unused", diff --git a/.travis/script.sh b/.travis/script.sh index 3d0a2d74..3d7f1f7d 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -6,7 +6,7 @@ go get -t ./... if [ ${TESTMODE} == "lint" ]; then go get github.com/alecthomas/gometalinter gometalinter --install - gometalinter --tests ./... + gometalinter --deadline=90s --tests ./... fi if [ ${TESTMODE} == "unit" ]; then diff --git a/h2quic/response.go b/h2quic/response.go index 13efdf84..93c13ffb 100644 --- a/h2quic/response.go +++ b/h2quic/response.go @@ -33,16 +33,7 @@ func responseFromHeaders(f *http2.MetaHeadersFrame) (*http.Response, error) { return nil, errors.New("malformed non-numeric status pseudo header") } - if statusCode == 100 { - // TODO: handle this - - // traceGot100Continue(cs.trace) - // if cs.on100 != nil { - // cs.on100() // forces any write delay timer to fire - // } - // cs.pastHeaders = false // do it all again - // return nil, nil - } + // TODO: handle statusCode == 100 header := make(http.Header) res := &http.Response{ @@ -78,13 +69,7 @@ func setLength(res *http.Response, isHead, streamEnded bool) *http.Response { if clens := res.Header["Content-Length"]; len(clens) == 1 { if clen64, err := strconv.ParseInt(clens[0], 10, 64); err == nil { res.ContentLength = clen64 - } else { - // TODO: care? unlike http/1, it won't mess up our framing, so it's - // more safe smuggling-wise to ignore. } - } else if len(clens) > 1 { - // TODO: care? unlike http/1, it won't mess up our framing, so it's - // more safe smuggling-wise to ignore. } } return res diff --git a/internal/flowcontrol/connection_flow_controller_test.go b/internal/flowcontrol/connection_flow_controller_test.go index 44a3d341..25e867a1 100644 --- a/internal/flowcontrol/connection_flow_controller_test.go +++ b/internal/flowcontrol/connection_flow_controller_test.go @@ -110,7 +110,6 @@ var _ = Describe("Connection Flow controller", func() { ) BeforeEach(func() { - controller.bytesRead = receiveWindowSize - receiveWindowSize controller.receiveWindow = receiveWindow controller.receiveWindowSize = receiveWindowSize oldWindowSize = controller.receiveWindowSize diff --git a/server_test.go b/server_test.go index 28ced17d..69e7f2e3 100644 --- a/server_test.go +++ b/server_test.go @@ -589,8 +589,8 @@ var _ = Describe("Server", func() { conn.dataToRead <- b.Bytes() conn.dataReadFrom = udpAddr ln, err := Listen(conn, testdata.GetTLSConfig(), config) - defer ln.Close() Expect(err).ToNot(HaveOccurred()) + defer ln.Close() Consistently(func() int { return conn.dataWritten.Len() }).Should(BeZero()) }) diff --git a/streams_map_legacy_test.go b/streams_map_legacy_test.go index 3c994a1f..b9450bc0 100644 --- a/streams_map_legacy_test.go +++ b/streams_map_legacy_test.go @@ -72,6 +72,7 @@ var _ = Describe("Streams Map (for gQUIC)", func() { It("gets existing streams", func() { s, err := m.getOrOpenStream(5) Expect(err).NotTo(HaveOccurred()) + Expect(s.StreamID()).To(Equal(protocol.StreamID(5))) numStreams := m.numIncomingStreams s, err = m.getOrOpenStream(5) Expect(err).NotTo(HaveOccurred())