修复白名单数据库类型映射问题
This commit is contained in:
@@ -11,13 +11,13 @@ type Inet struct {
|
||||
}
|
||||
|
||||
func (inet Inet) Value() (driver.Value, error) {
|
||||
return inet.MarshalBinary()
|
||||
return inet.MarshalText()
|
||||
}
|
||||
|
||||
func (inet *Inet) Scan(value any) (err error) {
|
||||
switch value := value.(type) {
|
||||
case []byte:
|
||||
return inet.UnmarshalBinary(value)
|
||||
case string:
|
||||
return inet.UnmarshalText([]byte(value))
|
||||
default:
|
||||
return fmt.Errorf("不支持的类型: %T", value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user