code: func (ip *IP) Scan(value interface{}) (err error) {
  	switch v := value.(type) {
  	case []byte:
  		if len(v) == 4 || len(v) == 16 {
  			*ip = IP(v)
  		} else {
  			err = errInvalidScanValue
  		}
  	case string:
  		if len(v) == 4 || len(v) == 16 {
  			*ip = IP([]byte(v))
  		} else {
  			err = errInvalidScanValue
  		}
  	default:
  		err = errInvalidScanType
  	}
  	return
  }
docs: // Scan implements the driver.Valuer interface, json field interface