wire: remove FrameParser interface, expose FrameParser struct (#4284)

Instead, expose the FrameParser struct. This allows us to embed it
directly into the connection struct, avoiding a pointer indirection.
This commit is contained in:
Marten Seemann
2024-01-29 13:34:28 +07:00
committed by GitHub
parent 34c4d89e8b
commit be4838bd64
4 changed files with 14 additions and 19 deletions

View File

@@ -14,7 +14,7 @@ var _ = Describe("Frame parsing", func() {
var parser FrameParser
BeforeEach(func() {
parser = NewFrameParser(true)
parser = *NewFrameParser(true)
})
It("returns nil if there's nothing more to read", func() {
@@ -315,7 +315,7 @@ var _ = Describe("Frame parsing", func() {
})
It("errors when DATAGRAM frames are not supported", func() {
parser = NewFrameParser(false)
parser = *NewFrameParser(false)
f := &DatagramFrame{Data: []byte("foobar")}
b, err := f.Append(nil, protocol.Version1)
Expect(err).ToNot(HaveOccurred())