2
0

Document that Decode* must not keep src

- Also fix Bytea.DecodeBinary to not keep src.
This commit is contained in:
Jack Christensen
2017-03-11 20:12:47 -06:00
parent 7da69cd3db
commit 5cf4b97681
2 changed files with 10 additions and 1 deletions
+6
View File
@@ -80,10 +80,16 @@ type Value interface {
}
type BinaryDecoder interface {
// DecodeBinary decodes src into BinaryDecoder. If src is nil then the
// original SQL value is NULL. BinaryDecoder MUST not retain a reference to
// src. It MUST make a copy if it needs to retain the raw bytes.
DecodeBinary(src []byte) error
}
type TextDecoder interface {
// DecodeText decodes src into TextDecoder. If src is nil then the original
// SQL value is NULL. TextDecoder MUST not retain a reference to src. It MUST
// make a copy if it needs to retain the raw bytes.
DecodeText(src []byte) error
}