From cad5eb9d9340cfcd1346331c93eff5c7261d998a Mon Sep 17 00:00:00 2001 From: tkuchiki Date: Tue, 25 Jan 2022 09:40:30 +0900 Subject: [PATCH 1/2] Fix from base64.RawStdEncoding to base64.StdEncoding --- decoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" } From 005245a86b86830de25a42819c7f933104a96483 Mon Sep 17 00:00:00 2001 From: tkuchiki Date: Tue, 25 Jan 2022 21:59:21 +0900 Subject: [PATCH 2/2] Fix tests for BYTES type --- decoder_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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",