Use the io.Reader interface

This commit is contained in:
Kovid Goyal
2022-08-18 10:36:04 +05:30
parent a7bc2fcba8
commit 6c3a439455
3 changed files with 25 additions and 3 deletions

View File

@@ -2,9 +2,10 @@ package utils
import (
"fmt"
"github.com/seancfoley/ipaddress-go/ipaddr"
"runtime"
"strings"
"github.com/seancfoley/ipaddress-go/ipaddr"
)
func Cut(s string, sep string) (string, string, bool) {
@@ -21,7 +22,7 @@ func ParseSocketAddress(spec string) (network string, addr string, err error) {
return
}
if network == "unix" {
if strings.HasSuffix(addr, "@") && runtime.GOOS != "linux" {
if strings.HasPrefix(addr, "@") && runtime.GOOS != "linux" {
err = fmt.Errorf("Abstract UNIX sockets are only supported on Linux. Cannot use: %s", spec)
}
return