2
0

Update pgproto3 to enable pgmock

This commit is contained in:
Jack Christensen
2017-05-06 08:48:40 -05:00
parent eb9fc6e7a5
commit 61d4386931
3 changed files with 130 additions and 4 deletions
+7 -2
View File
@@ -2,7 +2,6 @@ package pgproto3
import (
"encoding/binary"
"errors"
"fmt"
"io"
@@ -43,7 +42,13 @@ func NewFrontend(r io.Reader, w io.Writer) (*Frontend, error) {
}
func (b *Frontend) Send(msg FrontendMessage) error {
return errors.New("not implemented")
buf, err := msg.MarshalBinary()
if err != nil {
return nil
}
_, err = b.w.Write(buf)
return err
}
func (b *Frontend) Receive() (BackendMessage, error) {