@@ -14,7 +14,7 @@ import (
1414 "github.com/database64128/shadowsocks-go/netio"
1515 "github.com/database64128/shadowsocks-go/portset"
1616 "github.com/database64128/shadowsocks-go/zerocopy"
17- "github.com/oschwald/geoip2-golang"
17+ "github.com/oschwald/geoip2-golang/v2 "
1818 "go.uber.org/zap"
1919 "go4.org/netipx"
2020)
@@ -760,17 +760,17 @@ func (c DestResolvedGeoIPCountryCriterion) Meet(ctx context.Context, network pro
760760}
761761
762762func matchAddrToGeoIPCountries (countries []string , addr netip.Addr , geoip * geoip2.Reader , logger * zap.Logger ) (bool , error ) {
763- country , err := geoip .Country (addr . AsSlice () )
763+ country , err := geoip .Country (addr )
764764 if err != nil {
765765 return false , err
766766 }
767767 if ce := logger .Check (zap .DebugLevel , "Matched GeoIP country" ); ce != nil {
768768 ce .Write (
769769 zap .Stringer ("ip" , addr ),
770- zap .String ("country" , country .Country .IsoCode ),
770+ zap .String ("country" , country .Country .ISOCode ),
771771 )
772772 }
773- return slices .Contains (countries , country .Country .IsoCode ), nil
773+ return slices .Contains (countries , country .Country .ISOCode ), nil
774774}
775775
776776func lookup (ctx context.Context , resolvers []dns.SimpleResolver , domain string ) (ip netip.Addr , err error ) {
0 commit comments