From 60f22426d52ac3e2b746619bd57298813c4822dc Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 19 Dec 2016 02:00:24 -0500 Subject: Use x/sys/unix instead of the deprecated syscall. BREAKING CHANGE. This is just a search/replace s/syscall/unix/g in the broken code. --- nslcd_proto/io.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'nslcd_proto') diff --git a/nslcd_proto/io.go b/nslcd_proto/io.go index fa40be3..9252aca 100644 --- a/nslcd_proto/io.go +++ b/nslcd_proto/io.go @@ -23,7 +23,8 @@ import ( "io" "net" "reflect" - "syscall" + + "golang.org/x/sys/unix" ) type NslcdError string @@ -72,9 +73,9 @@ func Write(fd io.Writer, data interface{}) { var af int32 = -1 switch len(data) { case net.IPv4len: - af = syscall.AF_INET + af = unix.AF_INET case net.IPv6len: - af = syscall.AF_INET6 + af = unix.AF_INET6 } var bytes []byte if af < 0 { @@ -141,9 +142,9 @@ func Read(fd io.Reader, data interface{}) { Read(fd, &af) var _len int32 switch af { - case syscall.AF_INET: + case unix.AF_INET: _len = net.IPv4len - case syscall.AF_INET6: + case unix.AF_INET6: _len = net.IPv6len default: panic(NslcdError(fmt.Sprintf("incorrect address family specified: %d", af))) -- cgit v1.2.3