Allow Bytea literal constructor to accept byte array.
Bytea literal constructor now accepts string or []byte a a parameter.
This commit is contained in:
parent
f30cbb9e89
commit
9385f462df
3 changed files with 66 additions and 4 deletions
|
|
@ -62,6 +62,11 @@ func TestString(t *testing.T) {
|
|||
assertSerialize(t, String("Some text"), `$1`, "Some text")
|
||||
}
|
||||
|
||||
func TestBytea(t *testing.T) {
|
||||
assertSerialize(t, Bytea("Some text"), `$1::bytea`, "Some text")
|
||||
assertSerialize(t, Bytea([]byte("Some byte array")), `$1::bytea`, []byte("Some byte array"))
|
||||
}
|
||||
|
||||
func TestDate(t *testing.T) {
|
||||
assertSerialize(t, Date(2014, time.January, 2), `$1::date`, "2014-01-02")
|
||||
assertSerialize(t, DateT(time.Now()), `$1::date`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue