-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
net/v2: meta bug for v2 changes #28900
Comments
There's probably at least 1 too many ways to read from a UDP Conn:
Likewise with UnixConn and IPConn. And maybe they're still not sufficient because it says at: https://golang.org/pkg/net/#UDPConn.ReadMsgUDP
Maybe we can get it right in one place and remove some of the redundant ones. |
|
Also the more general
|
This is now tagged for 1.13, but has been open since 2012
|
A few things in my mind, though each of these must be an individual proposal and I still have no concrete draft-proposals yet:
|
|
|
Few thoughts after my contributions to the net package:
func LookupCNAME(string) ([]string, error) {/*...*/}
// Struct, insted of returning multiple values in LookupHostInfo, so that we can add more field in the future.
type HostInfo struct {
Addrs []netip.Addr
CanonicalName string
}
func LookupHostInfo(string) (HostInfo, error) {/*...*/}
func LookupCanonicalName(h string) (string, error) {
hi, err := LookupHostInfo(h)
if err != nil {
return "", err
}
return hi.CanonicalName, nil
}
type Network uint8
const (
NetworkUDP Network = iota
NetworkUDP4
NetworkUDP6
NetworkTCP
NetworkTCP4
NetworkTCP6
// ....
)
func LookupIP(network Network, host string) ([]netip.Addr, error) {
hi, err := LookupHostInfo(h)
if err != nil {
return nil, err
}
return hi.Addrs, nil
}
type DNSError struct {
name string
server netip.Addr
unwrapErr error
} Keep the bevhaviour of only returing few error conditions in Lines 686 to 690 in 3959d54
Instead of the ErrHostNotFound = errors.New("no such host")
|
I see this isn't linked yet: |
This is a meta/index bug for things we might change in a possible future
net/v2
(~ "Go 2") package, including both links to other issues, or just comments with API problems/cleanups that are too little to warrant their own bugs.(This is not about
net/http
,net/mail
,net/rpc
,net/smtp
,net/nextproto
, ornet/url
. Those should have their own bugs if/when needed.)The text was updated successfully, but these errors were encountered: