// Find locationInfo by ip string
// It will return err when ipstr is not a valid format
Find locationInfo by ip string
It will return err when ipstr is not a valid format
// Find locationInfo by ip string // It will return err when ipstr is not a valid format
func (loc *locator) Find(ipstr string) (info *LocationInfo, err error) {
	ip := net.ParseIP(ipstr)
	if ip == nil || ip.To4() == nil {
		err = ErrUnsupportedIP
		return
	}
	info = loc.FindByUint(binary.BigEndian.Uint32([]byte(ip.To4())))
	return
}
func ( loc * locator ) Find ( ipstr string ) ( info * LocationInfo , err error ) { ip := net . ParseIP ( ipstr ) if ip == nil || ip . To4 ( ) == nil { err = ErrUnsupportedIP return } info = loc . FindByUint ( binary . BigEndian . Uint32 ( [ ] byte ( ip . To4 ( ) ) ) ) return }
Find locationInfo by ip string
It will return err when ipstr is not a valid format
Find locationInfo by ip string It will return err when ipstr is not a valid format