diff --git a/internal/ackhandler/received_packet_handler_test.go b/internal/ackhandler/received_packet_handler_test.go index f8eab7cf..2d5b37ce 100644 --- a/internal/ackhandler/received_packet_handler_test.go +++ b/internal/ackhandler/received_packet_handler_test.go @@ -205,8 +205,8 @@ var _ = Describe("receivedPacketHandler", func() { Expect(ack.LargestAcked).To(Equal(protocol.PacketNumber(4))) Expect(ack.LowestAcked).To(Equal(protocol.PacketNumber(1))) Expect(ack.AckRanges).To(Equal([]wire.AckRange{ - wire.AckRange{First: 4, Last: 4}, - wire.AckRange{First: 1, Last: 1}, + {First: 4, Last: 4}, + {First: 1, Last: 1}, })) }) @@ -222,8 +222,8 @@ var _ = Describe("receivedPacketHandler", func() { Expect(ack.LargestAcked).To(Equal(protocol.PacketNumber(3))) Expect(ack.LowestAcked).To(Equal(protocol.PacketNumber(0))) Expect(ack.AckRanges).To(Equal([]wire.AckRange{ - wire.AckRange{First: 3, Last: 3}, - wire.AckRange{First: 0, Last: 1}, + {First: 3, Last: 3}, + {First: 0, Last: 1}, })) }) diff --git a/internal/ackhandler/sent_packet_handler_test.go b/internal/ackhandler/sent_packet_handler_test.go index 0c6a929d..5418b000 100644 --- a/internal/ackhandler/sent_packet_handler_test.go +++ b/internal/ackhandler/sent_packet_handler_test.go @@ -513,9 +513,9 @@ var _ = Describe("SentPacketHandler", func() { Context("determining which ACKs we have received an ACK for", func() { BeforeEach(func() { morePackets := []*Packet{ - &Packet{PacketNumber: 13, Frames: []wire.Frame{&wire.AckFrame{LowestAcked: 80, LargestAcked: 100}, &streamFrame}, Length: 1}, - &Packet{PacketNumber: 14, Frames: []wire.Frame{&wire.AckFrame{LowestAcked: 50, LargestAcked: 200}, &streamFrame}, Length: 1}, - &Packet{PacketNumber: 15, Frames: []wire.Frame{&streamFrame}, Length: 1}, + {PacketNumber: 13, Frames: []wire.Frame{&wire.AckFrame{LowestAcked: 80, LargestAcked: 100}, &streamFrame}, Length: 1}, + {PacketNumber: 14, Frames: []wire.Frame{&wire.AckFrame{LowestAcked: 50, LargestAcked: 200}, &streamFrame}, Length: 1}, + {PacketNumber: 15, Frames: []wire.Frame{&streamFrame}, Length: 1}, } for _, packet := range morePackets { err := handler.SentPacket(packet) diff --git a/internal/handshake/crypto_setup_client_test.go b/internal/handshake/crypto_setup_client_test.go index 93179cdc..d4af7caa 100644 --- a/internal/handshake/crypto_setup_client_test.go +++ b/internal/handshake/crypto_setup_client_test.go @@ -95,8 +95,8 @@ var _ = Describe("Client Crypto Setup", func() { BeforeEach(func() { shloMap = map[Tag][]byte{ - TagPUBS: []byte{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}, - TagVER: []byte{}, + TagPUBS: {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}, + TagVER: {}, } keyDerivation := func(forwardSecure bool, sharedSecret, nonces []byte, connID protocol.ConnectionID, chlo []byte, scfg []byte, cert []byte, divNonce []byte, pers protocol.Perspective) (crypto.AEAD, error) { keyDerivationCalledWith = &keyDerivationValues{ @@ -231,8 +231,8 @@ var _ = Describe("Client Crypto Setup", func() { cs.negotiatedVersions = []protocol.VersionNumber{protocol.VersionWhatever} cs.receivedSecurePacket = true _, err := cs.handleSHLOMessage(map[Tag][]byte{ - TagPUBS: []byte{0}, - TagVER: []byte{0, 1}, + TagPUBS: {0}, + TagVER: {0, 1}, }) Expect(err).To(MatchError(qerr.Error(qerr.VersionNegotiationMismatch, "Downgrade attack detected"))) }) diff --git a/internal/handshake/server_config_client_test.go b/internal/handshake/server_config_client_test.go index b94c8016..d298e2f4 100644 --- a/internal/handshake/server_config_client_test.go +++ b/internal/handshake/server_config_client_test.go @@ -17,7 +17,7 @@ func getDefaultServerConfigClient() map[Tag][]byte { TagAEAD: []byte("AESG"), TagPUBS: append([]byte{0x20, 0x00, 0x00}, bytes.Repeat([]byte{0}, 32)...), TagOBIT: bytes.Repeat([]byte{0}, 8), - TagEXPY: []byte{0x0, 0x6c, 0x57, 0x78, 0, 0, 0, 0}, // 2033-12-24 + TagEXPY: {0x0, 0x6c, 0x57, 0x78, 0, 0, 0, 0}, // 2033-12-24 } } diff --git a/internal/handshake/tls_extension_handler_client_test.go b/internal/handshake/tls_extension_handler_client_test.go index 61d50e88..80b4d34b 100644 --- a/internal/handshake/tls_extension_handler_client_test.go +++ b/internal/handshake/tls_extension_handler_client_test.go @@ -66,10 +66,10 @@ var _ = Describe("TLS Extension Handler, for the client", func() { BeforeEach(func() { fakeBody = &tlsExtensionBody{data: []byte("foobar foobar")} parameters = map[transportParameterID][]byte{ - initialMaxStreamDataParameterID: []byte{0x11, 0x22, 0x33, 0x44}, - initialMaxDataParameterID: []byte{0x22, 0x33, 0x44, 0x55}, - initialMaxStreamIDBiDiParameterID: []byte{0x33, 0x44, 0x55, 0x66}, - idleTimeoutParameterID: []byte{0x13, 0x37}, + initialMaxStreamDataParameterID: {0x11, 0x22, 0x33, 0x44}, + initialMaxDataParameterID: {0x22, 0x33, 0x44, 0x55}, + initialMaxStreamIDBiDiParameterID: {0x33, 0x44, 0x55, 0x66}, + idleTimeoutParameterID: {0x13, 0x37}, statelessResetTokenParameterID: bytes.Repeat([]byte{0}, 16), } }) diff --git a/internal/handshake/tls_extension_handler_server_test.go b/internal/handshake/tls_extension_handler_server_test.go index d7d519b7..37147964 100644 --- a/internal/handshake/tls_extension_handler_server_test.go +++ b/internal/handshake/tls_extension_handler_server_test.go @@ -77,10 +77,10 @@ var _ = Describe("TLS Extension Handler, for the server", func() { BeforeEach(func() { fakeBody = &tlsExtensionBody{data: []byte("foobar foobar")} parameters = map[transportParameterID][]byte{ - initialMaxStreamDataParameterID: []byte{0x11, 0x22, 0x33, 0x44}, - initialMaxDataParameterID: []byte{0x22, 0x33, 0x44, 0x55}, - initialMaxStreamIDBiDiParameterID: []byte{0x33, 0x44, 0x55, 0x66}, - idleTimeoutParameterID: []byte{0x13, 0x37}, + initialMaxStreamDataParameterID: {0x11, 0x22, 0x33, 0x44}, + initialMaxDataParameterID: {0x22, 0x33, 0x44, 0x55}, + initialMaxStreamIDBiDiParameterID: {0x33, 0x44, 0x55, 0x66}, + idleTimeoutParameterID: {0x13, 0x37}, } }) diff --git a/internal/handshake/transport_parameter_test.go b/internal/handshake/transport_parameter_test.go index ed95637e..265c455a 100644 --- a/internal/handshake/transport_parameter_test.go +++ b/internal/handshake/transport_parameter_test.go @@ -115,11 +115,11 @@ var _ = Describe("Transport Parameters", func() { BeforeEach(func() { parameters = map[transportParameterID][]byte{ - initialMaxStreamDataParameterID: []byte{0x11, 0x22, 0x33, 0x44}, - initialMaxDataParameterID: []byte{0x22, 0x33, 0x44, 0x55}, - initialMaxStreamIDBiDiParameterID: []byte{0x33, 0x44, 0x55, 0x66}, - initialMaxStreamIDUniParameterID: []byte{0x44, 0x55, 0x66, 0x77}, - idleTimeoutParameterID: []byte{0x13, 0x37}, + initialMaxStreamDataParameterID: {0x11, 0x22, 0x33, 0x44}, + initialMaxDataParameterID: {0x22, 0x33, 0x44, 0x55}, + initialMaxStreamIDBiDiParameterID: {0x33, 0x44, 0x55, 0x66}, + initialMaxStreamIDUniParameterID: {0x44, 0x55, 0x66, 0x77}, + idleTimeoutParameterID: {0x13, 0x37}, } }) It("reads parameters", func() { diff --git a/internal/wire/ack_frame_test.go b/internal/wire/ack_frame_test.go index 0bf88914..35952fc5 100644 --- a/internal/wire/ack_frame_test.go +++ b/internal/wire/ack_frame_test.go @@ -83,8 +83,8 @@ var _ = Describe("ACK Frame (for IETF QUIC)", func() { Expect(frame.LowestAcked).To(Equal(protocol.PacketNumber(750))) Expect(frame.HasMissingRanges()).To(BeTrue()) Expect(frame.AckRanges).To(Equal([]AckRange{ - AckRange{Last: 1000, First: 900}, - AckRange{Last: 800, First: 750}, + {Last: 1000, First: 900}, + {Last: 800, First: 750}, })) Expect(b.Len()).To(BeZero()) }) @@ -106,9 +106,9 @@ var _ = Describe("ACK Frame (for IETF QUIC)", func() { Expect(frame.LowestAcked).To(Equal(protocol.PacketNumber(94))) Expect(frame.HasMissingRanges()).To(BeTrue()) Expect(frame.AckRanges).To(Equal([]AckRange{ - AckRange{Last: 100, First: 100}, - AckRange{Last: 98, First: 98}, - AckRange{Last: 95, First: 94}, + {Last: 100, First: 100}, + {Last: 98, First: 98}, + {Last: 95, First: 94}, })) Expect(b.Len()).To(BeZero()) }) diff --git a/internal/wire/public_reset_test.go b/internal/wire/public_reset_test.go index 72e79393..311ab6b7 100644 --- a/internal/wire/public_reset_test.go +++ b/internal/wire/public_reset_test.go @@ -56,7 +56,7 @@ var _ = Describe("public reset", func() { It("rejects packets missing the nonce", func() { data := map[handshake.Tag][]byte{ - handshake.TagRSEQ: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37}, + handshake.TagRSEQ: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37}, } handshake.HandshakeMessage{Tag: handshake.TagPRST, Data: data}.Write(b) _, err := ParsePublicReset(bytes.NewReader(b.Bytes())) @@ -65,8 +65,8 @@ var _ = Describe("public reset", func() { It("rejects packets with a wrong length nonce", func() { data := map[handshake.Tag][]byte{ - handshake.TagRSEQ: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37}, - handshake.TagRNON: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13}, + handshake.TagRSEQ: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37}, + handshake.TagRNON: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13}, } handshake.HandshakeMessage{Tag: handshake.TagPRST, Data: data}.Write(b) _, err := ParsePublicReset(bytes.NewReader(b.Bytes())) @@ -75,7 +75,7 @@ var _ = Describe("public reset", func() { It("accepts packets missing the rejected packet number", func() { data := map[handshake.Tag][]byte{ - handshake.TagRNON: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37}, + handshake.TagRNON: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37}, } handshake.HandshakeMessage{Tag: handshake.TagPRST, Data: data}.Write(b) pr, err := ParsePublicReset(bytes.NewReader(b.Bytes())) @@ -85,8 +85,8 @@ var _ = Describe("public reset", func() { It("rejects packets with a wrong length rejected packet number", func() { data := map[handshake.Tag][]byte{ - handshake.TagRSEQ: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13}, - handshake.TagRNON: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37}, + handshake.TagRSEQ: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13}, + handshake.TagRNON: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37}, } handshake.HandshakeMessage{Tag: handshake.TagPRST, Data: data}.Write(b) _, err := ParsePublicReset(bytes.NewReader(b.Bytes()))