1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
9 // UnixAddr represents the address of a Unix domain socket end point.
10 type UnixAddr struct {
15 // Network returns the address's network name, "unix" or "unixgram".
16 func (a *UnixAddr) Network() string {
20 func (a *UnixAddr) String() string {
27 func (a *UnixAddr) toAddr() Addr {
28 if a == nil { // nil *UnixAddr
29 return nil // nil interface
34 // ResolveUnixAddr parses addr as a Unix domain socket address.
35 // The string net gives the network name, "unix", "unixgram" or
37 func ResolveUnixAddr(net, addr string) (*UnixAddr, error) {
43 return nil, UnknownNetworkError(net)
45 return &UnixAddr{addr, net}, nil