Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add support for netip Addr and AddrPort value types #1125

Open
database64128 opened this issue Jul 10, 2022 · 1 comment
Open

Comments

@database64128
Copy link

In Go 1.18, new read/write methods were added to net.UDPConn to take advantage of the new netip value types. I updated my code to use these new methods. But the expected savings fail to manifest, because for debug and error logs I had to pass the returned netip.AddrPort value to zap as Stringer, which leads the Go compiler to allocate them on the heap.

It'd be nice if zap has support for these new types. But I could see the difficulty of retrofitting these types into the Field struct.

@phuslu
Copy link

phuslu commented Jul 11, 2022

I added netip support in my logging lib in phuslu/log@7a25b6a

I think it worth a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants