// Value implements the database/sql/driver Valuer interface. It will base64
// encode valid values prior to returning them.
Value implements the database/sql/driver Valuer interface. It will base64
encode valid values prior to returning them.
// Value implements the database / sql / driver Valuer interface . It will base64 // encode valid values prior to returning them .
func (b ByteSlice) Value() (driver.Value, error) {
	if !b.Valid {
		return nil, nil
	}
	enc := make([]byte, base64.StdEncoding.EncodedLen(len(b.ByteSlice)))
	base64.StdEncoding.Encode(enc, b.ByteSlice)
	return enc, nil
}
func ( b ByteSlice ) Value ( ) ( driver . Value , error ) { if ! b . Valid { return nil , nil } enc := make ( [ ] byte , base64 . StdEncoding . EncodedLen ( len ( b . ByteSlice ) ) ) base64 . StdEncoding . Encode ( enc , b . ByteSlice ) return enc , nil }
Value implements the database/sql/driver Valuer interface.
Value implements the database / sql / driver Valuer interface .
// TODO: For all base64.StdEncoding.Encode calls, consider performing an // optimization similar to the one implemented in encoding/json/encode.go's // encodeByteSlice function.