Closed gabrielmocan closed 1 year ago
Peter, I'm sorry for opening this issue, but in hindsight it's better to keep net.IP as default representation, as most libs and methods available in Go [e.g mmdbLookup()] uses net.IP as input type. I'm closing this issue.
Pete, I was wondering if we can use netip.Addr type instead of net.IP type for representing IPs.
Advantages are: we keep the same functionalities of net.IP plus:
"Compared to the net.IP type, this package's Addr type takes less memory, is immutable, and is comparable (supports == and being a map key)."
https://pkg.go.dev/net/netip
This will enable using the addresses as map keys, which is very useful for filtering and aggregations.