src/pkg/[n-z]*: gofix -r error -force=error
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
diff --git a/src/pkg/net/udpsock_posix.go b/src/pkg/net/udpsock_posix.go
index 06298ee..2cfcc60 100644
--- a/src/pkg/net/udpsock_posix.go
+++ b/src/pkg/net/udpsock_posix.go
@@ -34,7 +34,7 @@
return syscall.AF_INET6
}
-func (a *UDPAddr) sockaddr(family int) (syscall.Sockaddr, os.Error) {
+func (a *UDPAddr) sockaddr(family int) (syscall.Sockaddr, error) {
return ipToSockaddr(family, a.IP, a.Port)
}
@@ -58,7 +58,7 @@
// Implementation of the Conn interface - see Conn for documentation.
// Read implements the net.Conn Read method.
-func (c *UDPConn) Read(b []byte) (n int, err os.Error) {
+func (c *UDPConn) Read(b []byte) (n int, err error) {
if !c.ok() {
return 0, os.EINVAL
}
@@ -66,7 +66,7 @@
}
// Write implements the net.Conn Write method.
-func (c *UDPConn) Write(b []byte) (n int, err os.Error) {
+func (c *UDPConn) Write(b []byte) (n int, err error) {
if !c.ok() {
return 0, os.EINVAL
}
@@ -74,7 +74,7 @@
}
// Close closes the UDP connection.
-func (c *UDPConn) Close() os.Error {
+func (c *UDPConn) Close() error {
if !c.ok() {
return os.EINVAL
}
@@ -100,7 +100,7 @@
}
// SetTimeout implements the net.Conn SetTimeout method.
-func (c *UDPConn) SetTimeout(nsec int64) os.Error {
+func (c *UDPConn) SetTimeout(nsec int64) error {
if !c.ok() {
return os.EINVAL
}
@@ -108,7 +108,7 @@
}
// SetReadTimeout implements the net.Conn SetReadTimeout method.
-func (c *UDPConn) SetReadTimeout(nsec int64) os.Error {
+func (c *UDPConn) SetReadTimeout(nsec int64) error {
if !c.ok() {
return os.EINVAL
}
@@ -116,7 +116,7 @@
}
// SetWriteTimeout implements the net.Conn SetWriteTimeout method.
-func (c *UDPConn) SetWriteTimeout(nsec int64) os.Error {
+func (c *UDPConn) SetWriteTimeout(nsec int64) error {
if !c.ok() {
return os.EINVAL
}
@@ -125,7 +125,7 @@
// SetReadBuffer sets the size of the operating system's
// receive buffer associated with the connection.
-func (c *UDPConn) SetReadBuffer(bytes int) os.Error {
+func (c *UDPConn) SetReadBuffer(bytes int) error {
if !c.ok() {
return os.EINVAL
}
@@ -134,7 +134,7 @@
// SetWriteBuffer sets the size of the operating system's
// transmit buffer associated with the connection.
-func (c *UDPConn) SetWriteBuffer(bytes int) os.Error {
+func (c *UDPConn) SetWriteBuffer(bytes int) error {
if !c.ok() {
return os.EINVAL
}
@@ -149,7 +149,7 @@
//
// ReadFromUDP can be made to time out and return an error with Timeout() == true
// after a fixed time limit; see SetTimeout and SetReadTimeout.
-func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *UDPAddr, err os.Error) {
+func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *UDPAddr, err error) {
if !c.ok() {
return 0, nil, os.EINVAL
}
@@ -164,7 +164,7 @@
}
// ReadFrom implements the net.PacketConn ReadFrom method.
-func (c *UDPConn) ReadFrom(b []byte) (n int, addr Addr, err os.Error) {
+func (c *UDPConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
if !c.ok() {
return 0, nil, os.EINVAL
}
@@ -178,19 +178,19 @@
// an error with Timeout() == true after a fixed time limit;
// see SetTimeout and SetWriteTimeout.
// On packet-oriented connections, write timeouts are rare.
-func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (n int, err os.Error) {
+func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (n int, err error) {
if !c.ok() {
return 0, os.EINVAL
}
sa, err1 := addr.sockaddr(c.fd.family)
if err1 != nil {
- return 0, &OpError{Op: "write", Net: "udp", Addr: addr, Error: err1}
+ return 0, &OpError{Op: "write", Net: "udp", Addr: addr, Err: err1}
}
return c.fd.WriteTo(b, sa)
}
// WriteTo implements the net.PacketConn WriteTo method.
-func (c *UDPConn) WriteTo(b []byte, addr Addr) (n int, err os.Error) {
+func (c *UDPConn) WriteTo(b []byte, addr Addr) (n int, err error) {
if !c.ok() {
return 0, os.EINVAL
}
@@ -204,7 +204,7 @@
// DialUDP connects to the remote address raddr on the network net,
// which must be "udp", "udp4", or "udp6". If laddr is not nil, it is used
// as the local address for the connection.
-func DialUDP(net string, laddr, raddr *UDPAddr) (c *UDPConn, err os.Error) {
+func DialUDP(net string, laddr, raddr *UDPAddr) (c *UDPConn, err error) {
switch net {
case "udp", "udp4", "udp6":
default:
@@ -224,7 +224,7 @@
// local address laddr. The returned connection c's ReadFrom
// and WriteTo methods can be used to receive and send UDP
// packets with per-packet addressing.
-func ListenUDP(net string, laddr *UDPAddr) (c *UDPConn, err os.Error) {
+func ListenUDP(net string, laddr *UDPAddr) (c *UDPConn, err error) {
switch net {
case "udp", "udp4", "udp6":
default:
@@ -241,7 +241,7 @@
}
// BindToDevice binds a UDPConn to a network interface.
-func (c *UDPConn) BindToDevice(device string) os.Error {
+func (c *UDPConn) BindToDevice(device string) error {
if !c.ok() {
return os.EINVAL
}
@@ -253,12 +253,12 @@
// File returns a copy of the underlying os.File, set to blocking mode.
// It is the caller's responsibility to close f when finished.
// Closing c does not affect f, and closing f does not affect c.
-func (c *UDPConn) File() (f *os.File, err os.Error) { return c.fd.dup() }
+func (c *UDPConn) File() (f *os.File, err error) { return c.fd.dup() }
// JoinGroup joins the IP multicast group named by addr on ifi,
// which specifies the interface to join. JoinGroup uses the
// default multicast interface if ifi is nil.
-func (c *UDPConn) JoinGroup(ifi *Interface, addr IP) os.Error {
+func (c *UDPConn) JoinGroup(ifi *Interface, addr IP) error {
if !c.ok() {
return os.EINVAL
}
@@ -270,7 +270,7 @@
}
// LeaveGroup exits the IP multicast group named by addr on ifi.
-func (c *UDPConn) LeaveGroup(ifi *Interface, addr IP) os.Error {
+func (c *UDPConn) LeaveGroup(ifi *Interface, addr IP) error {
if !c.ok() {
return os.EINVAL
}
@@ -281,7 +281,7 @@
return leaveIPv6GroupUDP(c, ifi, addr)
}
-func joinIPv4GroupUDP(c *UDPConn, ifi *Interface, ip IP) os.Error {
+func joinIPv4GroupUDP(c *UDPConn, ifi *Interface, ip IP) error {
mreq := &syscall.IPMreq{Multiaddr: [4]byte{ip[0], ip[1], ip[2], ip[3]}}
if err := setIPv4InterfaceToJoin(mreq, ifi); err != nil {
return &OpError{"joinipv4group", "udp", &IPAddr{ip}, err}
@@ -292,7 +292,7 @@
return nil
}
-func leaveIPv4GroupUDP(c *UDPConn, ifi *Interface, ip IP) os.Error {
+func leaveIPv4GroupUDP(c *UDPConn, ifi *Interface, ip IP) error {
mreq := &syscall.IPMreq{Multiaddr: [4]byte{ip[0], ip[1], ip[2], ip[3]}}
if err := setIPv4InterfaceToJoin(mreq, ifi); err != nil {
return &OpError{"leaveipv4group", "udp", &IPAddr{ip}, err}
@@ -303,7 +303,7 @@
return nil
}
-func setIPv4InterfaceToJoin(mreq *syscall.IPMreq, ifi *Interface) os.Error {
+func setIPv4InterfaceToJoin(mreq *syscall.IPMreq, ifi *Interface) error {
if ifi == nil {
return nil
}
@@ -323,7 +323,7 @@
return nil
}
-func joinIPv6GroupUDP(c *UDPConn, ifi *Interface, ip IP) os.Error {
+func joinIPv6GroupUDP(c *UDPConn, ifi *Interface, ip IP) error {
mreq := &syscall.IPv6Mreq{}
copy(mreq.Multiaddr[:], ip)
if ifi != nil {
@@ -335,7 +335,7 @@
return nil
}
-func leaveIPv6GroupUDP(c *UDPConn, ifi *Interface, ip IP) os.Error {
+func leaveIPv6GroupUDP(c *UDPConn, ifi *Interface, ip IP) error {
mreq := &syscall.IPv6Mreq{}
copy(mreq.Multiaddr[:], ip)
if ifi != nil {