diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2016-03-01 23:21:55 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-03-02 00:13:47 +0000 |
| commit | 5fea2ccc77eb50a9704fa04b7c61755fe34e1d95 (patch) | |
| tree | 00137f90183ae2a01ca42249e04e9e4dabdf6249 /src/net | |
| parent | 8b4deb448e587802f67930b765c9598fc8cd36e5 (diff) | |
| download | go-5fea2ccc77eb50a9704fa04b7c61755fe34e1d95.tar.xz | |
all: single space after period.
The tree's pretty inconsistent about single space vs double space
after a period in documentation. Make it consistently a single space,
per earlier decisions. This means contributors won't be confused by
misleading precedence.
This CL doesn't use go/doc to parse. It only addresses // comments.
It was generated with:
$ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])')
$ go test go/doc -update
Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7
Reviewed-on: https://go-review.googlesource.com/20022
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dave Day <djd@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/net')
62 files changed, 228 insertions, 228 deletions
diff --git a/src/net/addrselect.go b/src/net/addrselect.go index 58ab7d706c..0b9d160fd4 100644 --- a/src/net/addrselect.go +++ b/src/net/addrselect.go @@ -203,7 +203,7 @@ func (s *byRFC6724) Less(i, j int) bool { // (e.g., https://golang.org/issue/13283). Glibc instead only // uses CommonPrefixLen for IPv4 when the source and destination // addresses are on the same subnet, but that requires extra - // work to find the netmask for our source addresses. As a + // work to find the netmask for our source addresses. As a // simpler heuristic, we limit its use to when the source and // destination belong to the same special purpose block. if da4 { diff --git a/src/net/conf.go b/src/net/conf.go index ddaa978f4f..36566a49e2 100644 --- a/src/net/conf.go +++ b/src/net/conf.go @@ -185,7 +185,7 @@ func (c *conf) hostLookupOrder(hostname string) (ret hostLookupOrder) { hostname = hostname[:len(hostname)-1] } if stringsHasSuffixFold(hostname, ".local") { - // Per RFC 6762, the ".local" TLD is special. And + // Per RFC 6762, the ".local" TLD is special. And // because Go's native resolver doesn't do mDNS or // similar local resolution mechanisms, assume that // libc might (via Avahi, etc) and use cgo. diff --git a/src/net/dial_test.go b/src/net/dial_test.go index 1df923f14b..0bcdbfc925 100644 --- a/src/net/dial_test.go +++ b/src/net/dial_test.go @@ -298,7 +298,7 @@ func TestDialParallel(t *testing.T) { const fallbackDelay = 200 * time.Millisecond // Some cases will run quickly when "connection refused" is fast, - // or trigger the fallbackDelay on Windows. This value holds the + // or trigger the fallbackDelay on Windows. This value holds the // lesser of the two delays. var closedPortOrFallbackDelay time.Duration if closedPortDelay < fallbackDelay { diff --git a/src/net/dnsclient.go b/src/net/dnsclient.go index 5094ac4f1b..f1835b8c06 100644 --- a/src/net/dnsclient.go +++ b/src/net/dnsclient.go @@ -45,7 +45,7 @@ func answer(name, server string, dns *dnsMsg, qtype uint16) (cname string, addrs } if dns.rcode != dnsRcodeSuccess { // None of the error codes make sense - // for the query we sent. If we didn't get + // for the query we sent. If we didn't get // a name error and we didn't get success, // the server is behaving incorrectly or // having temporary trouble. diff --git a/src/net/dnsconfig_unix.go b/src/net/dnsconfig_unix.go index 0515ca90de..181d47b36d 100644 --- a/src/net/dnsconfig_unix.go +++ b/src/net/dnsconfig_unix.go @@ -61,7 +61,7 @@ func dnsReadConfig(filename string) *dnsConfig { case "nameserver": // add one name server if len(f) > 1 && len(conf.servers) < 3 { // small, but the standard limit // One more check: make sure server name is - // just an IP address. Otherwise we need DNS + // just an IP address. Otherwise we need DNS // to look it up. if parseIPv4(f[1]) != nil { conf.servers = append(conf.servers, f[1]) diff --git a/src/net/dnsmsg.go b/src/net/dnsmsg.go index 5747fd232b..c01381f190 100644 --- a/src/net/dnsmsg.go +++ b/src/net/dnsmsg.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// DNS packet assembly. See RFC 1035. +// DNS packet assembly. See RFC 1035. // // This is intended to support name resolution during Dial. // It doesn't have to be blazing fast. @@ -18,7 +18,7 @@ // generic pack/unpack routines. // // TODO(rsc): There are enough names defined in this file that they're all -// prefixed with dns. Perhaps put this in its own package later. +// prefixed with dns. Perhaps put this in its own package later. package net @@ -376,7 +376,7 @@ func (rr *dnsRR_AAAA) Walk(f func(v interface{}, name, tag string) bool) bool { // All the packers and unpackers take a (msg []byte, off int) // and return (off1 int, ok bool). If they return ok==false, they // also return off1==len(msg), so that the next unpacker will -// also fail. This lets us avoid checks of ok until the end of a +// also fail. This lets us avoid checks of ok until the end of a // packing sequence. // Map of constructors for each RR wire type. @@ -399,7 +399,7 @@ var rr_mk = map[int]func() dnsRR{ // Pack a domain name s into msg[off:]. // Domain names are a sequence of counted strings -// split at the dots. They end with a zero-length string. +// split at the dots. They end with a zero-length string. func packDomainName(s string, msg []byte, off int) (off1 int, ok bool) { // Add trailing dot to canonicalize name. if n := len(s); n == 0 || s[n-1] != '.' { @@ -452,8 +452,8 @@ func packDomainName(s string, msg []byte, off int) (off1 int, ok bool) { // In addition to the simple sequences of counted strings above, // domain names are allowed to refer to strings elsewhere in the // packet, to avoid repeating common suffixes when returning -// many entries in a single domain. The pointers are marked -// by a length byte with the top two bits set. Ignoring those +// many entries in a single domain. The pointers are marked +// by a length byte with the top two bits set. Ignoring those // two bits, that byte and the next give a 14 bit offset from msg[0] // where we should pick up the trail. // Note that if we jump elsewhere in the packet, diff --git a/src/net/fd_unix.go b/src/net/fd_unix.go index 2639eab1c4..6c385dbef2 100644 --- a/src/net/fd_unix.go +++ b/src/net/fd_unix.go @@ -210,7 +210,7 @@ func (fd *netFD) Close() error { } // Unblock any I/O. Once it all unblocks and returns, // so that it cannot be referring to fd.sysfd anymore, - // the final decref will close fd.sysfd. This should happen + // the final decref will close fd.sysfd. This should happen // fairly quickly, since all the I/O is non-blocking, and any // attempts to block in the pollDesc will return errClosing. fd.pd.Evict() @@ -464,7 +464,7 @@ func dupCloseOnExec(fd int) (newfd int, err error) { // and fcntl there falls back (undocumented) // to doing an ioctl instead, returning EBADF // in this case because fd is not of the - // expected device fd type. Treat it as + // expected device fd type. Treat it as // EINVAL instead, so we fall back to the // normal dup path. // TODO: only do this on 10.6 if we can detect 10.6 diff --git a/src/net/http/cgi/host.go b/src/net/http/cgi/host.go index 9b4d875418..b2657b13a8 100644 --- a/src/net/http/cgi/host.go +++ b/src/net/http/cgi/host.go @@ -10,7 +10,7 @@ // // Note that using CGI means starting a new process to handle each // request, which is typically less efficient than using a -// long-running server. This package is intended primarily for +// long-running server. This package is intended primarily for // compatibility with existing systems. package cgi diff --git a/src/net/http/client.go b/src/net/http/client.go index 3106d229da..68676a5dc9 100644 --- a/src/net/http/client.go +++ b/src/net/http/client.go @@ -237,7 +237,7 @@ func send(ireq *Request, rt RoundTripper, deadline time.Time) (*Response, error) } // Most the callers of send (Get, Post, et al) don't need - // Headers, leaving it uninitialized. We guarantee to the + // Headers, leaving it uninitialized. We guarantee to the // Transport that this has been initialized, though. if req.Header == nil { forkReq() diff --git a/src/net/http/clientserver_test.go b/src/net/http/clientserver_test.go index fbaa805712..171060b541 100644 --- a/src/net/http/clientserver_test.go +++ b/src/net/http/clientserver_test.go @@ -356,7 +356,7 @@ func TestH12_HandlerWritesTooLittle(t *testing.T) { } // Tests that the HTTP/1 and HTTP/2 servers prevent handlers from -// writing more than they declared. This test does not test whether +// writing more than they declared. This test does not test whether // the transport deals with too much data, though, since the server // doesn't make it possible to send bogus data. For those tests, see // transport_test.go (for HTTP/1) or x/net/http2/transport_test.go diff --git a/src/net/http/filetransport.go b/src/net/http/filetransport.go index 821787e0c4..32126d7ec0 100644 --- a/src/net/http/filetransport.go +++ b/src/net/http/filetransport.go @@ -33,7 +33,7 @@ func NewFileTransport(fs FileSystem) RoundTripper { func (t fileTransport) RoundTrip(req *Request) (resp *Response, err error) { // We start ServeHTTP in a goroutine, which may take a long - // time if the file is large. The newPopulateResponseWriter + // time if the file is large. The newPopulateResponseWriter // call returns a channel which either ServeHTTP or finish() // sends our *Response on, once the *Response itself has been // populated (even if the body itself is still being diff --git a/src/net/http/fs.go b/src/net/http/fs.go index 520a5477a7..7e672a0910 100644 --- a/src/net/http/fs.go +++ b/src/net/http/fs.go @@ -96,7 +96,7 @@ func dirList(w ResponseWriter, f File) { } // ServeContent replies to the request using the content in the -// provided ReadSeeker. The main benefit of ServeContent over io.Copy +// provided ReadSeeker. The main benefit of ServeContent over io.Copy // is that it handles Range requests properly, sets the MIME type, and // handles If-Modified-Since requests. // @@ -108,7 +108,7 @@ func dirList(w ResponseWriter, f File) { // never sent in the response. // // If modtime is not the zero time or Unix epoch, ServeContent -// includes it in a Last-Modified header in the response. If the +// includes it in a Last-Modified header in the response. If the // request includes an If-Modified-Since header, ServeContent uses // modtime to decide whether the content needs to be sent at all. // @@ -196,7 +196,7 @@ func serveContent(w ResponseWriter, r *Request, name string, modtime time.Time, // The total number of bytes in all the ranges // is larger than the size of the file by // itself, so this is probably an attack, or a - // dumb client. Ignore the range request. + // dumb client. Ignore the range request. ranges = nil } switch { @@ -291,7 +291,7 @@ func checkLastModified(w ResponseWriter, r *Request, modtime time.Time) bool { // checkETag implements If-None-Match and If-Range checks. // // The ETag or modtime must have been previously set in the -// ResponseWriter's headers. The modtime is only compared at second +// ResponseWriter's headers. The modtime is only compared at second // granularity and may be the zero value to mean unknown. // // The return value is the effective request "Range" header to use and @@ -336,7 +336,7 @@ func checkETag(w ResponseWriter, r *Request, modtime time.Time) (rangeReq string } // TODO(bradfitz): deal with comma-separated or multiple-valued - // list of If-None-match values. For now just handle the common + // list of If-None-match values. For now just handle the common // case of a single item. if inm == etag || inm == "*" { h := w.Header() diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index f778acb2b5..1e9088c9c3 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -300,7 +300,7 @@ func http2registerHTTPSProtocol(t *Transport, rt RoundTripper) (err error) { } // noDialClientConnPool is an implementation of http2.ClientConnPool -// which never dials. We let the HTTP/1.1 client dial and use its TLS +// which never dials. We let the HTTP/1.1 client dial and use its TLS // connection instead. type http2noDialClientConnPool struct{ *http2clientConnPool } @@ -1421,7 +1421,7 @@ type http2PriorityParam struct { Exclusive bool // Weight is the stream's zero-indexed weight. It should be - // set together with StreamDep, or neither should be set. Per + // set together with StreamDep, or neither should be set. Per // the spec, "Add one to the value to obtain a weight between // 1 and 256." Weight uint8 @@ -2335,7 +2335,7 @@ type http2connectionStater interface { ConnectionState() tls.ConnectionState } -// pipe is a goroutine-safe io.Reader/io.Writer pair. It's like +// pipe is a goroutine-safe io.Reader/io.Writer pair. It's like // io.Pipe except there are no PipeReader/PipeWriter halves, and the // underlying buffer is an interface. (io.Pipe is always unbuffered) type http2pipe struct { @@ -4211,8 +4211,8 @@ func (b *http2requestBody) Read(p []byte) (n int, err error) { return } -// responseWriter is the http.ResponseWriter implementation. It's -// intentionally small (1 pointer wide) to minimize garbage. The +// responseWriter is the http.ResponseWriter implementation. It's +// intentionally small (1 pointer wide) to minimize garbage. The // responseWriterState pointer inside is zeroed at the end of a // request (in handlerDone) and calls on the responseWriter thereafter // simply crash (caller's mistake), but the much larger responseWriterState @@ -4386,7 +4386,7 @@ const http2TrailerPrefix = "Trailer:" // says you SHOULD (but not must) predeclare any trailers in the // header, the official ResponseWriter rules said trailers in Go must // be predeclared, and then we reuse the same ResponseWriter.Header() -// map to mean both Headers and Trailers. When it's time to write the +// map to mean both Headers and Trailers. When it's time to write the // Trailers, we pick out the fields of Headers that were declared as // trailers. That worked for a while, until we found the first major // user of Trailers in the wild: gRPC (using them only over http2), diff --git a/src/net/http/header.go b/src/net/http/header.go index 57f311fedc..6343165a84 100644 --- a/src/net/http/header.go +++ b/src/net/http/header.go @@ -25,7 +25,7 @@ func (h Header) Add(key, value string) { } // Set sets the header entries associated with key to -// the single element value. It replaces any existing +// the single element value. It replaces any existing // values associated with key. func (h Header) Set(key, value string) { textproto.MIMEHeader(h).Set(key, value) @@ -164,9 +164,9 @@ func (h Header) WriteSubset(w io.Writer, exclude map[string]bool) error { } // CanonicalHeaderKey returns the canonical format of the -// header key s. The canonicalization converts the first +// header key s. The canonicalization converts the first // letter and any letter following a hyphen to upper case; -// the rest are converted to lowercase. For example, the +// the rest are converted to lowercase. For example, the // canonical key for "accept-encoding" is "Accept-Encoding". // If s contains a space or invalid header field bytes, it is // returned without modifications. @@ -186,7 +186,7 @@ func hasToken(v, token string) bool { for sp := 0; sp <= len(v)-len(token); sp++ { // Check that first character is good. // The token is ASCII, so checking only a single byte - // is sufficient. We skip this potential starting + // is sufficient. We skip this potential starting // position if both the first byte and its potential // ASCII uppercase equivalent (b|0x20) don't match. // False positives ('^' => '~') are caught by EqualFold. diff --git a/src/net/http/httptest/server.go b/src/net/http/httptest/server.go index 7e52adb607..8655426eaf 100644 --- a/src/net/http/httptest/server.go +++ b/src/net/http/httptest/server.go @@ -158,7 +158,7 @@ func (s *Server) Close() { // previously-flaky tests) in the case of // socket-late-binding races from the http Client // dialing this server and then getting an idle - // connection before the dial completed. There is thus + // connection before the dial completed. There is thus // a connected connection in StateNew with no // associated Request. We only close StateIdle and // StateNew because they're not doing anything. It's @@ -297,7 +297,7 @@ func (s *Server) closeConn(c net.Conn) { s.closeConnChan(c, nil) } func (s *Server) closeConnChan(c net.Conn, done chan<- bool) { if runtime.GOOS == "plan9" { // Go's Plan 9 net package isn't great at unblocking reads when - // their underlying TCP connections are closed. Don't trust + // their underlying TCP connections are closed. Don't trust // that that the ConnState state machine will get to // StateClosed. Instead, just go there directly. Plan 9 may leak // resources if the syscall doesn't end up returning. Oh well. diff --git a/src/net/http/httputil/dump.go b/src/net/http/httputil/dump.go index 245eed0b21..3af5395898 100644 --- a/src/net/http/httputil/dump.go +++ b/src/net/http/httputil/dump.go @@ -128,7 +128,7 @@ func DumpRequestOut(req *http.Request, body bool) ([]byte, error) { // If we used a dummy body above, remove it now. // TODO: if the req.ContentLength is large, we allocate memory - // unnecessarily just to slice it off here. But this is just + // unnecessarily just to slice it off here. But this is just // a debug function, so this is acceptable for now. We could // discard the body earlier if this matters. if dummyBody { @@ -269,7 +269,7 @@ func DumpRequest(req *http.Request, body bool) (dump []byte, err error) { var errNoBody = errors.New("sentinel error value") // failureToReadBody is a io.ReadCloser that just returns errNoBody on -// Read. It's swapped in when we don't actually want to consume +// Read. It's swapped in when we don't actually want to consume // the body, but need a non-nil one, and want to distinguish the // error from reading the dummy body. type failureToReadBody struct{} diff --git a/src/net/http/httputil/persist.go b/src/net/http/httputil/persist.go index 987bcc96ba..4cb110b716 100644 --- a/src/net/http/httputil/persist.go +++ b/src/net/http/httputil/persist.go @@ -239,7 +239,7 @@ type ClientConn struct { writeReq func(*http.Request, io.Writer) error } -// NewClientConn returns a new ClientConn reading and writing c. If r is not +// NewClientConn returns a new ClientConn reading and writing c. If r is not // nil, it is the buffer to use when reading c. // // ClientConn is low-level and old. Applications should use Client or diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go index 54411caeca..26a668b6df 100644 --- a/src/net/http/httputil/reverseproxy.go +++ b/src/net/http/httputil/reverseproxy.go @@ -180,9 +180,9 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { outreq.ProtoMinor = 1 outreq.Close = false - // Remove hop-by-hop headers to the backend. Especially + // Remove hop-by-hop headers to the backend. Especially // important is "Connection" because we want a persistent - // connection, regardless of what the client sent to us. This + // connection, regardless of what the client sent to us. This // is modifying the same underlying map from req (shallow // copied above) so we only copy it if necessary. copiedHeaders := false diff --git a/src/net/http/pprof/pprof.go b/src/net/http/pprof/pprof.go index 3400dbbdc6..2357d8ed1e 100644 --- a/src/net/http/pprof/pprof.go +++ b/src/net/http/pprof/pprof.go @@ -15,7 +15,7 @@ // import _ "net/http/pprof" // // If your application is not already running an http server, you -// need to start one. Add "net/http" and "log" to your imports and +// need to start one. Add "net/http" and "log" to your imports and // the following code to your main function: // // go func() { @@ -146,11 +146,11 @@ func Symbol(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain; charset=utf-8") // We have to read the whole POST body before - // writing any output. Buffer the output here. + // writing any output. Buffer the output here. var buf bytes.Buffer // We don't know how many symbols we have, but we - // do have symbol information. Pprof only cares whether + // do have symbol information. Pprof only cares whether // this number is 0 (no symbols available) or > 0. fmt.Fprintf(&buf, "num_symbols: 1\n") diff --git a/src/net/http/request.go b/src/net/http/request.go index 4037f40a3e..76fb8fe6d1 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -279,8 +279,8 @@ func (r *Request) Cookie(name string) (*Cookie, error) { return nil, ErrNoCookie } -// AddCookie adds a cookie to the request. Per RFC 6265 section 5.4, -// AddCookie does not attach more than one Cookie header field. That +// AddCookie adds a cookie to the request. Per RFC 6265 section 5.4, +// AddCookie does not attach more than one Cookie header field. That // means all cookies, if any, are written into the same line, // separated by semicolon. func (r *Request) AddCookie(c *Cookie) { @@ -375,7 +375,7 @@ func (r *Request) Write(w io.Writer) error { } // WriteProxy is like Write but writes the request in the form -// expected by an HTTP proxy. In particular, WriteProxy writes the +// expected by an HTTP proxy. In particular, WriteProxy writes the // initial Request-URI line of the request with an absolute URI, per // section 5.1.2 of RFC 2616, including the scheme and host. // In either case, WriteProxy also writes a Host header, using @@ -776,7 +776,7 @@ func readRequest(b *bufio.Reader, deleteHostHeader bool) (req *Request, err erro // and // GET http://www.google.com/index.html HTTP/1.1 // Host: doesntmatter - // the same. In the second case, any Host line is ignored. + // the same. In the second case, any Host line is ignored. req.Host = req.URL.Host if req.Host == "" { req.Host = req.Header.get("Host") diff --git a/src/net/http/requestwrite_test.go b/src/net/http/requestwrite_test.go index 671cca91a6..2545f6f4c2 100644 --- a/src/net/http/requestwrite_test.go +++ b/src/net/http/requestwrite_test.go @@ -604,7 +604,7 @@ func TestRequestWriteError(t *testing.T) { failAfter, writeCount := 0, 0 errFail := errors.New("fake write failure") - // w is the buffered io.Writer to write the request to. It + // w is the buffered io.Writer to write the request to. It // fails exactly once on its Nth Write call, as controlled by // failAfter. It also tracks the number of calls in // writeCount. diff --git a/src/net/http/response.go b/src/net/http/response.go index c424f61cd0..a596d1d342 100644 --- a/src/net/http/response.go +++ b/src/net/http/response.go @@ -33,7 +33,7 @@ type Response struct { ProtoMajor int // e.g. 1 ProtoMinor int // e.g. 0 - // Header maps header keys to values. If the response had multiple + // Header maps header keys to values. If the response had multiple // headers with the same key, they may be concatenated, with comma // delimiters. (Section 4.2 of RFC 2616 requires that multiple headers // be semantically equivalent to a comma-delimited sequence.) Values @@ -57,8 +57,8 @@ type Response struct { // with a "chunked" Transfer-Encoding. Body io.ReadCloser - // ContentLength records the length of the associated content. The - // value -1 indicates that the length is unknown. Unless Request.Method + // ContentLength records the length of the associated content. The + // value -1 indicates that the length is unknown. Unless Request.Method // is "HEAD", values >= 0 indicate that the given number of bytes may // be read from Body. ContentLength int64 @@ -68,7 +68,7 @@ type Response struct { TransferEncoding []string // Close records whether the header directed that the connection be - // closed after reading Body. The value is advice for clients: neither + // closed after reading Body. The value is advice for clients: neither // ReadResponse nor Response.Write ever closes a connection. Close bool @@ -108,8 +108,8 @@ func (r *Response) Cookies() []*Cookie { var ErrNoLocation = errors.New("http: no Location header in response") // Location returns the URL of the response's "Location" header, -// if present. Relative redirects are resolved relative to -// the Response's Request. ErrNoLocation is returned if no +// if present. Relative redirects are resolved relative to +// the Response's Request. ErrNoLocation is returned if no // Location header is present. func (r *Response) Location() (*url.URL, error) { lv := r.Header.Get("Location") diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index 384b453ce0..250e18644c 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -617,7 +617,7 @@ func TestIdentityResponse(t *testing.T) { defer ts.Close() // Note: this relies on the assumption (which is true) that - // Get sends HTTP/1.1 or greater requests. Otherwise the + // Get sends HTTP/1.1 or greater requests. Otherwise the // server wouldn't have the choice to send back chunked // responses. for _, te := range []string{"", "identity"} { @@ -984,7 +984,7 @@ func TestTLSServer(t *testing.T) { defer ts.Close() // Connect an idle TCP connection to this server before we run - // our real tests. This idle connection used to block forever + // our real tests. This idle connection used to block forever // in the TLS handshake, preventing future connections from // being accepted. It may prevent future accidental blocking // in newConn. @@ -2027,7 +2027,7 @@ func TestHandlerPanicWithHijack(t *testing.T) { func testHandlerPanic(t *testing.T, withHijack, h2 bool, panicValue interface{}) { defer afterTest(t) // Unlike the other tests that set the log output to ioutil.Discard - // to quiet the output, this test uses a pipe. The pipe serves three + // to quiet the output, this test uses a pipe. The pipe serves three // purposes: // // 1) The log.Print from the http server (generated by the caught @@ -2060,7 +2060,7 @@ func testHandlerPanic(t *testing.T, withHijack, h2 bool, panicValue interface{}) defer cst.close() // Do a blocking read on the log output pipe so its logging - // doesn't bleed into the next test. But wait only 5 seconds + // doesn't bleed into the next test. But wait only 5 seconds // for it. done := make(chan bool, 1) go func() { @@ -2205,10 +2205,10 @@ func testRequestBodyLimit(t *testing.T, h2 bool) { nWritten := new(int64) req, _ := NewRequest("POST", cst.ts.URL, io.LimitReader(countReader{neverEnding('a'), nWritten}, limit*200)) - // Send the POST, but don't care it succeeds or not. The + // Send the POST, but don't care it succeeds or not. The // remote side is going to reply and then close the TCP // connection, and HTTP doesn't really define if that's - // allowed or not. Some HTTP clients will get the response + // allowed or not. Some HTTP clients will get the response // and some (like ours, currently) will complain that the // request write failed, without reading the response. // @@ -2650,7 +2650,7 @@ func TestOptions(t *testing.T) { } // Tests regarding the ordering of Write, WriteHeader, Header, and -// Flush calls. In Go 1.0, rw.WriteHeader immediately flushed the +// Flush calls. In Go 1.0, rw.WriteHeader immediately flushed the // (*response).header to the wire. In Go 1.1, the actual wire flush is // delayed, so we could maybe tack on a Content-Length and better // Content-Type after we see more (or all) of the output. To preserve @@ -3107,7 +3107,7 @@ func testTransportAndServerSharedBodyRace(t *testing.T, h2 bool) { const bodySize = 1 << 20 - // errorf is like t.Errorf, but also writes to println. When + // errorf is like t.Errorf, but also writes to println. When // this test fails, it hangs. This helps debugging and I've // added this enough times "temporarily". It now gets added // full time. diff --git a/src/net/http/server.go b/src/net/http/server.go index 773dd59c6b..7a27a4157c 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// HTTP server. See RFC 2616. +// HTTP server. See RFC 2616. package http @@ -74,7 +74,7 @@ type ResponseWriter interface { // Write writes the data to the connection as part of an HTTP reply. // If WriteHeader has not yet been called, Write calls WriteHeader(http.StatusOK) - // before writing the data. If the Header does not contain a + // before writing the data. If the Header does not contain a // Content-Type line, Write adds a Content-Type set to the result of passing // the initial 512 bytes of written data to DetectContentType. Write([]byte) (int, error) @@ -342,7 +342,7 @@ type response struct { requestBodyLimitHit bool // trailers are the headers to be sent after the handler - // finishes writing the body. This field is initialized from + // finishes writing the body. This field is initialized from // the Trailer response header when the response header is // written. trailers []string @@ -766,7 +766,7 @@ func (w *response) Header() Header { // maxPostHandlerReadBytes is the max number of Request.Body bytes not // consumed by a handler that the server will read from the client -// in order to keep a connection alive. If there are more bytes than +// in order to keep a connection alive. If there are more bytes than // this then the server to be paranoid instead sends a "Connection: // close" response. // @@ -855,8 +855,8 @@ func (h extraHeader) Write(w *bufio.Writer) { // to cw.res.conn.bufw. // // p is not written by writeHeader, but is the first chunk of the body -// that will be written. It is sniffed for a Content-Type if none is -// set explicitly. It's also used to set the Content-Length, if the +// that will be written. It is sniffed for a Content-Type if none is +// set explicitly. It's also used to set the Content-Length, if the // total body size was small and the handler has already finished // running. func (cw *chunkWriter) writeHeader(p []byte) { @@ -911,9 +911,9 @@ func (cw *chunkWriter) writeHeader(p []byte) { // Exceptions: 304/204/1xx responses never get Content-Length, and if // it was a HEAD request, we don't know the difference between // 0 actual bytes and 0 bytes because the handler noticed it - // was a HEAD request and chose not to write anything. So for + // was a HEAD request and chose not to write anything. So for // HEAD, the handler should either write the Content-Length or - // write non-zero bytes. If it's actually 0 bytes and the + // write non-zero bytes. If it's actually 0 bytes and the // handler never looked at the Request.Method, we just don't // send a Content-Length header. // Further, we don't send an automatic Content-Length if they @@ -965,7 +965,7 @@ func (cw *chunkWriter) writeHeader(p []byte) { } // Per RFC 2616, we should consume the request body before - // replying, if the handler hasn't already done so. But we + // replying, if the handler hasn't already done so. But we // don't want to do an unbounded amount of reading here for // DoS reasons, so we only try up to a threshold. if w.req.ContentLength != 0 && !w.closeAfterReply { @@ -1174,7 +1174,7 @@ func (w *response) bodyAllowed() bool { // The Life Of A Write is like this: // // Handler starts. No header has been sent. The handler can either -// write a header, or just start writing. Writing before sending a header +// write a header, or just start writing. Writing before sending a header // sends an implicitly empty 200 OK header. // // If the handler didn't declare a Content-Length up front, we either @@ -1200,7 +1200,7 @@ func (w *response) bodyAllowed() bool { // initial header contains both a Content-Type and Content-Length. // Also short-circuit in (1) when the header's been sent and not in // chunking mode, writing directly to (4) instead, if (2) has no -// buffered data. More generally, we could short-circuit from (1) to +// buffered data. More generally, we could short-circuit from (1) to // (3) even in chunking mode if the write size from (1) is over some // threshold and nothing is in (2). The answer might be mostly making // bufferBeforeChunkingSize smaller and having bufio's fast-paths deal @@ -1341,7 +1341,7 @@ type closeWriter interface { var _ closeWriter = (*net.TCPConn)(nil) // closeWrite flushes any outstanding data and sends a FIN packet (if -// client is connected via TCP), signalling that we're done. We then +// client is connected via TCP), signalling that we're done. We then // pause for a bit, hoping the client processes it before any // subsequent RST. // @@ -1355,7 +1355,7 @@ func (c *conn) closeWriteAndWait() { } // validNPN reports whether the proto is not a blacklisted Next -// Protocol Negotiation protocol. Empty and built-in protocol types +// Protocol Negotiation protocol. Empty and built-in protocol types // are blacklisted and can't be overridden with alternate // implementations. func validNPN(proto string) bool { @@ -1433,7 +1433,7 @@ func (c *conn) serve() { // able to read this if we're // responding to them and hanging up // while they're still writing their - // request. Undefined behavior. + // request. Undefined behavior. io.WriteString(c.rwc, "HTTP/1.1 431 Request Header Fields Too Large\r\nContent-Type: text/plain\r\nConnection: close\r\n\r\n431 Request Header Fields Too Large") c.closeWriteAndWait() return @@ -1467,7 +1467,7 @@ func (c *conn) serve() { // HTTP cannot have multiple simultaneous active requests.[*] // Until the server replies to this request, it can't read another, // so we might as well run the handler in this goroutine. - // [*] Not strictly true: HTTP pipelining. We could let them all process + // [*] Not strictly true: HTTP pipelining. We could let them all process // in parallel even if their responses need to be serialized. serverHandler{c.server}.ServeHTTP(w, w.req) if c.hijacked() { @@ -1488,7 +1488,7 @@ func (w *response) sendExpectationFailed() { // TODO(bradfitz): let ServeHTTP handlers handle // requests with non-standard expectation[s]? Seems // theoretical at best, and doesn't fit into the - // current ServeHTTP model anyway. We'd need to + // current ServeHTTP model anyway. We'd need to // make the ResponseWriter an optional // "ExpectReplier" interface or something. // @@ -1608,7 +1608,7 @@ func requestBodyRemains(rc io.ReadCloser) bool { } // The HandlerFunc type is an adapter to allow the use of -// ordinary functions as HTTP handlers. If f is a function +// ordinary functions as HTTP handlers. If f is a function // with the appropriate signature, HandlerFunc(f) is a // Handler that calls f. type HandlerFunc func(ResponseWriter, *Request) @@ -1779,7 +1779,7 @@ func RedirectHandler(url string, code int) Handler { // been registered separately. // // Patterns may optionally begin with a host name, restricting matches to -// URLs on that host only. Host-specific patterns take precedence over +// URLs on that host only. Host-specific patterns take precedence over // general patterns, so that a handler might register for the two patterns // "/codesearch" and "codesearch.google.com/" without also taking over // requests for "http://www.google.com/". @@ -1968,7 +1968,7 @@ func HandleFunc(pattern string, handler func(ResponseWriter, *Request)) { } // Serve accepts incoming HTTP connections on the listener l, -// creating a new service goroutine for each. The service goroutines +// creating a new service goroutine for each. The service goroutines // read requests and then call handler to reply to them. // Handler is typically nil, in which case the DefaultServeMux is used. func Serve(l net.Listener, handler Handler) error { @@ -1988,10 +1988,10 @@ type Server struct { // TLSNextProto optionally specifies a function to take over // ownership of the provided TLS connection when an NPN - // protocol upgrade has occurred. The map key is the protocol + // protocol upgrade has occurred. The map key is the protocol // name negotiated. The Handler argument should be used to // handle HTTP requests and will initialize the Request's TLS - // and RemoteAddr if not already set. The connection is + // and RemoteAddr if not already set. The connection is // automatically closed when the function returns. // If TLSNextProto is nil, HTTP/2 support is enabled automatically. TLSNextProto map[string]func(*Server, *tls.Conn, Handler) @@ -2330,7 +2330,7 @@ type timeoutHandler struct { body string // timeout returns the channel of a *time.Timer and - // cancelTimer cancels it. They're stored separately for + // cancelTimer cancels it. They're stored separately for // testing purposes. timeout func() <-chan time.Time // returns channel producing a timeout cancelTimer func() bool // optional diff --git a/src/net/http/sniff.go b/src/net/http/sniff.go index 44f83db020..54986b9956 100644 --- a/src/net/http/sniff.go +++ b/src/net/http/sniff.go @@ -14,8 +14,8 @@ const sniffLen = 512 // DetectContentType implements the algorithm described // at http://mimesniff.spec.whatwg.org/ to determine the -// Content-Type of the given data. It considers at most the -// first 512 bytes of data. DetectContentType always returns +// Content-Type of the given data. It considers at most the +// first 512 bytes of data. DetectContentType always returns // a valid MIME type: if it cannot determine a more specific one, it // returns "application/octet-stream". func DetectContentType(data []byte) string { diff --git a/src/net/http/transfer.go b/src/net/http/transfer.go index 7ff4953a14..4c130f0cc4 100644 --- a/src/net/http/transfer.go +++ b/src/net/http/transfer.go @@ -276,7 +276,7 @@ func (t *transferReader) protoAtLeast(m, n int) bool { } // bodyAllowedForStatus reports whether a given response status code -// permits a body. See RFC2616, section 4.4. +// permits a body. See RFC2616, section 4.4. func bodyAllowedForStatus(status int) bool { switch { case status >= 100 && status <= 199: @@ -379,7 +379,7 @@ func readTransfer(msg interface{}, r *bufio.Reader) (err error) { } } - // Prepare body reader. ContentLength < 0 means chunked encoding + // Prepare body reader. ContentLength < 0 means chunked encoding // or close connection when finished, since multipart is not supported yet switch { case chunked(t.TransferEncoding): @@ -727,11 +727,11 @@ func (b *body) readTrailer() error { } // Make sure there's a header terminator coming up, to prevent - // a DoS with an unbounded size Trailer. It's not easy to + // a DoS with an unbounded size Trailer. It's not easy to // slip in a LimitReader here, as textproto.NewReader requires - // a concrete *bufio.Reader. Also, we can't get all the way + // a concrete *bufio.Reader. Also, we can't get all the way // back up to our conn's LimitedReader that *might* be backing - // this bufio.Reader. Instead, a hack: we iteratively Peek up + // this bufio.Reader. Instead, a hack: we iteratively Peek up // to the bufio.Reader's max size, looking for a double CRLF. // This limits the trailer to the underlying buffer size, typically 4kB. if !seeUpcomingDoubleCRLF(b.r) { diff --git a/src/net/http/transport.go b/src/net/http/transport.go index f622f6f983..163e1bd2b9 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -118,7 +118,7 @@ type Transport struct { DisableCompression bool // MaxIdleConnsPerHost, if non-zero, controls the maximum idle - // (keep-alive) to keep per-host. If zero, + // (keep-alive) to keep per-host. If zero, // DefaultMaxIdleConnsPerHost is used. MaxIdleConnsPerHost int @@ -137,7 +137,7 @@ type Transport struct { // TLSNextProto specifies how the Transport switches to an // alternate protocol (such as HTTP/2) after a TLS NPN/ALPN - // protocol negotiation. If Transport dials an TLS connection + // protocol negotiation. If Transport dials an TLS connection // with a non-empty protocol name and TLSNextProto contains a // map entry for that key (such as "h2"), then the func is // called with the request's authority (such as "example.com" @@ -306,7 +306,7 @@ func (t *Transport) RoundTrip(req *Request) (*Response, error) { // Get the cached or newly-created connection to either the // host (for http or https), the http proxy, or the http proxy - // pre-CONNECTed to https server. In any case, we'll be ready + // pre-CONNECTed to https server. In any case, we'll be ready // to send it requests. pconn, err := t.getConn(req, cm) if err != nil { @@ -541,7 +541,7 @@ func (t *Transport) tryPutIdleConn(pconn *persistConn) error { // We're done with this pconn and somebody else is // currently waiting for a conn of this type (they're // actively dialing, but this conn is ready - // first). Chrome calls this socket late binding. See + // first). Chrome calls this socket late binding. See // https://insouciant.org/tech/connection-management-in-chromium/ t.idleMu.Unlock() return nil @@ -666,7 +666,7 @@ func (t *Transport) dial(network, addr string) (net.Conn, error) { } // getConn dials and creates a new persistConn to the target as -// specified in the connectMethod. This includes doing a proxy CONNECT +// specified in the connectMethod. This includes doing a proxy CONNECT // and/or setting up TLS. If this doesn't return an error, the persistConn // is ready to write requests to. func (t *Transport) getConn(req *Request, cm connectMethod) (*persistConn, error) { @@ -1558,7 +1558,7 @@ func (pc *persistConn) closeLocked(err error) { // handlePendingDial's putOrCloseIdleConn when // it turns out the abandoned connection in // flight ended up negotiating an alternate - // protocol. We don't use the connection + // protocol. We don't use the connection // freelist for http2. That's done by the // alternate protocol's RoundTripper. } else { diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go index e8a4623556..9f17017651 100644 --- a/src/net/http/transport_test.go +++ b/src/net/http/transport_test.go @@ -478,7 +478,7 @@ func TestTransportServerClosingUnexpectedly(t *testing.T) { // This test has an expected race. Sleeping for 25 ms prevents // it on most fast machines, causing the next fetch() call to - // succeed quickly. But if we do get errors, fetch() will retry 5 + // succeed quickly. But if we do get errors, fetch() will retry 5 // times with some delays between. time.Sleep(25 * time.Millisecond) @@ -518,7 +518,7 @@ func TestStressSurpriseServerCloses(t *testing.T) { // after each request completes, regardless of whether it failed. // If these are too high, OS X exhausts its ephemeral ports // and hangs waiting for them to transition TCP states. That's - // not what we want to test. TODO(bradfitz): use an io.Pipe + // not what we want to test. TODO(bradfitz): use an io.Pipe // dialer for this test instead? const ( numClients = 20 @@ -1026,7 +1026,7 @@ func TestTransportPersistConnLeak(t *testing.T) { growth := nfinal - n0 - // We expect 0 or 1 extra goroutine, empirically. Allow up to 5. + // We expect 0 or 1 extra goroutine, empirically. Allow up to 5. // Previously we were leaking one per numReq. if int(growth) > 5 { t.Logf("goroutine growth: %d -> %d -> %d (delta: %d)", n0, nhigh, nfinal, growth) @@ -1067,7 +1067,7 @@ func TestTransportPersistConnLeakShortBody(t *testing.T) { growth := nfinal - n0 - // We expect 0 or 1 extra goroutine, empirically. Allow up to 5. + // We expect 0 or 1 extra goroutine, empirically. Allow up to 5. // Previously we were leaking one per numReq. t.Logf("goroutine growth: %d -> %d -> %d (delta: %d)", n0, nhigh, nfinal, growth) if int(growth) > 5 { @@ -1103,8 +1103,8 @@ func TestTransportIdleConnCrash(t *testing.T) { } // Test that the transport doesn't close the TCP connection early, -// before the response body has been read. This was a regression -// which sadly lacked a triggering test. The large response body made +// before the response body has been read. This was a regression +// which sadly lacked a triggering test. The large response body made // the old race easier to trigger. func TestIssue3644(t *testing.T) { defer afterTest(t) @@ -1199,7 +1199,7 @@ func TestTransportConcurrency(t *testing.T) { // Due to the Transport's "socket late binding" (see // idleConnCh in transport.go), the numReqs HTTP requests - // below can finish with a dial still outstanding. To keep + // below can finish with a dial still outstanding. To keep // the leak checker happy, keep track of pending dials and // wait for them to finish (and be closed or returned to the // idle pool) before we close idle connections. @@ -2273,7 +2273,7 @@ func TestTLSServerClosesConnection(t *testing.T) { } // byteFromChanReader is an io.Reader that reads a single byte at a -// time from the channel. When the channel is closed, the reader +// time from the channel. When the channel is closed, the reader // returns io.EOF. type byteFromChanReader chan byte @@ -2405,7 +2405,7 @@ func (plan9SleepReader) Read(p []byte) (int, error) { // After the fix to unblock TCP Reads in // https://golang.org/cl/15941, this sleep is required // on plan9 to make sure TCP Writes before an - // immediate TCP close go out on the wire. On Plan 9, + // immediate TCP close go out on the wire. On Plan 9, // it seems that a hangup of a TCP connection with // queued data doesn't send the queued data first. // https://golang.org/issue/9554 @@ -2424,7 +2424,7 @@ func (f closerFunc) Close() error { return f() } // from (or finish writing to) the socket. // // NOTE: we resend a request only if the request is idempotent, we reused a -// keep-alive connection, and we haven't yet received any header data. This +// keep-alive connection, and we haven't yet received any header data. This // automatically prevents an infinite resend loop because we'll run out of the // cached keep-alive connections eventually. func TestRetryIdempotentRequestsOnError(t *testing.T) { diff --git a/src/net/interface.go b/src/net/interface.go index 64a284c157..c99f8fd216 100644 --- a/src/net/interface.go +++ b/src/net/interface.go @@ -15,7 +15,7 @@ var ( ) // Interface represents a mapping between network interface name -// and index. It also represents network interface facility +// and index. It also represents network interface facility // information. type Interface struct { Index int // positive integer that starts at one, zero is never used diff --git a/src/net/interface_bsd.go b/src/net/interface_bsd.go index 4525388c95..b173fbcefc 100644 --- a/src/net/interface_bsd.go +++ b/src/net/interface_bsd.go @@ -13,7 +13,7 @@ import ( ) // If the ifindex is zero, interfaceTable returns mappings of all -// network interfaces. Otherwise it returns a mapping of a specific +// network interfaces. Otherwise it returns a mapping of a specific // interface. func interfaceTable(ifindex int) ([]Interface, error) { tab, err := syscall.RouteRIB(syscall.NET_RT_IFLIST, ifindex) @@ -95,7 +95,7 @@ func linkFlags(rawFlags int32) Flags { } // If the ifi is nil, interfaceAddrTable returns addresses for all -// network interfaces. Otherwise it returns addresses for a specific +// network interfaces. Otherwise it returns addresses for a specific // interface. func interfaceAddrTable(ifi *Interface) ([]Addr, error) { index := 0 diff --git a/src/net/interface_linux.go b/src/net/interface_linux.go index 55beca5895..5e391b28b0 100644 --- a/src/net/interface_linux.go +++ b/src/net/interface_linux.go @@ -11,7 +11,7 @@ import ( ) // If the ifindex is zero, interfaceTable returns mappings of all -// network interfaces. Otherwise it returns a mapping of a specific +// network interfaces. Otherwise it returns a mapping of a specific // interface. func interfaceTable(ifindex int) ([]Interface, error) { tab, err := syscall.NetlinkRIB(syscall.RTM_GETLINK, syscall.AF_UNSPEC) @@ -115,7 +115,7 @@ func linkFlags(rawFlags uint32) Flags { } // If the ifi is nil, interfaceAddrTable returns addresses for all -// network interfaces. Otherwise it returns addresses for a specific +// network interfaces. Otherwise it returns addresses for a specific // interface. func interfaceAddrTable(ifi *Interface) ([]Addr, error) { tab, err := syscall.NetlinkRIB(syscall.RTM_GETADDR, syscall.AF_UNSPEC) diff --git a/src/net/interface_stub.go b/src/net/interface_stub.go index d1e30f7e95..f64174c62e 100644 --- a/src/net/interface_stub.go +++ b/src/net/interface_stub.go @@ -7,14 +7,14 @@ package net // If the ifindex is zero, interfaceTable returns mappings of all -// network interfaces. Otherwise it returns a mapping of a specific +// network interfaces. Otherwise it returns a mapping of a specific // interface. func interfaceTable(ifindex int) ([]Interface, error) { return nil, nil } // If the ifi is nil, interfaceAddrTable returns addresses for all -// network interfaces. Otherwise it returns addresses for a specific +// network interfaces. Otherwise it returns addresses for a specific // interface. func interfaceAddrTable(ifi *Interface) ([]Addr, error) { return nil, nil diff --git a/src/net/interface_test.go b/src/net/interface_test.go index 56c3e919a8..1487acf601 100644 --- a/src/net/interface_test.go +++ b/src/net/interface_test.go @@ -11,7 +11,7 @@ import ( ) // loopbackInterface returns an available logical network interface -// for loopback tests. It returns nil if no suitable interface is +// for loopback tests. It returns nil if no suitable interface is // found. func loopbackInterface() *Interface { ift, err := Interfaces() diff --git a/src/net/interface_windows.go b/src/net/interface_windows.go index 78bf375b6d..8b976e585f 100644 --- a/src/net/interface_windows.go +++ b/src/net/interface_windows.go @@ -61,7 +61,7 @@ func adapterAddresses() ([]*windows.IpAdapterAddresses, error) { } // If the ifindex is zero, interfaceTable returns mappings of all -// network interfaces. Otherwise it returns a mapping of a specific +// network interfaces. Otherwise it returns a mapping of a specific // interface. func interfaceTable(ifindex int) ([]Interface, error) { aas, err := adapterAddresses() @@ -116,7 +116,7 @@ func interfaceTable(ifindex int) ([]Interface, error) { } // If the ifi is nil, interfaceAddrTable returns addresses for all -// network interfaces. Otherwise it returns addresses for a specific +// network interfaces. Otherwise it returns addresses for a specific // interface. func interfaceAddrTable(ifi *Interface) ([]Addr, error) { aas, err := adapterAddresses() diff --git a/src/net/ip.go b/src/net/ip.go index cc004d6072..a25729cfc9 100644 --- a/src/net/ip.go +++ b/src/net/ip.go @@ -653,7 +653,7 @@ func ParseIP(s string) IP { // RFC 4632 and RFC 4291. // // It returns the IP address and the network implied by the IP -// and mask. For example, ParseCIDR("192.168.100.1/16") returns +// and mask. For example, ParseCIDR("192.168.100.1/16") returns // the IP address 192.168.100.1 and the network 192.168.0.0/16. func ParseCIDR(s string) (IP, *IPNet, error) { i := byteIndex(s, '/') diff --git a/src/net/iprawsock_plan9.go b/src/net/iprawsock_plan9.go index e872eafe6b..6fb3893529 100644 --- a/src/net/iprawsock_plan9.go +++ b/src/net/iprawsock_plan9.go @@ -32,7 +32,7 @@ func (c *IPConn) ReadFrom(b []byte) (int, Addr, error) { } // ReadMsgIP reads a packet from c, copying the payload into b and the -// associated out-of-band data into oob. It returns the number of +// associated out-of-band data into oob. It returns the number of // bytes copied into b, the number of bytes copied into oob, the flags // that were set on the packet and the source address of the packet. func (c *IPConn) ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *IPAddr, err error) { @@ -44,7 +44,7 @@ func (c *IPConn) ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *IPAddr, err // // WriteToIP can be made to time out and return an error with // Timeout() == true after a fixed time limit; see SetDeadline and -// SetWriteDeadline. On packet-oriented connections, write timeouts +// SetWriteDeadline. On packet-oriented connections, write timeouts // are rare. func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error) { return 0, &OpError{Op: "write", Net: c.fd.dir, Source: c.fd.laddr, Addr: addr.opAddr(), Err: syscall.EPLAN9} @@ -56,7 +56,7 @@ func (c *IPConn) WriteTo(b []byte, addr Addr) (int, error) { } // WriteMsgIP writes a packet to addr via c, copying the payload from -// b and the associated out-of-band data from oob. It returns the +// b and the associated out-of-band data from oob. It returns the // number of payload and out-of-band bytes written. func (c *IPConn) WriteMsgIP(b, oob []byte, addr *IPAddr) (n, oobn int, err error) { return 0, 0, &OpError{Op: "write", Net: c.fd.dir, Source: c.fd.laddr, Addr: addr.opAddr(), Err: syscall.EPLAN9} @@ -74,7 +74,7 @@ func dialIP(netProto string, laddr, raddr *IPAddr, deadline time.Time) (*IPConn, } // ListenIP listens for incoming IP packets addressed to the local -// address laddr. The returned connection's ReadFrom and WriteTo +// address laddr. The returned connection's ReadFrom and WriteTo // methods can be used to receive and send IP packets with per-packet // addressing. func ListenIP(netProto string, laddr *IPAddr) (*IPConn, error) { diff --git a/src/net/iprawsock_posix.go b/src/net/iprawsock_posix.go index 449660db4e..7364bfe455 100644 --- a/src/net/iprawsock_posix.go +++ b/src/net/iprawsock_posix.go @@ -114,7 +114,7 @@ func (c *IPConn) ReadFrom(b []byte) (int, Addr, error) { } // ReadMsgIP reads a packet from c, copying the payload into b and the -// associated out-of-band data into oob. It returns the number of +// associated out-of-band data into oob. It returns the number of // bytes copied into b, the number of bytes copied into oob, the flags // that were set on the packet and the source address of the packet. func (c *IPConn) ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *IPAddr, err error) { @@ -140,7 +140,7 @@ func (c *IPConn) ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *IPAddr, err // // WriteToIP can be made to time out and return an error with // Timeout() == true after a fixed time limit; see SetDeadline and -// SetWriteDeadline. On packet-oriented connections, write timeouts +// SetWriteDeadline. On packet-oriented connections, write timeouts // are rare. func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error) { if !c.ok() { @@ -176,7 +176,7 @@ func (c *IPConn) WriteTo(b []byte, addr Addr) (int, error) { } // WriteMsgIP writes a packet to addr via c, copying the payload from -// b and the associated out-of-band data from oob. It returns the +// b and the associated out-of-band data from oob. It returns the // number of payload and out-of-band bytes written. func (c *IPConn) WriteMsgIP(b, oob []byte, addr *IPAddr) (n, oobn int, err error) { if !c.ok() { @@ -228,7 +228,7 @@ func dialIP(netProto string, laddr, raddr *IPAddr, deadline time.Time) (*IPConn, } // ListenIP listens for incoming IP packets addressed to the local -// address laddr. The returned connection's ReadFrom and WriteTo +// address laddr. The returned connection's ReadFrom and WriteTo // methods can be used to receive and send IP packets with per-packet // addressing. func ListenIP(netProto string, laddr *IPAddr) (*IPConn, error) { diff --git a/src/net/ipsock.go b/src/net/ipsock.go index cfa9e88464..d6a6785e06 100644 --- a/src/net/ipsock.go +++ b/src/net/ipsock.go @@ -22,7 +22,7 @@ var ( // supportsIPv4map reports whether the platform supports // mapping an IPv4 address inside an IPv6 address at transport - // layer protocols. See RFC 4291, RFC 4038 and RFC 3493. + // layer protocols. See RFC 4291, RFC 4038 and RFC 3493. supportsIPv4map bool ) @@ -106,7 +106,7 @@ func ipv6only(addr IPAddr) bool { // SplitHostPort splits a network address of the form "host:port", // "[host]:port" or "[ipv6-host%zone]:port" into host or -// ipv6-host%zone and port. A literal address or host name for IPv6 +// ipv6-host%zone and port. A literal address or host name for IPv6 // must be enclosed in square brackets, as in "[::1]:80", // "[ipv6-host]:http" or "[ipv6-host%zone]:80". func SplitHostPort(hostport string) (host, port string, err error) { diff --git a/src/net/ipsock_plan9.go b/src/net/ipsock_plan9.go index 4812146c5c..53a122ac8c 100644 --- a/src/net/ipsock_plan9.go +++ b/src/net/ipsock_plan9.go @@ -39,8 +39,8 @@ func probeIPv4Stack() bool { return probe(netdir+"/iproute", "4i") } -// probeIPv6Stack returns two boolean values. If the first boolean -// value is true, kernel supports basic IPv6 functionality. If the +// probeIPv6Stack returns two boolean values. If the first boolean +// value is true, kernel supports basic IPv6 functionality. If the // second boolean value is true, kernel supports IPv6 IPv4-mapping. func probeIPv6Stack() (supportsIPv6, supportsIPv4map bool) { // Plan 9 uses IPv6 natively, see ip(3). diff --git a/src/net/ipsock_posix.go b/src/net/ipsock_posix.go index 331985f33f..a42ca9c3e8 100644 --- a/src/net/ipsock_posix.go +++ b/src/net/ipsock_posix.go @@ -35,15 +35,15 @@ func probeIPv4Stack() bool { // Should we try to use the IPv4 socket interface if we're // only dealing with IPv4 sockets? As long as the host system // understands IPv6, it's okay to pass IPv4 addresses to the IPv6 -// interface. That simplifies our code and is most general. +// interface. That simplifies our code and is most general. // Unfortunately, we need to run on kernels built without IPv6 -// support too. So probe the kernel to figure it out. +// support too. So probe the kernel to figure it out. // // probeIPv6Stack probes both basic IPv6 capability and IPv6 IPv4- // mapping capability which is controlled by IPV6_V6ONLY socket // option and/or kernel state "net.inet6.ip6.v6only". -// It returns two boolean values. If the first boolean value is -// true, kernel supports basic IPv6 functionality. If the second +// It returns two boolean values. If the first boolean value is +// true, kernel supports basic IPv6 functionality. If the second // boolean value is true, kernel supports IPv6 IPv4-mapping. func probeIPv6Stack() (supportsIPv6, supportsIPv4map bool) { var probes = []struct { @@ -93,8 +93,8 @@ func probeIPv6Stack() (supportsIPv6, supportsIPv4map bool) { } // favoriteAddrFamily returns the appropriate address family to -// the given net, laddr, raddr and mode. At first it figures -// address family out from the net. If mode indicates "listen" +// the given net, laddr, raddr and mode. At first it figures +// address family out from the net. If mode indicates "listen" // and laddr is a wildcard, it assumes that the user wants to // make a passive connection with a wildcard address family, both // AF_INET and AF_INET6, and a wildcard address like following: @@ -182,7 +182,7 @@ func ipToSockaddr(family int, ip IP, port int, zone string) (syscall.Sockaddr, e } // IPv4 callers use 0.0.0.0 to mean "announce on any available address". // In IPv6 mode, Linux treats that as meaning "announce on 0.0.0.0", - // which it refuses to do. Rewrite to the IPv6 unspecified address. + // which it refuses to do. Rewrite to the IPv6 unspecified address. if ip.Equal(IPv4zero) { ip = IPv6zero } diff --git a/src/net/lookup.go b/src/net/lookup.go index 0770b6e31d..ab6886ddff 100644 --- a/src/net/lookup.go +++ b/src/net/lookup.go @@ -92,7 +92,7 @@ func lookupIPDeadline(host string, deadline time.Time) (addrs []IPAddr, err erro } // We could push the deadline down into the name resolution - // functions. However, the most commonly used implementation + // functions. However, the most commonly used implementation // calls getaddrinfo, which has no timeout. timeout := deadline.Sub(time.Now()) @@ -108,10 +108,10 @@ func lookupIPDeadline(host string, deadline time.Time) (addrs []IPAddr, err erro select { case <-t.C: - // The DNS lookup timed out for some reason. Force + // The DNS lookup timed out for some reason. Force // future requests to start the DNS lookup again // rather than waiting for the current lookup to - // complete. See issue 8602. + // complete. See issue 8602. lookupGroup.Forget(host) return nil, errTimeout @@ -150,12 +150,12 @@ func LookupCNAME(name string) (cname string, err error) { } // LookupSRV tries to resolve an SRV query of the given service, -// protocol, and domain name. The proto is "tcp" or "udp". +// protocol, and domain name. The proto is "tcp" or "udp". // The returned records are sorted by priority and randomized // by weight within a priority. // // LookupSRV constructs the DNS name to look up following RFC 2782. -// That is, it looks up _service._proto.name. To accommodate services +// That is, it looks up _service._proto.name. To accommodate services // publishing SRV records under non-standard names, if both service // and proto are empty strings, LookupSRV looks up name directly. func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { diff --git a/src/net/net.go b/src/net/net.go index d9d23fae8f..2ff1a34981 100644 --- a/src/net/net.go +++ b/src/net/net.go @@ -297,7 +297,7 @@ func (c *conn) File() (f *os.File, err error) { // Multiple goroutines may invoke methods on a PacketConn simultaneously. type PacketConn interface { // ReadFrom reads a packet from the connection, - // copying the payload into b. It returns the number of + // copying the payload into b. It returns the number of // bytes copied into b and the return address that // was on the packet. // ReadFrom can be made to time out and return diff --git a/src/net/rpc/client.go b/src/net/rpc/client.go index d0c4a69214..862fb1ae0c 100644 --- a/src/net/rpc/client.go +++ b/src/net/rpc/client.go @@ -55,7 +55,7 @@ type Client struct { // reading of RPC responses for the client side of an RPC session. // The client calls WriteRequest to write a request to the connection // and calls ReadResponseHeader and ReadResponseBody in pairs -// to read responses. The client calls Close when finished with the +// to read responses. The client calls Close when finished with the // connection. ReadResponseBody may be called with a nil // argument to force the body of the response to be read and then // discarded. @@ -173,7 +173,7 @@ func (call *Call) done() { case call.Done <- call: // ok default: - // We don't want to block here. It is the caller's responsibility to make + // We don't want to block here. It is the caller's responsibility to make // sure the channel has enough buffer space. See comment in Go(). if debugLog { log.Println("rpc: discarding Call reply due to insufficient Done chan capacity") @@ -285,9 +285,9 @@ func (client *Client) Close() error { return client.codec.Close() } -// Go invokes the function asynchronously. It returns the Call structure representing -// the invocation. The done channel will signal when the call is complete by returning -// the same Call object. If done is nil, Go will allocate a new channel. +// Go invokes the function asynchronously. It returns the Call structure representing +// the invocation. The done channel will signal when the call is complete by returning +// the same Call object. If done is nil, Go will allocate a new channel. // If non-nil, done must be buffered or Go will deliberately crash. func (client *Client) Go(serviceMethod string, args interface{}, reply interface{}, done chan *Call) *Call { call := new(Call) @@ -299,7 +299,7 @@ func (client *Client) Go(serviceMethod string, args interface{}, reply interface } else { // If caller passes done != nil, it must arrange that // done has enough buffer for the number of simultaneous - // RPCs that will be using that channel. If the channel + // RPCs that will be using that channel. If the channel // is totally unbuffered, it's best not to run at all. if cap(done) == 0 { log.Panic("rpc: done channel is unbuffered") diff --git a/src/net/rpc/jsonrpc/server.go b/src/net/rpc/jsonrpc/server.go index 820b4ab9f5..40e4e6f2aa 100644 --- a/src/net/rpc/jsonrpc/server.go +++ b/src/net/rpc/jsonrpc/server.go @@ -110,7 +110,7 @@ func (c *serverCodec) WriteResponse(r *rpc.Response, x interface{}) error { c.mutex.Unlock() if b == nil { - // Invalid request so no id. Use JSON null. + // Invalid request so no id. Use JSON null. b = &null } resp := serverResponse{Id: b} diff --git a/src/net/rpc/server.go b/src/net/rpc/server.go index c4d4479958..cff32413a3 100644 --- a/src/net/rpc/server.go +++ b/src/net/rpc/server.go @@ -143,8 +143,8 @@ const ( DefaultDebugPath = "/debug/rpc" ) -// Precompute the reflect type for error. Can't use error directly -// because Typeof takes an empty interface value. This is annoying. +// Precompute the reflect type for error. Can't use error directly +// because Typeof takes an empty interface value. This is annoying. var typeOfError = reflect.TypeOf((*error)(nil)).Elem() type methodType struct { @@ -162,7 +162,7 @@ type service struct { method map[string]*methodType // registered methods } -// Request is a header written before every RPC call. It is used internally +// Request is a header written before every RPC call. It is used internally // but documented here as an aid to debugging, such as when analyzing // network traffic. type Request struct { @@ -171,7 +171,7 @@ type Request struct { next *Request // for free list in Server } -// Response is a header written before every RPC return. It is used internally +// Response is a header written before every RPC return. It is used internally // but documented here as an aid to debugging, such as when analyzing // network traffic. type Response struct { @@ -442,7 +442,7 @@ func (c *gobServerCodec) Close() error { // ServeConn blocks, serving the connection until the client hangs up. // The caller typically invokes ServeConn in a go statement. // ServeConn uses the gob wire format (see package gob) on the -// connection. To use an alternate codec, use ServeCodec. +// connection. To use an alternate codec, use ServeCodec. func (server *Server) ServeConn(conn io.ReadWriteCloser) { buf := bufio.NewWriter(conn) srv := &gobServerCodec{ @@ -583,7 +583,7 @@ func (server *Server) readRequestHeader(codec ServerCodec) (service *service, mt return } - // We read the header successfully. If we see an error now, + // We read the header successfully. If we see an error now, // we can still recover and move on to the next request. keepReading = true @@ -638,7 +638,7 @@ func RegisterName(name string, rcvr interface{}) error { // RPC responses for the server side of an RPC session. // The server calls ReadRequestHeader and ReadRequestBody in pairs // to read requests from the connection, and it calls WriteResponse to -// write a response back. The server calls Close when finished with the +// write a response back. The server calls Close when finished with the // connection. ReadRequestBody may be called with a nil // argument to force the body of the request to be read and discarded. type ServerCodec interface { @@ -654,7 +654,7 @@ type ServerCodec interface { // ServeConn blocks, serving the connection until the client hangs up. // The caller typically invokes ServeConn in a go statement. // ServeConn uses the gob wire format (see package gob) on the -// connection. To use an alternate codec, use ServeCodec. +// connection. To use an alternate codec, use ServeCodec. func ServeConn(conn io.ReadWriteCloser) { DefaultServer.ServeConn(conn) } diff --git a/src/net/smtp/smtp.go b/src/net/smtp/smtp.go index 0988350322..b4e4867a9e 100644 --- a/src/net/smtp/smtp.go +++ b/src/net/smtp/smtp.go @@ -83,8 +83,8 @@ func (c *Client) hello() error { // Hello sends a HELO or EHLO to the server as the given host name. // Calling this method is only necessary if the client needs control -// over the host name used. The client will introduce itself as "localhost" -// automatically otherwise. If Hello is called, it must be called before +// over the host name used. The client will introduce itself as "localhost" +// automatically otherwise. If Hello is called, it must be called before // any of the other methods. func (c *Client) Hello(localName string) error { if c.didHello { @@ -265,7 +265,7 @@ func (d *dataCloser) Close() error { // Data issues a DATA command to the server and returns a writer that // can be used to write the mail headers and body. The caller should -// close the writer before calling any more methods on c. A call to +// close the writer before calling any more methods on c. A call to // Data must be preceded by one or more calls to Rcpt. func (c *Client) Data() (io.WriteCloser, error) { _, _, err := c.cmd(354, "DATA") @@ -287,7 +287,7 @@ var testHookStartTLS func(*tls.Config) // nil, except for tests // // The msg parameter should be an RFC 822-style email with headers // first, a blank line, and then the message body. The lines of msg -// should be CRLF terminated. The msg headers should usually include +// should be CRLF terminated. The msg headers should usually include // fields such as "From", "To", "Subject", and "Cc". Sending "Bcc" // messages is accomplished by including an email address in the to // parameter but not including it in the msg headers. diff --git a/src/net/sockopt_bsd.go b/src/net/sockopt_bsd.go index 2eae146ae2..567e4e1b7c 100644 --- a/src/net/sockopt_bsd.go +++ b/src/net/sockopt_bsd.go @@ -27,7 +27,7 @@ func setDefaultSockopts(s, family, sotype int, ipv6only bool) error { } if supportsIPv4map && family == syscall.AF_INET6 && sotype != syscall.SOCK_RAW { // Allow both IP versions even if the OS default - // is otherwise. Note that some operating systems + // is otherwise. Note that some operating systems // never admit this option. syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY, boolint(ipv6only)) } diff --git a/src/net/sockopt_linux.go b/src/net/sockopt_linux.go index 147c263bcf..0f70b12407 100644 --- a/src/net/sockopt_linux.go +++ b/src/net/sockopt_linux.go @@ -12,7 +12,7 @@ import ( func setDefaultSockopts(s, family, sotype int, ipv6only bool) error { if family == syscall.AF_INET6 && sotype != syscall.SOCK_RAW { // Allow both IP versions even if the OS default - // is otherwise. Note that some operating systems + // is otherwise. Note that some operating systems // never admit this option. syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY, boolint(ipv6only)) } diff --git a/src/net/sockopt_solaris.go b/src/net/sockopt_solaris.go index 147c263bcf..0f70b12407 100644 --- a/src/net/sockopt_solaris.go +++ b/src/net/sockopt_solaris.go @@ -12,7 +12,7 @@ import ( func setDefaultSockopts(s, family, sotype int, ipv6only bool) error { if family == syscall.AF_INET6 && sotype != syscall.SOCK_RAW { // Allow both IP versions even if the OS default - // is otherwise. Note that some operating systems + // is otherwise. Note that some operating systems // never admit this option. syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY, boolint(ipv6only)) } diff --git a/src/net/sockopt_windows.go b/src/net/sockopt_windows.go index ff51626ac1..8017426521 100644 --- a/src/net/sockopt_windows.go +++ b/src/net/sockopt_windows.go @@ -12,7 +12,7 @@ import ( func setDefaultSockopts(s syscall.Handle, family, sotype int, ipv6only bool) error { if family == syscall.AF_INET6 && sotype != syscall.SOCK_RAW { // Allow both IP versions even if the OS default - // is otherwise. Note that some operating systems + // is otherwise. Note that some operating systems // never admit this option. syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY, boolint(ipv6only)) } diff --git a/src/net/tcpsock_plan9.go b/src/net/tcpsock_plan9.go index 0eb40699fa..c25c05150e 100644 --- a/src/net/tcpsock_plan9.go +++ b/src/net/tcpsock_plan9.go @@ -130,7 +130,7 @@ func dialTCP(net string, laddr, raddr *TCPAddr, deadline time.Time, cancel <-cha return newTCPConn(fd), nil } -// TCPListener is a TCP network listener. Clients should typically +// TCPListener is a TCP network listener. Clients should typically // use variables of type Listener instead of assuming TCP. type TCPListener struct { fd *netFD @@ -197,11 +197,11 @@ func (l *TCPListener) SetDeadline(t time.Time) error { } // File returns a copy of the underlying os.File, set to blocking -// mode. It is the caller's responsibility to close f when finished. +// mode. It is the caller's responsibility to close f when finished. // Closing l does not affect f, and closing f does not affect l. // // The returned os.File's file descriptor is different from the -// connection's. Attempting to change properties of the original +// connection's. Attempting to change properties of the original // using this duplicate may or may not have the desired effect. func (l *TCPListener) File() (f *os.File, err error) { f, err = l.dup() @@ -212,8 +212,8 @@ func (l *TCPListener) File() (f *os.File, err error) { } // ListenTCP announces on the TCP address laddr and returns a TCP -// listener. Net must be "tcp", "tcp4", or "tcp6". If laddr has a -// port of 0, ListenTCP will choose an available port. The caller can +// listener. Net must be "tcp", "tcp4", or "tcp6". If laddr has a +// port of 0, ListenTCP will choose an available port. The caller can // use the Addr method of TCPListener to retrieve the chosen address. func ListenTCP(net string, laddr *TCPAddr) (*TCPListener, error) { switch net { diff --git a/src/net/tcpsock_posix.go b/src/net/tcpsock_posix.go index 261c0be030..ecbe00fb34 100644 --- a/src/net/tcpsock_posix.go +++ b/src/net/tcpsock_posix.go @@ -173,18 +173,18 @@ func dialTCP(net string, laddr, raddr *TCPAddr, deadline time.Time, cancel <-cha // TCP has a rarely used mechanism called a 'simultaneous connection' in // which Dial("tcp", addr1, addr2) run on the machine at addr1 can // connect to a simultaneous Dial("tcp", addr2, addr1) run on the machine - // at addr2, without either machine executing Listen. If laddr == nil, + // at addr2, without either machine executing Listen. If laddr == nil, // it means we want the kernel to pick an appropriate originating local - // address. Some Linux kernels cycle blindly through a fixed range of - // local ports, regardless of destination port. If a kernel happens to + // address. Some Linux kernels cycle blindly through a fixed range of + // local ports, regardless of destination port. If a kernel happens to // pick local port 50001 as the source for a Dial("tcp", "", "localhost:50001"), // then the Dial will succeed, having simultaneously connected to itself. // This can only happen when we are letting the kernel pick a port (laddr == nil) // and when there is no listener for the destination address. - // It's hard to argue this is anything other than a kernel bug. If we + // It's hard to argue this is anything other than a kernel bug. If we // see this happen, rather than expose the buggy effect to users, we - // close the fd and try again. If it happens twice more, we relent and - // use the result. See also: + // close the fd and try again. If it happens twice more, we relent and + // use the result. See also: // https://golang.org/issue/2690 // http://stackoverflow.com/questions/4949858/ // @@ -239,7 +239,7 @@ func spuriousENOTAVAIL(err error) bool { return err == syscall.EADDRNOTAVAIL } -// TCPListener is a TCP network listener. Clients should typically +// TCPListener is a TCP network listener. Clients should typically // use variables of type Listener instead of assuming TCP. type TCPListener struct { fd *netFD @@ -299,11 +299,11 @@ func (l *TCPListener) SetDeadline(t time.Time) error { } // File returns a copy of the underlying os.File, set to blocking -// mode. It is the caller's responsibility to close f when finished. +// mode. It is the caller's responsibility to close f when finished. // Closing l does not affect f, and closing f does not affect l. // // The returned os.File's file descriptor is different from the -// connection's. Attempting to change properties of the original +// connection's. Attempting to change properties of the original // using this duplicate may or may not have the desired effect. func (l *TCPListener) File() (f *os.File, err error) { f, err = l.fd.dup() @@ -314,8 +314,8 @@ func (l *TCPListener) File() (f *os.File, err error) { } // ListenTCP announces on the TCP address laddr and returns a TCP -// listener. Net must be "tcp", "tcp4", or "tcp6". If laddr has a -// port of 0, ListenTCP will choose an available port. The caller can +// listener. Net must be "tcp", "tcp4", or "tcp6". If laddr has a +// port of 0, ListenTCP will choose an available port. The caller can // use the Addr method of TCPListener to retrieve the chosen address. func ListenTCP(net string, laddr *TCPAddr) (*TCPListener, error) { switch net { diff --git a/src/net/textproto/header.go b/src/net/textproto/header.go index d482eea8e5..2e2752a755 100644 --- a/src/net/textproto/header.go +++ b/src/net/textproto/header.go @@ -16,7 +16,7 @@ func (h MIMEHeader) Add(key, value string) { } // Set sets the header entries associated with key to -// the single element value. It replaces any existing +// the single element value. It replaces any existing // values associated with key. func (h MIMEHeader) Set(key, value string) { h[CanonicalMIMEHeaderKey(key)] = []string{value} @@ -24,7 +24,7 @@ func (h MIMEHeader) Set(key, value string) { // Get gets the first value associated with the given key. // If there are no values associated with the key, Get returns "". -// Get is a convenience method. For more complex queries, +// Get is a convenience method. For more complex queries, // access the map directly. func (h MIMEHeader) Get(key string) string { if h == nil { diff --git a/src/net/textproto/pipeline.go b/src/net/textproto/pipeline.go index af0e3d8369..2e283218b5 100644 --- a/src/net/textproto/pipeline.go +++ b/src/net/textproto/pipeline.go @@ -66,8 +66,8 @@ func (p *Pipeline) EndResponse(id uint) { } // A sequencer schedules a sequence of numbered events that must -// happen in order, one after the other. The event numbering must start -// at 0 and increment without skipping. The event number wraps around +// happen in order, one after the other. The event numbering must start +// at 0 and increment without skipping. The event number wraps around // safely as long as there are not 2^32 simultaneous events pending. type sequencer struct { mu sync.Mutex diff --git a/src/net/textproto/reader.go b/src/net/textproto/reader.go index 37221cf3ad..e07d1d62e0 100644 --- a/src/net/textproto/reader.go +++ b/src/net/textproto/reader.go @@ -71,7 +71,7 @@ func (r *Reader) readLineSlice() ([]byte, error) { // ReadContinuedLine reads a possibly continued line from r, // eliding the final trailing ASCII white space. // Lines after the first are considered continuations if they -// begin with a space or tab character. In the returned data, +// begin with a space or tab character. In the returned data, // continuation lines are separated from the previous line // only by a single space: the newline and leading white space // are removed. @@ -204,7 +204,7 @@ func parseCodeLine(line string, expectCode int) (code int, continued bool, messa // ReadCodeLine reads a response code line of the form // code message // where code is a three-digit status code and the message -// extends to the rest of the line. An example of such a line is: +// extends to the rest of the line. An example of such a line is: // 220 plan9.bell-labs.com ESMTP // // If the prefix of the status does not match the digits in expectCode, @@ -366,7 +366,7 @@ func (d *dotReader) Read(b []byte) (n int, err error) { d.state = stateBeginLine break } - // Not part of \r\n. Emit saved \r + // Not part of \r\n. Emit saved \r br.UnreadByte() c = '\r' d.state = stateData @@ -552,9 +552,9 @@ func (r *Reader) upcomingHeaderNewlines() (n int) { } // CanonicalMIMEHeaderKey returns the canonical format of the -// MIME header key s. The canonicalization converts the first +// MIME header key s. The canonicalization converts the first // letter and any letter following a hyphen to upper case; -// the rest are converted to lowercase. For example, the +// the rest are converted to lowercase. For example, the // canonical key for "accept-encoding" is "Accept-Encoding". // MIME header keys are assumed to be ASCII only. // If s contains a space or invalid header field bytes, it is diff --git a/src/net/textproto/textproto.go b/src/net/textproto/textproto.go index ed8a955375..8fd781e777 100644 --- a/src/net/textproto/textproto.go +++ b/src/net/textproto/textproto.go @@ -87,7 +87,7 @@ func Dial(network, addr string) (*Conn, error) { } // Cmd is a convenience method that sends a command after -// waiting its turn in the pipeline. The command text is the +// waiting its turn in the pipeline. The command text is the // result of formatting format with args and appending \r\n. // Cmd returns the id of the command, for use with StartResponse and EndResponse. // diff --git a/src/net/textproto/writer.go b/src/net/textproto/writer.go index 56c490c283..1bc5974c6c 100644 --- a/src/net/textproto/writer.go +++ b/src/net/textproto/writer.go @@ -36,7 +36,7 @@ func (w *Writer) PrintfLine(format string, args ...interface{}) error { // DotWriter returns a writer that can be used to write a dot-encoding to w. // It takes care of inserting leading dots when necessary, // translating line-ending \n into \r\n, and adding the final .\r\n line -// when the DotWriter is closed. The caller should close the +// when the DotWriter is closed. The caller should close the // DotWriter before the next call to a method on w. // // See the documentation for Reader's DotReader method for details about dot-encoding. diff --git a/src/net/udpsock_plan9.go b/src/net/udpsock_plan9.go index 88a80ad148..4bc3be7656 100644 --- a/src/net/udpsock_plan9.go +++ b/src/net/udpsock_plan9.go @@ -54,7 +54,7 @@ func (c *UDPConn) ReadFrom(b []byte) (int, Addr, error) { } // ReadMsgUDP reads a packet from c, copying the payload into b and -// the associated out-of-band data into oob. It returns the number +// the associated out-of-band data into oob. It returns the number // of bytes copied into b, the number of bytes copied into oob, the // flags that were set on the packet and the source address of the // packet. @@ -67,7 +67,7 @@ func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *UDPAddr, // // WriteToUDP can be made to time out and return an error with // Timeout() == true after a fixed time limit; see SetDeadline and -// SetWriteDeadline. On packet-oriented connections, write timeouts +// SetWriteDeadline. On packet-oriented connections, write timeouts // are rare. func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (int, error) { if !c.ok() || c.fd.data == nil { @@ -107,7 +107,7 @@ func (c *UDPConn) WriteTo(b []byte, addr Addr) (int, error) { // WriteMsgUDP writes a packet to addr via c if c isn't connected, or // to c's remote destination address if c is connected (in which case // addr must be nil). The payload is copied from b and the associated -// out-of-band data is copied from oob. It returns the number of +// out-of-band data is copied from oob. It returns the number of // payload and out-of-band bytes written. func (c *UDPConn) WriteMsgUDP(b, oob []byte, addr *UDPAddr) (n, oobn int, err error) { return 0, 0, &OpError{Op: "write", Net: c.fd.dir, Source: c.fd.laddr, Addr: addr.opAddr(), Err: syscall.EPLAN9} @@ -168,10 +168,10 @@ func unmarshalUDPHeader(b []byte) (*udpHeader, []byte) { } // ListenUDP listens for incoming UDP packets addressed to the local -// address laddr. Net must be "udp", "udp4", or "udp6". If laddr has +// address laddr. Net must be "udp", "udp4", or "udp6". If laddr has // a port of 0, ListenUDP will choose an available port. // The LocalAddr method of the returned UDPConn can be used to -// discover the port. The returned connection's ReadFrom and WriteTo +// discover the port. The returned connection's ReadFrom and WriteTo // methods can be used to receive and send UDP packets with per-packet // addressing. func ListenUDP(net string, laddr *UDPAddr) (*UDPConn, error) { diff --git a/src/net/udpsock_posix.go b/src/net/udpsock_posix.go index 028151f9ed..3b9b129890 100644 --- a/src/net/udpsock_posix.go +++ b/src/net/udpsock_posix.go @@ -84,7 +84,7 @@ func (c *UDPConn) ReadFrom(b []byte) (int, Addr, error) { } // ReadMsgUDP reads a packet from c, copying the payload into b and -// the associated out-of-band data into oob. It returns the number +// the associated out-of-band data into oob. It returns the number // of bytes copied into b, the number of bytes copied into oob, the // flags that were set on the packet and the source address of the // packet. @@ -111,7 +111,7 @@ func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *UDPAddr, // // WriteToUDP can be made to time out and return an error with // Timeout() == true after a fixed time limit; see SetDeadline and -// SetWriteDeadline. On packet-oriented connections, write timeouts +// SetWriteDeadline. On packet-oriented connections, write timeouts // are rare. func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (int, error) { if !c.ok() { @@ -149,7 +149,7 @@ func (c *UDPConn) WriteTo(b []byte, addr Addr) (int, error) { // WriteMsgUDP writes a packet to addr via c if c isn't connected, or // to c's remote destination address if c is connected (in which case // addr must be nil). The payload is copied from b and the associated -// out-of-band data is copied from oob. It returns the number of +// out-of-band data is copied from oob. It returns the number of // payload and out-of-band bytes written. func (c *UDPConn) WriteMsgUDP(b, oob []byte, addr *UDPAddr) (n, oobn int, err error) { if !c.ok() { @@ -197,10 +197,10 @@ func dialUDP(net string, laddr, raddr *UDPAddr, deadline time.Time) (*UDPConn, e } // ListenUDP listens for incoming UDP packets addressed to the local -// address laddr. Net must be "udp", "udp4", or "udp6". If laddr has +// address laddr. Net must be "udp", "udp4", or "udp6". If laddr has // a port of 0, ListenUDP will choose an available port. // The LocalAddr method of the returned UDPConn can be used to -// discover the port. The returned connection's ReadFrom and WriteTo +// discover the port. The returned connection's ReadFrom and WriteTo // methods can be used to receive and send UDP packets with per-packet // addressing. func ListenUDP(net string, laddr *UDPAddr) (*UDPConn, error) { diff --git a/src/net/unixsock_plan9.go b/src/net/unixsock_plan9.go index 4bd3962ccb..d0e3ca72e8 100644 --- a/src/net/unixsock_plan9.go +++ b/src/net/unixsock_plan9.go @@ -16,7 +16,7 @@ type UnixConn struct { conn } -// ReadFromUnix reads a packet from c, copying the payload into b. It +// ReadFromUnix reads a packet from c, copying the payload into b. It // returns the number of bytes copied into b and the source address of // the packet. // @@ -33,7 +33,7 @@ func (c *UnixConn) ReadFrom(b []byte) (int, Addr, error) { } // ReadMsgUnix reads a packet from c, copying the payload into b and -// the associated out-of-band data into oob. It returns the number of +// the associated out-of-band data into oob. It returns the number of // bytes copied into b, the number of bytes copied into oob, the flags // that were set on the packet, and the source address of the packet. func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAddr, err error) { @@ -44,7 +44,7 @@ func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAdd // // WriteToUnix can be made to time out and return an error with // Timeout() == true after a fixed time limit; see SetDeadline and -// SetWriteDeadline. On packet-oriented connections, write timeouts +// SetWriteDeadline. On packet-oriented connections, write timeouts // are rare. func (c *UnixConn) WriteToUnix(b []byte, addr *UnixAddr) (int, error) { return 0, &OpError{Op: "write", Net: c.fd.dir, Source: c.fd.laddr, Addr: addr.opAddr(), Err: syscall.EPLAN9} @@ -56,7 +56,7 @@ func (c *UnixConn) WriteTo(b []byte, addr Addr) (int, error) { } // WriteMsgUnix writes a packet to addr via c, copying the payload -// from b and the associated out-of-band data from oob. It returns +// from b and the associated out-of-band data from oob. It returns // the number of payload and out-of-band bytes written. func (c *UnixConn) WriteMsgUnix(b, oob []byte, addr *UnixAddr) (n, oobn int, err error) { return 0, 0, &OpError{Op: "write", Net: c.fd.dir, Source: c.fd.laddr, Addr: addr.opAddr(), Err: syscall.EPLAN9} @@ -85,7 +85,7 @@ func dialUnix(net string, laddr, raddr *UnixAddr, deadline time.Time) (*UnixConn return nil, &OpError{Op: "dial", Net: net, Source: laddr.opAddr(), Addr: raddr.opAddr(), Err: syscall.EPLAN9} } -// UnixListener is a Unix domain socket listener. Clients should +// UnixListener is a Unix domain socket listener. Clients should // typically use variables of type Listener instead of assuming Unix // domain sockets. type UnixListener struct { @@ -93,7 +93,7 @@ type UnixListener struct { } // ListenUnix announces on the Unix domain socket laddr and returns a -// Unix listener. The network net must be "unix" or "unixpacket". +// Unix listener. The network net must be "unix" or "unixpacket". func ListenUnix(net string, laddr *UnixAddr) (*UnixListener, error) { return nil, &OpError{Op: "listen", Net: net, Source: nil, Addr: laddr.opAddr(), Err: syscall.EPLAN9} } @@ -110,7 +110,7 @@ func (l *UnixListener) Accept() (Conn, error) { return nil, &OpError{Op: "accept", Net: l.fd.dir, Source: nil, Addr: l.fd.laddr, Err: syscall.EPLAN9} } -// Close stops listening on the Unix address. Already accepted +// Close stops listening on the Unix address. Already accepted // connections are not closed. func (l *UnixListener) Close() error { return &OpError{Op: "close", Net: l.fd.dir, Source: nil, Addr: l.fd.laddr, Err: syscall.EPLAN9} @@ -128,18 +128,18 @@ func (l *UnixListener) SetDeadline(t time.Time) error { } // File returns a copy of the underlying os.File, set to blocking -// mode. It is the caller's responsibility to close f when finished. +// mode. It is the caller's responsibility to close f when finished. // Closing l does not affect f, and closing f does not affect l. // // The returned os.File's file descriptor is different from the -// connection's. Attempting to change properties of the original +// connection's. Attempting to change properties of the original // using this duplicate may or may not have the desired effect. func (l *UnixListener) File() (*os.File, error) { return nil, &OpError{Op: "file", Net: l.fd.dir, Source: nil, Addr: l.fd.laddr, Err: syscall.EPLAN9} } // ListenUnixgram listens for incoming Unix datagram packets addressed -// to the local address laddr. The network net must be "unixgram". +// to the local address laddr. The network net must be "unixgram". // The returned connection's ReadFrom and WriteTo methods can be used // to receive and send packets with per-packet addressing. func ListenUnixgram(net string, laddr *UnixAddr) (*UnixConn, error) { diff --git a/src/net/unixsock_posix.go b/src/net/unixsock_posix.go index 0e72e90344..83d3e8cb01 100644 --- a/src/net/unixsock_posix.go +++ b/src/net/unixsock_posix.go @@ -102,7 +102,7 @@ type UnixConn struct { func newUnixConn(fd *netFD) *UnixConn { return &UnixConn{conn{fd}} } -// ReadFromUnix reads a packet from c, copying the payload into b. It +// ReadFromUnix reads a packet from c, copying the payload into b. It // returns the number of bytes copied into b and the source address of // the packet. // @@ -140,7 +140,7 @@ func (c *UnixConn) ReadFrom(b []byte) (int, Addr, error) { } // ReadMsgUnix reads a packet from c, copying the payload into b and -// the associated out-of-band data into oob. It returns the number of +// the associated out-of-band data into oob. It returns the number of // bytes copied into b, the number of bytes copied into oob, the flags // that were set on the packet, and the source address of the packet. func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAddr, err error) { @@ -164,7 +164,7 @@ func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAdd // // WriteToUnix can be made to time out and return an error with // Timeout() == true after a fixed time limit; see SetDeadline and -// SetWriteDeadline. On packet-oriented connections, write timeouts +// SetWriteDeadline. On packet-oriented connections, write timeouts // are rare. func (c *UnixConn) WriteToUnix(b []byte, addr *UnixAddr) (int, error) { if !c.ok() { @@ -200,7 +200,7 @@ func (c *UnixConn) WriteTo(b []byte, addr Addr) (n int, err error) { } // WriteMsgUnix writes a packet to addr via c, copying the payload -// from b and the associated out-of-band data from oob. It returns +// from b and the associated out-of-band data from oob. It returns // the number of payload and out-of-band bytes written. func (c *UnixConn) WriteMsgUnix(b, oob []byte, addr *UnixAddr) (n, oobn int, err error) { if !c.ok() { @@ -269,7 +269,7 @@ func dialUnix(net string, laddr, raddr *UnixAddr, deadline time.Time) (*UnixConn return newUnixConn(fd), nil } -// UnixListener is a Unix domain socket listener. Clients should +// UnixListener is a Unix domain socket listener. Clients should // typically use variables of type Listener instead of assuming Unix // domain sockets. type UnixListener struct { @@ -279,7 +279,7 @@ type UnixListener struct { } // ListenUnix announces on the Unix domain socket laddr and returns a -// Unix listener. The network net must be "unix" or "unixpacket". +// Unix listener. The network net must be "unix" or "unixpacket". func ListenUnix(net string, laddr *UnixAddr) (*UnixListener, error) { switch net { case "unix", "unixpacket": @@ -319,7 +319,7 @@ func (l *UnixListener) Accept() (Conn, error) { return c, nil } -// Close stops listening on the Unix address. Already accepted +// Close stops listening on the Unix address. Already accepted // connections are not closed. func (l *UnixListener) Close() error { if l == nil || l.fd == nil { @@ -334,7 +334,7 @@ func (l *UnixListener) Close() error { // and replaced our socket name already-- // but this sequence (remove then close) // is at least compatible with the auto-remove - // sequence in ListenUnix. It's only non-Go + // sequence in ListenUnix. It's only non-Go // programs that can mess us up. if l.path[0] != '@' && l.unlink { syscall.Unlink(l.path) @@ -364,11 +364,11 @@ func (l *UnixListener) SetDeadline(t time.Time) error { } // File returns a copy of the underlying os.File, set to blocking -// mode. It is the caller's responsibility to close f when finished. +// mode. It is the caller's responsibility to close f when finished. // Closing l does not affect f, and closing f does not affect l. // // The returned os.File's file descriptor is different from the -// connection's. Attempting to change properties of the original +// connection's. Attempting to change properties of the original // using this duplicate may or may not have the desired effect. func (l *UnixListener) File() (f *os.File, err error) { f, err = l.fd.dup() @@ -379,7 +379,7 @@ func (l *UnixListener) File() (f *os.File, err error) { } // ListenUnixgram listens for incoming Unix datagram packets addressed -// to the local address laddr. The network net must be "unixgram". +// to the local address laddr. The network net must be "unixgram". // The returned connection's ReadFrom and WriteTo methods can be used // to receive and send packets with per-packet addressing. func ListenUnixgram(net string, laddr *UnixAddr) (*UnixConn, error) { diff --git a/src/net/url/url.go b/src/net/url/url.go index 86ed887931..d2ec333310 100644 --- a/src/net/url/url.go +++ b/src/net/url/url.go @@ -427,7 +427,7 @@ func Parse(rawurl string) (*URL, error) { return url, nil } -// ParseRequestURI parses rawurl into a URL structure. It assumes that +// ParseRequestURI parses rawurl into a URL structure. It assumes that // rawurl was received in an HTTP request, so the rawurl is interpreted // only as an absolute URI or an absolute path. // The string rawurl is assumed not to have a #fragment suffix. @@ -436,7 +436,7 @@ func ParseRequestURI(rawurl string) (*URL, error) { return parse(rawurl, true) } -// parse parses a URL from a string in one of two contexts. If +// parse parses a URL from a string in one of two contexts. If // viaRequest is true, the URL is assumed to have arrived via an HTTP request, // in which case only absolute URLs or path-absolute relative URLs are allowed. // If viaRequest is false, all forms of relative URLs are allowed. @@ -852,8 +852,8 @@ func (u *URL) IsAbs() bool { return u.Scheme != "" } -// Parse parses a URL in the context of the receiver. The provided URL -// may be relative or absolute. Parse returns nil, err on parse +// Parse parses a URL in the context of the receiver. The provided URL +// may be relative or absolute. Parse returns nil, err on parse // failure, otherwise its return value is the same as ResolveReference. func (u *URL) Parse(ref string) (*URL, error) { refurl, err := Parse(ref) @@ -865,7 +865,7 @@ func (u *URL) Parse(ref string) (*URL, error) { // ResolveReference resolves a URI reference to an absolute URI from // an absolute base URI, per RFC 3986 Section 5.2. The URI reference -// may be relative or absolute. ResolveReference always returns a new +// may be relative or absolute. ResolveReference always returns a new // URL instance, even if the returned URL is identical to either the // base or reference. If ref is an absolute URL, then ResolveReference // ignores base and returns a copy of ref. |
