修复白名单数据库类型映射问题

This commit is contained in:
2025-11-28 18:35:33 +08:00
parent cb2a963a37
commit ab8873f2ea
4 changed files with 13 additions and 5 deletions

View File

@@ -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)
}