run ineffassign in gometalinter

This commit is contained in:
Marten Seemann 2018-02-21 15:15:21 +08:00
parent 548916e902
commit 37aa577560
5 changed files with 6 additions and 1 deletions

View file

@ -4,6 +4,7 @@
"vendor"
],
"Enable": [
"ineffassign",
"vet"
],
"Linters": {

View file

@ -97,7 +97,7 @@ var _ = Describe("Connection Flow controller", func() {
Expect(newlyBlocked).To(BeFalse())
controller.UpdateSendWindow(150)
controller.AddBytesSent(150)
newlyBlocked, offset = controller.IsNewlyBlocked()
newlyBlocked, _ = controller.IsNewlyBlocked()
Expect(newlyBlocked).To(BeTrue())
})
})

View file

@ -92,6 +92,7 @@ var _ = Describe("Packing and unpacking Initial packets", func() {
Expect(err).ToNot(HaveOccurred())
payloadStartIndex := buf.Len()
aeadCl, err := crypto.NewNullAEAD(protocol.PerspectiveClient, connID, ver)
Expect(err).ToNot(HaveOccurred())
for _, f := range frames {
err := f.Write(buf, ver)
Expect(err).ToNot(HaveOccurred())

View file

@ -124,6 +124,7 @@ var _ = Describe("Send Stream", func() {
}()
waitForWrite()
frame, hasMoreData := str.popStreamFrame(50)
Expect(frame).ToNot(BeNil())
Expect(hasMoreData).To(BeTrue())
frame, hasMoreData = str.popStreamFrame(1000)
Expect(frame).ToNot(BeNil())

View file

@ -392,6 +392,7 @@ var _ = Describe("Server", func() {
It("ignores public resets for known connections", func() {
err := serv.handlePacket(nil, nil, firstPacket)
Expect(err).ToNot(HaveOccurred())
Expect(serv.sessions).To(HaveLen(1))
Expect(serv.sessions[connID].(*mockSession).packetCount).To(Equal(1))
err = serv.handlePacket(nil, nil, wire.WritePublicReset(connID, 1, 1337))
@ -402,6 +403,7 @@ var _ = Describe("Server", func() {
It("ignores invalid public resets for known connections", func() {
err := serv.handlePacket(nil, nil, firstPacket)
Expect(err).ToNot(HaveOccurred())
Expect(serv.sessions).To(HaveLen(1))
Expect(serv.sessions[connID].(*mockSession).packetCount).To(Equal(1))
data := wire.WritePublicReset(connID, 1, 1337)