diff --git a/decoder.go b/decoder.go index 99aced3..9197f8b 100644 --- a/decoder.go +++ b/decoder.go @@ -235,7 +235,7 @@ func nullBoolToString(v spanner.NullBool) string { func nullBytesToString(v []byte) string { if v != nil { - return base64.RawStdEncoding.EncodeToString(v) + return base64.StdEncoding.EncodeToString(v) } else { return "NULL" } diff --git a/decoder_test.go b/decoder_test.go index 229e419..090137a 100644 --- a/decoder_test.go +++ b/decoder_test.go @@ -86,8 +86,8 @@ func TestDecodeColumn(t *testing.T) { }, { desc: "bytes", - value: []byte{'a', 'b', 'c'}, - want: "YWJj", // base64 encoded 'abc' + value: []byte{'a', 'b', 'c', 'd'}, + want: "YWJjZA==", // base64 encoded 'abc' }, { desc: "float64", @@ -190,8 +190,8 @@ func TestDecodeColumn(t *testing.T) { }, { desc: "array bytes", - value: [][]byte{{'a', 'b', 'c'}, {'e', 'f', 'g'}}, - want: "[YWJj, ZWZn]", + value: [][]byte{{'a', 'b', 'c', 'd'}, {'e', 'f', 'g', 'h'}}, + want: "[YWJjZA==, ZWZnaA==]", }, { desc: "array float64",