Implement socket I/O

This commit is contained in:
Kovid Goyal
2022-08-26 20:09:03 +05:30
parent a960937095
commit b2e610f9b1
3 changed files with 87 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ func Cut(s string, sep string) (string, string, bool) {
func ParseSocketAddress(spec string) (network string, addr string, err error) {
network, addr, found := Cut(spec, ":")
if !found {
err = fmt.Errorf("Invalid socket address: %s", spec)
err = fmt.Errorf("Invalid socket address: %s must be prefix by a protocol such as unix:", spec)
return
}
if network == "unix" {