Skip to content

Commit 3f5288c

Browse files
committed
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
1 parent 0b07eff commit 3f5288c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/pkg/net/interface.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ package net
77
import "errors"
88

99
var (
10-
errInvalidInterface = errors.New("net: invalid interface")
11-
errInvalidInterfaceIndex = errors.New("net: invalid interface index")
12-
errInvalidInterfaceName = errors.New("net: invalid interface name")
13-
errNoSuchInterface = errors.New("net: no such interface")
14-
errNoSuchMulticastInterface = errors.New("net: no such multicast interface")
10+
errInvalidInterface = errors.New("invalid network interface")
11+
errInvalidInterfaceIndex = errors.New("invalid network interface index")
12+
errInvalidInterfaceName = errors.New("invalid network interface name")
13+
errNoSuchInterface = errors.New("no such network interface")
14+
errNoSuchMulticastInterface = errors.New("no such multicast network interface")
1515
)
1616

1717
// Interface represents a mapping between network interface name

src/pkg/net/ipsock_plan9.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ func parsePlan9Addr(s string) (ip IP, iport int, err error) {
6060
if i >= 0 {
6161
addr = ParseIP(s[:i])
6262
if addr == nil {
63-
return nil, 0, errors.New("net: parsing IP failed")
63+
return nil, 0, errors.New("parsing IP failed")
6464
}
6565
}
6666
p, _, ok := dtoi(s[i+1:], 0)
6767
if !ok {
68-
return nil, 0, errors.New("net: parsing port failed")
68+
return nil, 0, errors.New("parsing port failed")
6969
}
7070
if p < 0 || p > 0xFFFF {
7171
return nil, 0, &AddrError{"invalid port", string(p)}

src/pkg/net/lookup_plan9.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func queryCS1(net string, ip IP, port int) (clone, dest string, err error) {
6363
}
6464
f := getFields(lines[0])
6565
if len(f) < 2 {
66-
return "", "", errors.New("net: bad response from ndb/cs")
66+
return "", "", errors.New("bad response from ndb/cs")
6767
}
6868
clone, dest = f[0], f[1]
6969
return
@@ -199,7 +199,7 @@ func lookupCNAME(name string) (cname string, err error) {
199199
return f[2] + ".", nil
200200
}
201201
}
202-
return "", errors.New("net: bad response from ndb/dns")
202+
return "", errors.New("bad response from ndb/dns")
203203
}
204204

205205
func lookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) {

0 commit comments

Comments
 (0)