Releases: netloc8/netloc8-go
Release list
v1.2.2 — geo:read → location:read scope migration
v1.2.1
Fixed
IsPublicIP— IPv6 link-local detection now correctly covers the fullfe80::/10range (fe80::throughfebf::). Previously only addresses starting withfe80were rejected; addresses likefe90::1,fea0::1, andfebf::1were incorrectly treated as public. Now uses byte-level CIDR inspection instead of string prefix matching.
Added
- Test cases for IPv6 link-local boundary:
fe90::1,fea0::1,febf::1(non-public) andfec0::1(public, just outside/10).
go get github.com/netloc8/netloc8-go@v1.2.1v1.2.0 — Geo Accessors, Coordinate Presence Detection
Expands the nil-safe accessor surface with RegionCode(), Lat(), Lng(), and a new HasCoordinates() predicate for distinguishing absent coordinates from a real 0,0 location.
Highlights
🧭 RegionCode() — nil-safe accessor for ISO 3166-2 subdivision codes
📍 Lat() / Lng() — nil-safe coordinate accessors returning float64
🔍 HasCoordinates() — predicate to disambiguate absent vs real 0,0
📝 README accuracy — nil-safety docs updated for numeric zero values
🧹 Accessor ordering — reordered to match struct field layout for scanability
Added
RegionCode()accessor — returns the ISO 3166-2 subdivision code (e.g."CA"), nil-safeLat()accessor — returns latitude coordinate, nil-safeLng()accessor — returns longitude coordinate, nil-safeHasCoordinates()predicate — distinguishes absent coordinates from a real0,0location
Changed
- README "Response Shape" section now uses
RegionCode(),Lat(),Lng()accessors instead of raw field access
Fixed
- README nil-safety note now correctly states accessors return zero values (empty strings or
0), not just "empty strings"
v1.1.0 — Account Management, WithTimeout Fix, errors.As Predicates
NetLoc8 Go SDK v1.1.0 adds the full account management API surface — profile, API keys, usage statistics, audit log, and allowed origins — bringing the SDK to feature parity with the authenticated API. This release also fixes several pre-existing issues surfaced during code review.
Highlights
🔑 10 new account management endpoints — GetProfile, ListKeys, CreateKey, DeleteKey, RenewKey, GetUsage, GetAuditLog, ListSites, CreateSite, DeleteSite
🛠️ POST & DELETE transport — new doPost and doDelete internal methods extend the HTTP layer
🐛 WithTimeout ordering fix — timeout no longer silently lost when called before WithHTTPClient
🔒 errors.As predicates — IsNotFound, IsRateLimited, IsForbidden now work with wrapped errors
📖 Full documentation — godoc examples, README method tables, CHANGELOG
✅ 64 tests passing — comprehensive coverage for all endpoints with zero new dependencies
Added
doPostanddoDeleteinternal HTTP transport methods onClientfor POST and DELETE API calls- Account management types:
Profile,APIKey,CreatedKey,Usage,AuditEntry,AuditLog,Site - Functional option types:
CreateKeyOption(WithKeyType),AuditLogOption(WithLimit,WithOffset,WithAction) - Client methods:
GetProfile,ListKeys,CreateKey,DeleteKey,RenewKey,GetUsage,GetAuditLog,ListSites,CreateSite,DeleteSite - Comprehensive test coverage for all account management endpoints (25 tests)
- Package documentation with usage examples for account management, usage statistics, audit log, and allowed origins
- Runnable
Exampletests forCreateKey,GetUsage,GetAuditLog - Account management methods table in README
TestNewClient_TimeoutOrderingtest proving option ordering is safe
Fixed
WithTimeoutordering bug: timeout was silently lost when called beforeWithHTTPClientIsNotFound,IsRateLimited,IsForbiddennow useerrors.Asinstead of direct type assertion, so they work with wrapped errorsdoPostno longer sendsContent-Type: application/jsonwhen body is nil (e.g.RenewKey)- Removed false
NETLOC8_API_KEYenv var fallback claim from README (was never implemented) TestClient_CreateKey_NoTypeassertion was trivially true; now properly checks thetypekey is absent
v1.0.0 — Stable Release
NetLoc8 Go SDK v1.0.0
The official Go client for the NetLoc8 IP geolocation API. Zero dependencies beyond the standard library.
Install
go get github.com/netloc8/netloc8-go@v1.0.0Highlights
- Full API coverage —
LookupIP,LookupMe,Timezone,MyTimezone,Validate - Functional options —
WithTimeout,WithHTTPClient,WithBaseURL,WithUserAgent,WithOrigin - Proxy-aware — pass a custom
*http.Clientwith a proxy transport to discover exit IPs - Nil-safe accessors —
geo.CountryCode(),geo.CityName(),geo.TZ()never panic - Typed errors —
*APIErrorwithIsNotFound,IsRateLimited,IsForbiddenpredicates - IP utilities —
NormalizeIP,IsPublicIP,Subnet,ParseIP,IsIPv4,IsIPv6 - Helpers —
IsEUfor GDPR compliance,GetClientIPfor reverse proxy header extraction - 110 tests with race detection clean
Quick Start
client := netloc8.NewClient( "sk_your_secret_key" )
geo, err := client.LookupIP( context.Background(), "8.8.8.8" )
fmt.Println( geo.CountryCode() ) // "US"
fmt.Println( geo.CityName() ) // "Mountain View"
fmt.Println( geo.TZ() ) // "America/Los_Angeles"
fmt.Println( geo.ASN() ) // "AS15169"