Skip to content

Commit

Permalink
run staticcheck in gometalinter
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Feb 23, 2018
1 parent b647031 commit 286a51b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gometalinter.json
Expand Up @@ -10,6 +10,7 @@
"goimports",
"ineffassign",
"misspell",
"staticcheck",
"structcheck",
"unconvert",
"unused",
Expand Down
2 changes: 1 addition & 1 deletion .travis/script.sh
Expand Up @@ -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
Expand Down
17 changes: 1 addition & 16 deletions h2quic/response.go
Expand Up @@ -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{
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion internal/flowcontrol/connection_flow_controller_test.go
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server_test.go
Expand Up @@ -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())
})

Expand Down
1 change: 1 addition & 0 deletions streams_map_legacy_test.go
Expand Up @@ -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())
Expand Down

0 comments on commit 286a51b

Please sign in to comment.