aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2015-02-17 15:44:42 -0800
committerJosh Bleecher Snyder <josharian@gmail.com>2015-03-18 15:14:06 +0000
commit2adc4e892704bb99f2d16c0c09777987cb6bed35 (patch)
tree4e61f69a0e448b82df4e1c7c8c621f397298e7b9 /src/net
parentfcb895feef1c9214f9cb633b5a0fa4dc8f46af9e (diff)
downloadgo-2adc4e892704bb99f2d16c0c09777987cb6bed35.tar.xz
all: use "reports whether" in place of "returns true if(f)"
Comment changes only. Change-Id: I56848814564c4aa0988b451df18bebdfc88d6d94 Reviewed-on: https://go-review.googlesource.com/7721 Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/http/server.go2
-rw-r--r--src/net/http/transport.go2
-rw-r--r--src/net/ip.go16
-rw-r--r--src/net/mail/message.go8
-rw-r--r--src/net/url/url.go2
5 files changed, 15 insertions, 15 deletions
diff --git a/src/net/http/server.go b/src/net/http/server.go
index c68aa2c985..565c87d392 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -981,7 +981,7 @@ func statusLine(req *Request, code int) string {
return line
}
-// bodyAllowed returns true if a Write is allowed for this response type.
+// bodyAllowed reports whether a Write is allowed for this response type.
// It's illegal to call this before the header has been flushed.
func (w *response) bodyAllowed() bool {
if !w.wroteHeader {
diff --git a/src/net/http/transport.go b/src/net/http/transport.go
index afeaa8da76..b18e445cbc 100644
--- a/src/net/http/transport.go
+++ b/src/net/http/transport.go
@@ -662,7 +662,7 @@ func (t *Transport) dialConn(cm connectMethod) (*persistConn, error) {
return pconn, nil
}
-// useProxy returns true if requests to addr should use a proxy,
+// useProxy reports whether requests to addr should use a proxy,
// according to the NO_PROXY or no_proxy environment variable.
// addr is always a canonicalAddr with a host and port.
func useProxy(addr string) bool {
diff --git a/src/net/ip.go b/src/net/ip.go
index f83658ccb9..a554165af7 100644
--- a/src/net/ip.go
+++ b/src/net/ip.go
@@ -108,7 +108,7 @@ var (
IPv6linklocalallrouters = IP{0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02}
)
-// IsUnspecified returns true if ip is an unspecified address.
+// IsUnspecified reports whether ip is an unspecified address.
func (ip IP) IsUnspecified() bool {
if ip.Equal(IPv4zero) || ip.Equal(IPv6unspecified) {
return true
@@ -116,7 +116,7 @@ func (ip IP) IsUnspecified() bool {
return false
}
-// IsLoopback returns true if ip is a loopback address.
+// IsLoopback reports whether ip is a loopback address.
func (ip IP) IsLoopback() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0] == 127 {
return true
@@ -124,7 +124,7 @@ func (ip IP) IsLoopback() bool {
return ip.Equal(IPv6loopback)
}
-// IsMulticast returns true if ip is a multicast address.
+// IsMulticast reports whether ip is a multicast address.
func (ip IP) IsMulticast() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0]&0xf0 == 0xe0 {
return true
@@ -132,13 +132,13 @@ func (ip IP) IsMulticast() bool {
return ip[0] == 0xff
}
-// IsInterfaceLocalMulticast returns true if ip is
+// IsInterfaceLocalMulticast reports whether ip is
// an interface-local multicast address.
func (ip IP) IsInterfaceLocalMulticast() bool {
return len(ip) == IPv6len && ip[0] == 0xff && ip[1]&0x0f == 0x01
}
-// IsLinkLocalMulticast returns true if ip is a link-local
+// IsLinkLocalMulticast reports whether ip is a link-local
// multicast address.
func (ip IP) IsLinkLocalMulticast() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0] == 224 && ip4[1] == 0 && ip4[2] == 0 {
@@ -147,7 +147,7 @@ func (ip IP) IsLinkLocalMulticast() bool {
return ip[0] == 0xff && ip[1]&0x0f == 0x02
}
-// IsLinkLocalUnicast returns true if ip is a link-local
+// IsLinkLocalUnicast reports whether ip is a link-local
// unicast address.
func (ip IP) IsLinkLocalUnicast() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0] == 169 && ip4[1] == 254 {
@@ -156,7 +156,7 @@ func (ip IP) IsLinkLocalUnicast() bool {
return ip[0] == 0xfe && ip[1]&0xc0 == 0x80
}
-// IsGlobalUnicast returns true if ip is a global unicast
+// IsGlobalUnicast reports whether ip is a global unicast
// address.
func (ip IP) IsGlobalUnicast() bool {
return !ip.IsUnspecified() &&
@@ -352,7 +352,7 @@ func (ip *IP) UnmarshalText(text []byte) error {
return nil
}
-// Equal returns true if ip and x are the same IP address.
+// Equal reports whether ip and x are the same IP address.
// An IPv4 address and that same address in IPv6 form are
// considered to be equal.
func (ip IP) Equal(x IP) bool {
diff --git a/src/net/mail/message.go b/src/net/mail/message.go
index 71fe74b9ca..f3f698cf23 100644
--- a/src/net/mail/message.go
+++ b/src/net/mail/message.go
@@ -428,7 +428,7 @@ var atextChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"0123456789" +
"!#$%&'*+-/=?^_`{|}~")
-// isAtext returns true if c is an RFC 5322 atext character.
+// isAtext reports whether c is an RFC 5322 atext character.
// If dot is true, period is included.
func isAtext(c byte, dot bool) bool {
if dot && c == '.' {
@@ -437,7 +437,7 @@ func isAtext(c byte, dot bool) bool {
return bytes.IndexByte(atextChars, c) >= 0
}
-// isQtext returns true if c is an RFC 5322 qtext character.
+// isQtext reports whether c is an RFC 5322 qtext character.
func isQtext(c byte) bool {
// Printable US-ASCII, excluding backslash or quote.
if c == '\\' || c == '"' {
@@ -446,13 +446,13 @@ func isQtext(c byte) bool {
return '!' <= c && c <= '~'
}
-// isVchar returns true if c is an RFC 5322 VCHAR character.
+// isVchar reports whether c is an RFC 5322 VCHAR character.
func isVchar(c byte) bool {
// Visible (printing) characters.
return '!' <= c && c <= '~'
}
-// isWSP returns true if c is a WSP (white space).
+// isWSP reports whether c is a WSP (white space).
// WSP is a space or horizontal tab (RFC5234 Appendix B).
func isWSP(c byte) bool {
return c == ' ' || c == '\t'
diff --git a/src/net/url/url.go b/src/net/url/url.go
index f167408fab..737c95bab9 100644
--- a/src/net/url/url.go
+++ b/src/net/url/url.go
@@ -639,7 +639,7 @@ func resolvePath(base, ref string) string {
return "/" + strings.TrimLeft(strings.Join(dst, "/"), "/")
}
-// IsAbs returns true if the URL is absolute.
+// IsAbs reports whether the URL is absolute.
func (u *URL) IsAbs() bool {
return u.Scheme != ""
}