Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit c1d423c

Browse files
committed
change column/ip.go Scan/string_interface
1 parent 56fc6c0 commit c1d423c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/column/ip.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ func (ip *IP) Scan(value interface{}) (err error) {
6161
err = errInvalidScanValue
6262
return
6363
}
64+
if (len(v) == 4 || len(v) == 16) && !strings.Contains(v, ".") && !strings.Contains(v, ":"){
65+
*ip = IP([]byte(v))
66+
return
67+
}
6468
if strings.Contains(v, ":") {
6569
*ip = IP(net.ParseIP(v))
6670
return

0 commit comments

Comments
 (0)