1
0
mirror of https://github.com/golang/go synced 2024-11-13 17:30:24 -07:00

net: remove "net:" prefix from error messages

The prefix was not uniformly applied and is probably better
left off for using with OpError.

Update #4856

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/84660046
This commit is contained in:
Mikio Hara 2014-04-08 06:14:19 +09:00
parent 0b07effab1
commit 3f5288cb08
3 changed files with 9 additions and 9 deletions

View File

@ -7,11 +7,11 @@ package net
import "errors" import "errors"
var ( var (
errInvalidInterface = errors.New("net: invalid interface") errInvalidInterface = errors.New("invalid network interface")
errInvalidInterfaceIndex = errors.New("net: invalid interface index") errInvalidInterfaceIndex = errors.New("invalid network interface index")
errInvalidInterfaceName = errors.New("net: invalid interface name") errInvalidInterfaceName = errors.New("invalid network interface name")
errNoSuchInterface = errors.New("net: no such interface") errNoSuchInterface = errors.New("no such network interface")
errNoSuchMulticastInterface = errors.New("net: no such multicast interface") errNoSuchMulticastInterface = errors.New("no such multicast network interface")
) )
// Interface represents a mapping between network interface name // Interface represents a mapping between network interface name

View File

@ -60,12 +60,12 @@ func parsePlan9Addr(s string) (ip IP, iport int, err error) {
if i >= 0 { if i >= 0 {
addr = ParseIP(s[:i]) addr = ParseIP(s[:i])
if addr == nil { if addr == nil {
return nil, 0, errors.New("net: parsing IP failed") return nil, 0, errors.New("parsing IP failed")
} }
} }
p, _, ok := dtoi(s[i+1:], 0) p, _, ok := dtoi(s[i+1:], 0)
if !ok { if !ok {
return nil, 0, errors.New("net: parsing port failed") return nil, 0, errors.New("parsing port failed")
} }
if p < 0 || p > 0xFFFF { if p < 0 || p > 0xFFFF {
return nil, 0, &AddrError{"invalid port", string(p)} return nil, 0, &AddrError{"invalid port", string(p)}

View File

@ -63,7 +63,7 @@ func queryCS1(net string, ip IP, port int) (clone, dest string, err error) {
} }
f := getFields(lines[0]) f := getFields(lines[0])
if len(f) < 2 { if len(f) < 2 {
return "", "", errors.New("net: bad response from ndb/cs") return "", "", errors.New("bad response from ndb/cs")
} }
clone, dest = f[0], f[1] clone, dest = f[0], f[1]
return return
@ -199,7 +199,7 @@ func lookupCNAME(name string) (cname string, err error) {
return f[2] + ".", nil return f[2] + ".", nil
} }
} }
return "", errors.New("net: bad response from ndb/dns") return "", errors.New("bad response from ndb/dns")
} }
func lookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { func lookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) {