Commit 312bce6e authored by Mikio Hara's avatar Mikio Hara

internal/socket: make not implemented errors more descriptive

Change-Id: I7c1447849dc664ae54229345f2fce8f59204ecdf
Reviewed-on: https://go-review.googlesource.com/c/150117Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 617fbc82
......@@ -7,12 +7,10 @@
package socket
import "errors"
func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
......@@ -7,12 +7,10 @@
package socket
import "errors"
func (c *Conn) recvMsg(m *Message, flags int) error {
return errors.New("not implemented")
return errNotImplemented
}
func (c *Conn) sendMsg(m *Message, flags int) error {
return errors.New("not implemented")
return errNotImplemented
}
......@@ -6,20 +6,18 @@
package socket
import "errors"
func (c *Conn) recvMsg(m *Message, flags int) error {
return errors.New("not implemented")
return errNotImplemented
}
func (c *Conn) sendMsg(m *Message, flags int) error {
return errors.New("not implemented")
return errNotImplemented
}
func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
......@@ -9,9 +9,12 @@ package socket // import "golang.org/x/net/internal/socket"
import (
"errors"
"net"
"runtime"
"unsafe"
)
var errNotImplemented = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH)
// An Option represents a sticky socket option.
type Option struct {
Level int // level
......
......@@ -6,12 +6,10 @@
package socket
import "errors"
func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
......@@ -5,7 +5,6 @@
package socket
import (
"errors"
"runtime"
"syscall"
"unsafe"
......@@ -63,9 +62,9 @@ func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
}
func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
......@@ -7,7 +7,6 @@
package socket
import (
"errors"
"net"
"runtime"
"unsafe"
......@@ -36,29 +35,29 @@ func marshalInetAddr(ip net.IP, port int, zone string) []byte {
}
func parseInetAddr(b []byte, network string) (net.Addr, error) {
return nil, errors.New("not implemented")
return nil, errNotImplemented
}
func getsockopt(s uintptr, level, name int, b []byte) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func setsockopt(s uintptr, level, name int, b []byte) error {
return errors.New("not implemented")
return errNotImplemented
}
func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
......@@ -5,7 +5,6 @@
package socket
import (
"errors"
"syscall"
"unsafe"
)
......@@ -54,17 +53,17 @@ func setsockopt(s uintptr, level, name int, b []byte) error {
}
func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errors.New("not implemented")
return 0, errNotImplemented
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment