From 37aa577560f82aa65dfc270cbdf9d091ccb72a3f Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 21 Feb 2018 15:15:21 +0800 Subject: [PATCH] run ineffassign in gometalinter --- .gometalinter.json | 1 + internal/flowcontrol/connection_flow_controller_test.go | 2 +- mint_utils_test.go | 1 + send_stream_test.go | 1 + server_test.go | 2 ++ 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gometalinter.json b/.gometalinter.json index 88de3575..0f746d30 100644 --- a/.gometalinter.json +++ b/.gometalinter.json @@ -4,6 +4,7 @@ "vendor" ], "Enable": [ + "ineffassign", "vet" ], "Linters": { diff --git a/internal/flowcontrol/connection_flow_controller_test.go b/internal/flowcontrol/connection_flow_controller_test.go index c66f891a..44a3d341 100644 --- a/internal/flowcontrol/connection_flow_controller_test.go +++ b/internal/flowcontrol/connection_flow_controller_test.go @@ -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()) }) }) diff --git a/mint_utils_test.go b/mint_utils_test.go index bec11c42..d1afd804 100644 --- a/mint_utils_test.go +++ b/mint_utils_test.go @@ -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()) diff --git a/send_stream_test.go b/send_stream_test.go index d2718e18..cfea2722 100644 --- a/send_stream_test.go +++ b/send_stream_test.go @@ -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()) diff --git a/server_test.go b/server_test.go index b8aa1753..fb2be8c9 100644 --- a/server_test.go +++ b/server_test.go @@ -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)