File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ package net
1212// BUG(mikio): On Windows, methods and functions related to UnixConn
1313// and UnixListener don't work for "unixgram" and "unixpacket".
1414
15+ // BUG(paralin): On TinyGo, Unix sockets are not implemented.
16+
1517// UnixAddr represents the address of a Unix domain socket end point.
1618type UnixAddr struct {
1719 Name string
@@ -41,3 +43,18 @@ func (a *UnixAddr) opAddr() Addr {
4143 }
4244 return a
4345}
46+
47+ // ResolveUnixAddr returns an address of Unix domain socket end point.
48+ //
49+ // The network must be a Unix network name.
50+ //
51+ // See func [Dial] for a description of the network and address
52+ // parameters.
53+ func ResolveUnixAddr (network , address string ) (* UnixAddr , error ) {
54+ switch network {
55+ case "unix" , "unixgram" , "unixpacket" :
56+ return & UnixAddr {Name : address , Net : network }, nil
57+ default :
58+ return nil , UnknownNetworkError (network )
59+ }
60+ }
You can’t perform that action at this time.
0 commit comments