FAQ
Thx for this complement.
All my IPv4 addresses come from [4]bytes that I previously converted into
net.IP.

So all my IP are classic IPv4 and not IPv4-mapped into IPv6 address (as
describe into https://tools.ietf.org/html/rfc3493#section-3.7)
https://play.golang.org/p/gqZRUjNw5E

Thx again for this complement.


2016-04-18 11:07 GMT+02:00 Jakob Borg <jakob@nym.se>:
2016-04-17 19:07 GMT+02:00 Jérôme LAFORGE <jerome.laforge@gmail.com>:
As net.IP is []byte, does the compiler implement the same optimization when
you do this :

var m map[string]string
val, ok := m[string(net.IPv4zero)]
While not what you're asking, note that doing string(someNetIP) and
using that as a map key is risky business if you don't know how the
net.IP came to be. You're depending on it's internal representation
and there's more than one way it can express the same IP.

https://play.golang.org/p/1QqujZPX5V

//jb


--
"The box said 'Requires Windows 95, NT, or better,' so I installed Linux."

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 17, '16 at 5:07p
activeApr 18, '16 at 7:46p
posts4
users2
websitegolang.org

2 users in discussion

Jérôme LAFORGE: 3 posts Jakob Borg: 1 post

People

Translate

site design / logo © 2022 Grokbase