2.0.0-beta.2
Pre-release
Pre-release
2.0.0-beta.2
- BREAKING CHANGE: Replaced
IsZero()
methods withHasData()
methods on all
result structs (including Names). The new methods provide clearer semantics:
HasData()
returnstrue
when GeoIP data is found andfalse
when no data is
available. UnlikeIsZero()
,HasData()
excludes Network and IPAddress fields
from validation, allowing users to access network topology information even when
no GeoIP data is found. The Network and IPAddress fields are now always
populated for all lookups, regardless of whether GeoIP data is available. - BREAKING CHANGE: Replaced all anonymous nested structs with named types to
improve struct initialization ergonomics. All result structs (Enterprise, City,
Country) now use named types likeEnterpriseCityRecord
,CityTraits
,
CountryRecord
, etc. This makes it much easier to initialize structs in user
code while maintaining the same JSON serialization behavior. - BREAKING CHANGE: Changed
Location.Latitude
andLocation.Longitude
from
float64
to*float64
to properly distinguish between missing coordinates and
the valid location (0, 0). Missing coordinates are now represented asnil
and are omitted from JSON output, while valid zero coordinates are preserved.
This fixes the ambiguity where (0, 0) was incorrectly treated as "no data".
AddedLocation.HasCoordinates()
method for safe coordinate access. Reported
by Nick Bruun. GitHub #5.