aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/dnsclient.go2
-rw-r--r--src/net/dnsclient_unix_test.go4
-rw-r--r--src/net/http/client_test.go2
-rw-r--r--src/net/http/cookie.go2
-rw-r--r--src/net/http/h2_bundle.go14
-rw-r--r--src/net/http/httptest/server_test.go2
-rw-r--r--src/net/http/request.go2
-rw-r--r--src/net/http/request_test.go2
-rw-r--r--src/net/http/requestwrite_test.go2
-rw-r--r--src/net/http/server.go2
-rw-r--r--src/net/http/transport.go2
-rw-r--r--src/net/http/transport_test.go2
-rw-r--r--src/net/interface_bsd.go2
-rw-r--r--src/net/interface_darwin.go2
-rw-r--r--src/net/interface_freebsd.go2
-rw-r--r--src/net/interface_test.go4
-rw-r--r--src/net/interface_unix_test.go2
-rw-r--r--src/net/ip_test.go4
-rw-r--r--src/net/ipsock_posix.go2
-rw-r--r--src/net/listen_test.go4
-rw-r--r--src/net/net_windows_test.go4
-rw-r--r--src/net/sendfile_windows.go2
-rw-r--r--src/net/udpsock_test.go2
23 files changed, 34 insertions, 34 deletions
diff --git a/src/net/dnsclient.go b/src/net/dnsclient.go
index 5dc2a0368c..5094ac4f1b 100644
--- a/src/net/dnsclient.go
+++ b/src/net/dnsclient.go
@@ -161,7 +161,7 @@ func isDomainName(s string) bool {
return ok
}
-// absDomainName returns an absoulte domain name which ends with a
+// absDomainName returns an absolute domain name which ends with a
// trailing dot to match pure Go reverse resolver and all other lookup
// routines.
// See golang.org/issue/12189.
diff --git a/src/net/dnsclient_unix_test.go b/src/net/dnsclient_unix_test.go
index d7f00c784d..5623039b7b 100644
--- a/src/net/dnsclient_unix_test.go
+++ b/src/net/dnsclient_unix_test.go
@@ -67,7 +67,7 @@ var specialDomainNameTests = []struct {
// Name resolution APIs and libraries should recognize the
// followings as special and should not send any queries.
- // Though, we test those names here for verifying nagative
+ // Though, we test those names here for verifying negative
// answers at DNS query-response interaction level.
{"localhost.", dnsTypeALL, dnsRcodeNameError},
{"invalid.", dnsTypeALL, dnsRcodeNameError},
@@ -398,7 +398,7 @@ func TestGoLookupIPOrderFallbackToFile(t *testing.T) {
for _, order := range []hostLookupOrder{hostLookupFilesDNS, hostLookupDNSFiles} {
name := fmt.Sprintf("order %v", order)
- // First ensure that we get an error when contacting a non-existant host.
+ // First ensure that we get an error when contacting a non-existent host.
_, err := goLookupIPOrder("notarealhost", order)
if err == nil {
t.Errorf("%s: expected error while looking up name not in hosts file", name)
diff --git a/src/net/http/client_test.go b/src/net/http/client_test.go
index 8939dc8baf..e4fed26803 100644
--- a/src/net/http/client_test.go
+++ b/src/net/http/client_test.go
@@ -273,7 +273,7 @@ func TestClientRedirects(t *testing.T) {
t.Fatal("didn't see redirect")
}
if lastReq.Cancel != cancel {
- t.Errorf("expected lastReq to have the cancel channel set on the inital req")
+ t.Errorf("expected lastReq to have the cancel channel set on the initial req")
}
checkErr = errors.New("no redirects allowed")
diff --git a/src/net/http/cookie.go b/src/net/http/cookie.go
index 648709dd99..1ea0e9397a 100644
--- a/src/net/http/cookie.go
+++ b/src/net/http/cookie.go
@@ -223,7 +223,7 @@ func readCookies(h Header, filter string) []*Cookie {
return cookies
}
-// validCookieDomain returns wheter v is a valid cookie domain-value.
+// validCookieDomain returns whether v is a valid cookie domain-value.
func validCookieDomain(v string) bool {
if isCookieDomainName(v) {
return true
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 4e19b3e71f..f778acb2b5 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -288,7 +288,7 @@ func http2configureTransport(t1 *Transport) (*http2Transport, error) {
}
// registerHTTPSProtocol calls Transport.RegisterProtocol but
-// convering panics into errors.
+// converting panics into errors.
func http2registerHTTPSProtocol(t *Transport, rt RoundTripper) (err error) {
defer func() {
if e := recover(); e != nil {
@@ -1410,7 +1410,7 @@ type http2PriorityFrame struct {
http2PriorityParam
}
-// PriorityParam are the stream prioritzation parameters.
+// PriorityParam are the stream prioritization parameters.
type http2PriorityParam struct {
// StreamDep is a 31-bit stream identifier for the
// stream that this stream depends on. Zero means no
@@ -2850,7 +2850,7 @@ type http2stream struct {
weight uint8
state http2streamState
sentReset bool // only true once detached from streams map
- gotReset bool // only true once detacted from streams map
+ gotReset bool // only true once detached from streams map
gotTrailerHeader bool // HEADER frame for trailers was seen
trailer Header // accumulated trailers
@@ -4391,7 +4391,7 @@ const http2TrailerPrefix = "Trailer:"
// trailers. That worked for a while, until we found the first major
// user of Trailers in the wild: gRPC (using them only over http2),
// and gRPC libraries permit setting trailers mid-stream without
-// predeclarnig them. So: change of plans. We still permit the old
+// predeclaring them. So: change of plans. We still permit the old
// way, but we also permit this hack: if a Header() key begins with
// "Trailer:", the suffix of that key is a Trailer. Because ':' is an
// invalid token byte anyway, there is no ambiguity. (And it's already
@@ -4605,7 +4605,7 @@ type http2Transport struct {
// send in the initial settings frame. It is how many bytes
// of response headers are allow. Unlike the http2 spec, zero here
// means to use a default limit (currently 10MB). If you actually
- // want to advertise an ulimited value to the peer, Transport
+ // want to advertise an unlimited value to the peer, Transport
// interprets the highest possible value here (0xffffffff or 1<<32-1)
// to mean no limit.
MaxHeaderListSize uint32
@@ -5012,7 +5012,7 @@ const http2maxAllocFrameSize = 512 << 10
// frameBuffer returns a scratch buffer suitable for writing DATA frames.
// They're capped at the min of the peer's max frame size or 512KB
// (kinda arbitrarily), but definitely capped so we don't allocate 4GB
-// bufers.
+// buffers.
func (cc *http2ClientConn) frameScratchBuffer() []byte {
cc.mu.Lock()
size := cc.maxFrameSize
@@ -6544,7 +6544,7 @@ func (ws *http2writeScheduler) take() (wm http2frameWriteMsg, ok bool) {
return ws.takeFrom(q.streamID(), q)
}
-// zeroCanSend is defered from take.
+// zeroCanSend is deferred from take.
func (ws *http2writeScheduler) zeroCanSend() {
for i := range ws.canSend {
ws.canSend[i] = nil
diff --git a/src/net/http/httptest/server_test.go b/src/net/http/httptest/server_test.go
index c9606f2419..61470c3822 100644
--- a/src/net/http/httptest/server_test.go
+++ b/src/net/http/httptest/server_test.go
@@ -53,7 +53,7 @@ func TestGetAfterClose(t *testing.T) {
res, err = http.Get(ts.URL)
if err == nil {
body, _ := ioutil.ReadAll(res.Body)
- t.Fatalf("Unexected response after close: %v, %v, %s", res.Status, res.Header, body)
+ t.Fatalf("Unexpected response after close: %v, %v, %s", res.Status, res.Header, body)
}
}
diff --git a/src/net/http/request.go b/src/net/http/request.go
index 8cdab02af5..c3e43bb99d 100644
--- a/src/net/http/request.go
+++ b/src/net/http/request.go
@@ -521,7 +521,7 @@ func cleanHost(in string) string {
return in
}
-// removeZone removes IPv6 zone identifer from host.
+// removeZone removes IPv6 zone identifier from host.
// E.g., "[fe80::1%en0]:8080" to "[fe80::1]:8080"
func removeZone(host string) string {
if !strings.HasPrefix(host, "[") {
diff --git a/src/net/http/request_test.go b/src/net/http/request_test.go
index 0ecdf85a56..3d215ff538 100644
--- a/src/net/http/request_test.go
+++ b/src/net/http/request_test.go
@@ -99,7 +99,7 @@ type parseContentTypeTest struct {
var parseContentTypeTests = []parseContentTypeTest{
{false, stringMap{"Content-Type": {"text/plain"}}},
- // Empty content type is legal - shoult be treated as
+ // Empty content type is legal - should be treated as
// application/octet-stream (RFC 2616, section 7.2.1)
{false, stringMap{}},
{true, stringMap{"Content-Type": {"text/plain; boundary="}}},
diff --git a/src/net/http/requestwrite_test.go b/src/net/http/requestwrite_test.go
index cfb95b0a80..9b70fcbf8a 100644
--- a/src/net/http/requestwrite_test.go
+++ b/src/net/http/requestwrite_test.go
@@ -573,7 +573,7 @@ func TestRequestWriteClosesBody(t *testing.T) {
"Transfer-Encoding: chunked\r\n\r\n" +
// TODO: currently we don't buffer before chunking, so we get a
// single "m" chunk before the other chunks, as this was the 1-byte
- // read from our MultiReader where we stiched the Body back together
+ // read from our MultiReader where we stitched the Body back together
// after sniffing whether the Body was 0 bytes or not.
chunk("m") +
chunk("y body") +
diff --git a/src/net/http/server.go b/src/net/http/server.go
index e2d8d277e0..773dd59c6b 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -1374,7 +1374,7 @@ func (c *conn) setState(nc net.Conn, state ConnState) {
// badRequestError is a literal string (used by in the server in HTML,
// unescaped) to tell the user why their request was bad. It should
-// be plain text without user info or other embeddded errors.
+// be plain text without user info or other embedded errors.
type badRequestError string
func (e badRequestError) Error() string { return "Bad Request: " + string(e) }
diff --git a/src/net/http/transport.go b/src/net/http/transport.go
index 03e9162b14..f622f6f983 100644
--- a/src/net/http/transport.go
+++ b/src/net/http/transport.go
@@ -982,7 +982,7 @@ func (k connectMethodKey) String() string {
// (but may be used for non-keep-alive requests as well)
type persistConn struct {
// alt optionally specifies the TLS NextProto RoundTripper.
- // This is used for HTTP/2 today and future protocol laters.
+ // This is used for HTTP/2 today and future protocols later.
// If it's non-nil, the rest of the fields are unused.
alt RoundTripper
diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go
index d9da078fa0..e8a4623556 100644
--- a/src/net/http/transport_test.go
+++ b/src/net/http/transport_test.go
@@ -853,7 +853,7 @@ func TestTransportExpect100Continue(t *testing.T) {
{path: "/100", body: []byte("hello"), sent: 5, status: 200}, // Got 100 followed by 200, entire body is sent.
{path: "/200", body: []byte("hello"), sent: 0, status: 200}, // Got 200 without 100. body isn't sent.
{path: "/500", body: []byte("hello"), sent: 0, status: 500}, // Got 500 without 100. body isn't sent.
- {path: "/keepalive", body: []byte("hello"), sent: 0, status: 500}, // Althogh without Connection:close, body isn't sent.
+ {path: "/keepalive", body: []byte("hello"), sent: 0, status: 500}, // Although without Connection:close, body isn't sent.
{path: "/timeout", body: []byte("hello"), sent: 5, status: 200}, // Timeout exceeded and entire body is sent.
}
diff --git a/src/net/interface_bsd.go b/src/net/interface_bsd.go
index 208f37f9fd..e0814798e7 100644
--- a/src/net/interface_bsd.go
+++ b/src/net/interface_bsd.go
@@ -161,7 +161,7 @@ func newAddr(ifi *Interface, m *syscall.InterfaceAddrMessage) (*IPNet, error) {
case *syscall.SockaddrInet6:
ifa.IP = make(IP, IPv6len)
copy(ifa.IP, sa.Addr[:])
- // NOTE: KAME based IPv6 protcol stack usually embeds
+ // NOTE: KAME based IPv6 protocol stack usually embeds
// the interface index in the interface-local or
// link-local address as the kernel-internal form.
if ifa.IP.IsLinkLocalUnicast() {
diff --git a/src/net/interface_darwin.go b/src/net/interface_darwin.go
index b7a333849d..b3719d6092 100644
--- a/src/net/interface_darwin.go
+++ b/src/net/interface_darwin.go
@@ -49,7 +49,7 @@ func newMulticastAddr(ifi *Interface, m *syscall.InterfaceMulticastAddrMessage)
case *syscall.SockaddrInet6:
ifma := IPAddr{IP: make(IP, IPv6len)}
copy(ifma.IP, sa.Addr[:])
- // NOTE: KAME based IPv6 protcol stack usually embeds
+ // NOTE: KAME based IPv6 protocol stack usually embeds
// the interface index in the interface-local or
// link-local address as the kernel-internal form.
if ifma.IP.IsInterfaceLocalMulticast() || ifma.IP.IsLinkLocalMulticast() {
diff --git a/src/net/interface_freebsd.go b/src/net/interface_freebsd.go
index c42d90b740..44ef2c1a2a 100644
--- a/src/net/interface_freebsd.go
+++ b/src/net/interface_freebsd.go
@@ -49,7 +49,7 @@ func newMulticastAddr(ifi *Interface, m *syscall.InterfaceMulticastAddrMessage)
case *syscall.SockaddrInet6:
ifma := IPAddr{IP: make(IP, IPv6len)}
copy(ifma.IP, sa.Addr[:])
- // NOTE: KAME based IPv6 protcol stack usually embeds
+ // NOTE: KAME based IPv6 protocol stack usually embeds
// the interface index in the interface-local or
// link-local address as the kernel-internal form.
if ifma.IP.IsInterfaceLocalMulticast() || ifma.IP.IsLinkLocalMulticast() {
diff --git a/src/net/interface_test.go b/src/net/interface_test.go
index 7bdd924150..6721f72bb5 100644
--- a/src/net/interface_test.go
+++ b/src/net/interface_test.go
@@ -102,7 +102,7 @@ func TestInterfaces(t *testing.T) {
}
// Test the existence of connected unicast routes for
// IPv6. We can assume the existence of ::1/128 when
- // at least one looopback interface is installed.
+ // at least one loopback interface is installed.
if supportsIPv6 && stats.loop > 0 && stats.uni6 == 0 {
t.Errorf("num IPv6 unicast routes = 0; want >0; summary: %+v", stats)
}
@@ -155,7 +155,7 @@ func TestInterfaceAddrs(t *testing.T) {
}
// Test the existence of connected unicast routes for IPv6.
// We can assume the existence of ::1/128 when at least one
- // looopback interface is installed.
+ // loopback interface is installed.
if supportsIPv6 && stats.loop > 0 && stats.uni6 == 0 {
t.Errorf("num IPv6 unicast routes = 0; want >0; summary: %+v", stats)
}
diff --git a/src/net/interface_unix_test.go b/src/net/interface_unix_test.go
index 93b3b79afd..dd20de4ac7 100644
--- a/src/net/interface_unix_test.go
+++ b/src/net/interface_unix_test.go
@@ -56,7 +56,7 @@ func TestPointToPointInterface(t *testing.T) {
for i := 0; i < 3; i++ {
ti := &testInterface{local: local, remote: remote}
if err := ti.setPointToPoint(5963 + i); err != nil {
- t.Skipf("test requries external command: %v", err)
+ t.Skipf("test requires external command: %v", err)
}
if err := ti.setup(); err != nil {
t.Fatal(err)
diff --git a/src/net/ip_test.go b/src/net/ip_test.go
index 3d95a73c09..2b24baf58e 100644
--- a/src/net/ip_test.go
+++ b/src/net/ip_test.go
@@ -379,8 +379,8 @@ var splitJoinTests = []struct {
{"", "0", ":0"},
{"google.com", "https%foo", "google.com:https%foo"}, // Go 1.0 behavior
- {"127.0.0.1", "", "127.0.0.1:"}, // Go 1.0 behaviour
- {"www.google.com", "", "www.google.com:"}, // Go 1.0 behaviour
+ {"127.0.0.1", "", "127.0.0.1:"}, // Go 1.0 behavior
+ {"www.google.com", "", "www.google.com:"}, // Go 1.0 behavior
}
var splitFailureTests = []struct {
diff --git a/src/net/ipsock_posix.go b/src/net/ipsock_posix.go
index 2bddd46a15..d512fc3e57 100644
--- a/src/net/ipsock_posix.go
+++ b/src/net/ipsock_posix.go
@@ -61,7 +61,7 @@ func probeIPv6Stack() (supportsIPv6, supportsIPv4map bool) {
// Some released versions of DragonFly BSD pretend to
// accept IPV6_V6ONLY=0 successfully, but the state
// still stays IPV6_V6ONLY=1. Eventually DragonFly BSD
- // stops preteding, but the transition period would
+ // stops pretending, but the transition period would
// cause unpredictable behavior and we need to avoid
// it.
//
diff --git a/src/net/listen_test.go b/src/net/listen_test.go
index 51ffe67238..158a8ed598 100644
--- a/src/net/listen_test.go
+++ b/src/net/listen_test.go
@@ -157,7 +157,7 @@ var dualStackTCPListenerTests = []struct {
network2, address2 string // second listener
xerr error // expected error value, nil or other
}{
- // Test cases and expected results for the attemping 2nd listen on the same port
+ // Test cases and expected results for the attempting 2nd listen on the same port
// 1st listen 2nd listen darwin freebsd linux openbsd
// ------------------------------------------------------------------------------------
// "tcp" "" "tcp" "" - - - -
@@ -301,7 +301,7 @@ var dualStackUDPListenerTests = []struct {
}
// TestDualStackUDPListener tests both single and double listen
-// to a test listener with various address families, differnet
+// to a test listener with various address families, different
// listening address and same port.
func TestDualStackUDPListener(t *testing.T) {
switch runtime.GOOS {
diff --git a/src/net/net_windows_test.go b/src/net/net_windows_test.go
index df39032721..ab21798969 100644
--- a/src/net/net_windows_test.go
+++ b/src/net/net_windows_test.go
@@ -315,7 +315,7 @@ func TestInterfacesWithNetsh(t *testing.T) {
}
func netshInterfaceIPv4ShowAddress(name string, netshOutput []byte) []string {
- // adress information is listed like:
+ // Address information is listed like:
//
//Configuration for interface "Local Area Connection"
// DHCP enabled: Yes
@@ -378,7 +378,7 @@ func netshInterfaceIPv4ShowAddress(name string, netshOutput []byte) []string {
}
func netshInterfaceIPv6ShowAddress(name string, netshOutput []byte) []string {
- // adress information is listed like:
+ // Address information is listed like:
//
//Address ::1 Parameters
//---------------------------------------------------------
diff --git a/src/net/sendfile_windows.go b/src/net/sendfile_windows.go
index f3f3b54b88..eafb372f7c 100644
--- a/src/net/sendfile_windows.go
+++ b/src/net/sendfile_windows.go
@@ -18,7 +18,7 @@ import (
//
// if handled == false, sendFile performed no work.
//
-// Note that sendfile for windows does not suppport >2GB file.
+// Note that sendfile for windows does not support >2GB file.
func sendFile(fd *netFD, r io.Reader) (written int64, err error, handled bool) {
var n int64 = 0 // by default, copy until EOF
diff --git a/src/net/udpsock_test.go b/src/net/udpsock_test.go
index b25f96a3fd..12d1256f0a 100644
--- a/src/net/udpsock_test.go
+++ b/src/net/udpsock_test.go
@@ -356,7 +356,7 @@ func TestUDPZeroByteBuffer(t *testing.T) {
switch err {
case nil: // ReadFrom succeeds
default: // Read may timeout, it depends on the platform
- if nerr, ok := err.(Error); (!ok || !nerr.Timeout()) && runtime.GOOS != "windows" { // Windows retruns WSAEMSGSIZ
+ if nerr, ok := err.(Error); (!ok || !nerr.Timeout()) && runtime.GOOS != "windows" { // Windows returns WSAEMSGSIZ
t.Fatal(err)
}
}