mirror of
https://github.com/golang/go
synced 2024-09-25 01:20:13 -06:00
net: fix documentation for UnixAddr
Also simplifies ResolveUnixAddr. R=golang-dev, dave, rsc, bradfitz CC=golang-dev https://golang.org/cl/7510047
This commit is contained in:
parent
462a17e0f3
commit
8b6d501704
@ -12,7 +12,8 @@ type UnixAddr struct {
|
||||
Net string
|
||||
}
|
||||
|
||||
// Network returns the address's network name, "unix" or "unixgram".
|
||||
// Network returns the address's network name, "unix", "unixgram" or
|
||||
// "unixpacket".
|
||||
func (a *UnixAddr) Network() string {
|
||||
return a.Net
|
||||
}
|
||||
@ -36,11 +37,9 @@ func (a *UnixAddr) toAddr() Addr {
|
||||
// "unixpacket".
|
||||
func ResolveUnixAddr(net, addr string) (*UnixAddr, error) {
|
||||
switch net {
|
||||
case "unix":
|
||||
case "unixpacket":
|
||||
case "unixgram":
|
||||
case "unix", "unixgram", "unixpacket":
|
||||
return &UnixAddr{Name: addr, Net: net}, nil
|
||||
default:
|
||||
return nil, UnknownNetworkError(net)
|
||||
}
|
||||
return &UnixAddr{addr, net}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user