浏览代码

ipv6: make not implemented errors more descriptive

Change-Id: I4710227d104330fa28a563530bd93a3ae8a6c070
Reviewed-on: https://go-review.googlesource.com/c/149877
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Mikio Hara 7 年之前
父节点
当前提交
d76a190299
共有 2 个文件被更改,包括 4 次插入6 次删除
  1. 2 6
      ipv6/control_windows.go
  2. 2 0
      ipv6/helper.go

+ 2 - 6
ipv6/control_windows.go

@@ -4,13 +4,9 @@
 
 package ipv6
 
-import (
-	"syscall"
-
-	"golang.org/x/net/internal/socket"
-)
+import "golang.org/x/net/internal/socket"
 
 func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
 	// TODO(mikio): implement this
-	return syscall.EWINDOWS
+	return errNotImplemented
 }

+ 2 - 0
ipv6/helper.go

@@ -7,6 +7,7 @@ package ipv6
 import (
 	"errors"
 	"net"
+	"runtime"
 )
 
 var (
@@ -16,6 +17,7 @@ var (
 	errInvalidConnType = errors.New("invalid conn type")
 	errOpNoSupport     = errors.New("operation not supported")
 	errNoSuchInterface = errors.New("no such interface")
+	errNotImplemented  = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH)
 )
 
 func boolint(b bool) int {