Skip to content

Commit

Permalink
Fix Base64Bytes sql.Scanner (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK authored May 9, 2022
1 parent 8958f9d commit 8d81804
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions base64.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ func (b64 *Base64Bytes) Scan(src interface{}) error {
case string:
return b64.Decode(v)
case []byte:
new := append(Base64Bytes{}, v...)
b64 = &new
*b64 = append(Base64Bytes{}, v...)
return nil
case RawJSON:
return b64.UnmarshalJSON(v)
Expand Down
2 changes: 1 addition & 1 deletion base64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestScanBase64(t *testing.T) {

inputStr := "VGhpcyBpcyBhIHRlc3Qgc3RyaW5n"
inputJSON := RawJSON(`"` + inputStr + `"`)
inputBytes := []byte(inputStr)
inputBytes := []byte(expecting)
inputInt := 3

var b Base64Bytes
Expand Down

0 comments on commit 8d81804

Please sign in to comment.