good morning!!!!

Skip to content
Snippets Groups Projects
Commit 47b181de authored by Garet Halliday's avatar Garet Halliday
Browse files

bbbbbbb

parent 6b4bc96f
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,7 @@ func (T In) done() bool { ...@@ -52,7 +52,7 @@ func (T In) done() bool {
func (T In) Type() Type { func (T In) Type() Type {
if T.done() { if T.done() {
panic("Read after Send") panic("Read after Done")
} }
return T.buf.typ return T.buf.typ
} }
...@@ -61,7 +61,7 @@ func (T In) Type() Type { ...@@ -61,7 +61,7 @@ func (T In) Type() Type {
// NOTE: Full will be invalid after Done is called // NOTE: Full will be invalid after Done is called
func (T In) Full() []byte { func (T In) Full() []byte {
if T.done() { if T.done() {
panic("Read after Send") panic("Read after Done")
} }
return T.buf.buf return T.buf.buf
} }
...@@ -75,7 +75,7 @@ func (T In) Remaining() []byte { ...@@ -75,7 +75,7 @@ func (T In) Remaining() []byte {
func (T In) Reset() { func (T In) Reset() {
if T.done() { if T.done() {
panic("Read after Send") panic("Read after Done")
} }
T.buf.pos = 0 T.buf.pos = 0
} }
......
...@@ -14,6 +14,12 @@ type OutBuf struct { ...@@ -14,6 +14,12 @@ type OutBuf struct {
rev int rev int
} }
func MakeOutBuf(buf []byte) OutBuf {
return OutBuf{
buf: buf,
}
}
func (T *OutBuf) Reset() { func (T *OutBuf) Reset() {
T.typ = None T.typ = None
T.buf = T.buf[:0] T.buf = T.buf[:0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment