@@ -22,11 +22,17 @@ func (s TextNull) Value() (driver.Value, error) {
// Scan implements the sql.Scanner interface,
// and turns the bytes incoming from MySQL into a string
func (s *TextNull) Scan(src interface{}) error {
- if src == nil {
- *s = TextNull("")
+ if src != nil {
+ v, ok := src.([]byte)
+ if !ok {
+ return errors.New("bad []byte type assertion")
+ }
+
+ *s = TextNull(v)
+ return nil
}
- convertAssign(&s, src)
+ *s = TextNull("")
return nil