Update pgproto3 to enable pgmock
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package pgio
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
)
|
||||
|
||||
@@ -38,3 +39,13 @@ func NextInt64(buf []byte) ([]byte, int64) {
|
||||
buf, n := NextUint64(buf)
|
||||
return buf, int64(n)
|
||||
}
|
||||
|
||||
func NextCString(buf []byte) ([]byte, string, bool) {
|
||||
idx := bytes.IndexByte(buf, 0)
|
||||
if idx < 0 {
|
||||
return buf, "", false
|
||||
}
|
||||
cstring := string(buf[:idx])
|
||||
buf = buf[:idx+1]
|
||||
return buf, cstring, true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user