mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 05:07:36 +03:00
run staticcheck in gometalinter
This commit is contained in:
parent
b6470311ea
commit
286a51bcc0
6 changed files with 5 additions and 19 deletions
|
@ -10,6 +10,7 @@
|
|||
"goimports",
|
||||
"ineffassign",
|
||||
"misspell",
|
||||
"staticcheck",
|
||||
"structcheck",
|
||||
"unconvert",
|
||||
"unused",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
})
|
||||
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue