3 ms·
Go recently did add a new weak pointers and string interning package to its standard library which is an interesting read. [0] https://go.dev/blog/unique https
by ayuhito 2y ago
Go recently did add a new weak pointers and string interning package to its standard library which is an interesting read.
[0] https://go.dev/blog/unique https://go.dev/blog/unique
- ignoramous 2y ago> string interning package to its standard library TFA literally says interning isn't there in Go yet. While the unique package is useful, Make is admittedly not quite like Intern for strings, since the Handle[T] is required to keep a string from being deleted from the internal map. This means you need to modify your code to retain handles as well as strings. > an interesting read Tailscale's attempt at implementing "unique" was quite... something: https://tailscale.com/blog/netaddr-new-ip-type-for-go https://tailscale.com/blog/netaddr-new-ip-type-for-go
- ayuhito 2y agoThe Tailscale article taught me a lot! Thanks for sharing.