Обложка канала

Библиотека Go разработчика

8531 @goproglib

Полезные материалы по всему, что может быть полезно разработчику на Go.

Библиотека Go разработчика

3 года назад
Открыть в
Детали работы с net.IP и netip.Addr в Go: все не так просто, как кажется. Читать
The exasperated engineers guide to IPs in Golang

If you’ve ever needed to store an IP address in Go, you will have come across either net.IP or netip.Addr, or both. If you aren’t sure about any of the following: Why are there two of them? (historical reasons) Is one objectively better than the other? (netip.Addr is always better) Which should I use? (netip.Addr) What’s the difference? (see below) Or if you need to understand the implementation details well enough to translate between them, then this article is for you.

djosephsen.github.io