net: why not provide function net.ResolveAddr(network, address string) (net.Addr, error) #35244
Labels
Comments
Can you show us a case where a real program would want that function? |
The code involved above is the real code that implements the network framework within my company. This code happens before Dial or ListenPacket, when the network type is unknown, and I need to get net.Addr. I think the net.ResolveAddr function that returns net.Addr helps users reduce the switch case code, isn't it? |
Thanks, but can you expand on the actual use case? Why is the network type unknown? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: