Closed intfish123 closed 2 years ago
I read the db use this lib: github.com/oschwald/geoip2-golang v1.7.0
Your code is not complete as is and I am not able to run it. At a glance, I don't see anything obviously wrong. I would suggest comparing the structure of records in the database you generated with a MaxMind one using mmdblookup
from libmaxminddb
. I am closing this as I don't see any evidence there is a problem with mmdbwriter
.
Your code is not complete as is and I am not able to run it. At a glance, I don't see anything obviously wrong. I would suggest comparing the structure of records in the database you generated with a MaxMind one using
mmdblookup
fromlibmaxminddb
. I am closing this as I don't see any evidence there is a problem withmmdbwriter
.
Yep, you are right, I have found what's the my problem, &net.IPNet{IP: tmpIp, Mask: tmpIp.DefaultMask()}
is not correct for *IPNet. Thanks you very much.
I rewrote my code like this, But it still doesn't work, you can try it: