}
}
if err == io.EOF {
- // If we filled the buffer exactly, flush pre-emptively.
+ // If we filled the buffer exactly, flush preemptively.
if b.Available() == 0 {
err = b.flush()
} else {
// Test that an EOF is overridden by a user-generated scan error.
func TestErrAtEOF(t *testing.T) {
s := NewScanner(strings.NewReader("1 2 33"))
- // This spitter will fail on last entry, after s.err==EOF.
+ // This splitter will fail on last entry, after s.err==EOF.
split := func(data []byte, atEOF bool) (advance int, token []byte, err error) {
advance, token, err = ScanWords(data, atEOF)
if len(token) > 1 {
Flags:
-D value
- predefined symbol with optional simple value -D=identifer=value;
+ predefined symbol with optional simple value -D=identifier=value;
can be set multiple times
-I value
include directory; can be set multiple times
//
// LSTXR reg ',' addr ',' reg
// {
-// outtcode($1, &$2, &$4, &$6);
+// outcode($1, &$2, &$4, &$6);
// }
LDAXRW (R0), R2
STLXRW R1, (R0), R3
TrimPath = flag.String("trimpath", "", "remove prefix from recorded source file paths")
Shared = flag.Bool("shared", false, "generate code that can be linked into a shared library")
Dynlink = flag.Bool("dynlink", false, "support references to Go symbols defined in other shared libraries")
- AllErrors = flag.Bool("e", false, "no limit on number of errors reported")
+ AllErrors = flag.Bool("e", false, "no limit on number of errors reported")
)
var (
)
func init() {
- flag.Var(&D, "D", "predefined symbol with optional simple value -D=identifer=value; can be set multiple times")
+ flag.Var(&D, "D", "predefined symbol with optional simple value -D=identifier=value; can be set multiple times")
flag.Var(&I, "I", "include directory; can be set multiple times")
}
}
if regtyp(&p.From) || p.From.Type == obj.TYPE_CONST {
- // move or artihmetic into partial register.
+ // move or arithmetic into partial register.
// from another register or constant can be movl.
// we don't switch to 64-bit arithmetic if it can
// change how the carry bit is set (and the carry bit is needed).
// The hardware will generate undefined result.
// Also need to explicitly trap on division on zero,
// the hardware will silently generate undefined result.
- // DIVW will leave unpredicable result in higher 32-bit,
+ // DIVW will leave unpredictable result in higher 32-bit,
// so always use DIVD/DIVDU.
t := nl.Type
All integer values use a variable-length encoding for compact representation.
-If debugFormat is set, each integer and string value is preceeded by a marker
+If debugFormat is set, each integer and string value is preceded by a marker
and position information in the encoding. This mechanism permits an importer
to recognize immediately when it is out of sync. The importer recognizes this
mode automatically (i.e., it can import export data produced with debugging
"math"
)
-/// implements float arihmetic
+// implements float arithmetic
func newMpflt() *Mpflt {
var a Mpflt
// Ordermapassign appends n to order->out, introducing temporaries
// to make sure that all map assignments have the form m[k] = x,
-// where x is adressable.
+// where x is addressable.
// (Orderexpr has already been called on n, so we know k is addressable.)
//
// If n is m[k] = x where x is not addressable, the rewrite is:
}
// Inserts prev before curr in the instruction
-// stream. Any control flow, such as branches or fall throughs, that target the
+// stream. Any control flow, such as branches or fall-throughs, that target the
// existing instruction are adjusted to target the new instruction.
func splicebefore(lv *Liveness, bb *BasicBlock, prev *obj.Prog, curr *obj.Prog) {
// There may be other instructions pointing at curr,
// be multiples of four words. On 32-bit systems that's 16 bytes, and
// all size classes >= 16 bytes are 16-byte aligned, so no real constraint.
// On 64-bit systems, that's 32 bytes, and 32-byte alignment is guaranteed
-// for size classes >= 256 bytes. On a 64-bit sytem, 256 bytes allocated
+// for size classes >= 256 bytes. On a 64-bit system, 256 bytes allocated
// is 32 pointers, the bits for which fit in 4 bytes. So maxPtrmaskBytes
// must be >= 4.
//
// The hardware will generate undefined result.
// Also need to explicitly trap on division on zero,
// the hardware will silently generate undefined result.
- // DIVW will leave unpredicable result in higher 32-bit,
+ // DIVW will leave unpredictable result in higher 32-bit,
// so always use DIVD/DIVDU.
t := nl.Type
}
if regtyp(&p.From) || p.From.Type == obj.TYPE_CONST {
- // move or artihmetic into partial register.
+ // move or arithmetic into partial register.
// from another register or constant can be movl.
// we don't switch to 32-bit arithmetic if it can
// change how the carry bit is set (and the carry bit is needed).
fatal("current directory %s is not under %s", pwd, real_src)
}
pwd = pwd[len(real_src):]
- // guard againt xrealwd return the directory without the trailing /
+ // guard against xrealwd returning the directory without the trailing /
pwd = strings.TrimPrefix(pwd, "/")
return pwd
// cmd/go: go test -a foo does not rebuild regexp.
func TestIssue6844(t *testing.T) {
if testing.Short() {
- t.Skip("don't rebuild the standard libary in short mode")
+ t.Skip("don't rebuild the standard library in short mode")
}
tg := testgo(t)
// an explicit data comparison. Specifically, we build a list of the
// inputs to the build, compute its SHA1 hash, and record that as the
// ``build ID'' in the generated object. At the next build, we can
-// recompute the buid ID and compare it to the one in the generated
+// recompute the build ID and compare it to the one in the generated
// object. If they differ, the list of inputs has changed, so the object
// is out of date and must be rebuilt.
//
}
}
- // Replace TLS register fetches on older ARM procesors.
+ // Replace TLS register fetches on older ARM processors.
switch p.As {
// Treat MRC 15, 0, <reg>, C13, C0, 3 specially.
case AMRC:
}
/*
- * test to see if 2 instrictions can be
+ * test to see if two instructions can be
* interchanged without changing semantics
*/
func depend(ctxt *obj.Link, sa, sb *Sch) bool {
}
}
- // Rewrite 0 to $0 in 3rd argment to CMPPS etc.
+ // Rewrite 0 to $0 in 3rd argument to CMPPS etc.
// That's what the tables expect.
switch p.As {
case ACMPPD, ACMPPS, ACMPSD, ACMPSS:
}
// Preserve highest 8 bits of a, and do addition to lower 24-bit
-// of a and b; used to adjust ARM branch intruction's target
+// of a and b; used to adjust ARM branch instruction's target
func braddoff(a int32, b int32) int32 {
return int32((uint32(a))&0xff000000 | 0x00ffffff&uint32(a+b))
}
}
case obj.Hdarwin: /* apple MACH */
- ld.Debug['w'] = 1 // disable DWARF generataion
+ ld.Debug['w'] = 1 // disable DWARF generation
ld.Machoinit()
ld.HEADR = ld.INITIAL_MACHO_HEADR
if ld.INITTEXT == -1 {
rs := r.Xsym
// ld64 has a bug handling MACHO_ARM64_RELOC_UNSIGNED with !extern relocation.
- // see cmd/internal/ld/data.go for details. The workarond is that don't use !extern
+ // see cmd/internal/ld/data.go for details. The workaround is that don't use !extern
// UNSIGNED relocation at all.
if rs.Type == obj.SHOSTOBJ || r.Type == obj.R_CALLARM64 || r.Type == obj.R_ADDRARM64 || r.Type == obj.R_ADDR {
if rs.Dynid < 0 {
DW_CHILDREN_yes = 0x01
)
-// Not from the spec, but logicaly belongs here
+// Not from the spec, but logically belongs here
const (
DW_CLS_ADDRESS = 0x01 + iota
DW_CLS_BLOCK
}
if needSym != 0 {
- // local names and hidden visiblity global names are unique
- // and should only reference by its index, not name, so we
- // don't bother to add them into hash table
+ // local names and hidden global names are unique
+ // and should only be referenced by their index, not name, so we
+ // don't bother to add them into the hash table
s = linknewsym(Ctxt, sym.name, Ctxt.Version)
s.Type |= obj.SHIDDEN
if Linkmode == LinkInternal {
// For lldb, must say LC_VERSION_MIN_MACOSX or else
// it won't know that this Mach-O binary is from OS X
- // (could be iOS or WatchOS intead).
+ // (could be iOS or WatchOS instead).
// Go on iOS uses linkmode=external, and linkmode=external
// adds this itself. So we only need this code for linkmode=internal
// and we can assume OS X.
addressOrder
)
-// sort reoders the entries in a report based on the specified
+// sort reorders the entries in a report based on the specified
// ordering criteria. The result is sorted in decreasing order for
// numeric quantities, alphabetically for text, and increasing for
// addresses.
return fnodes, filename
}
-// adjustSourcePath adjusts the pathe for a source file by trimmming
+// adjustSourcePath adjusts the path for a source file by trimming
// known prefixes and searching for the file on all parents of the
// current working dir.
func adjustSourcePath(path string) (*os.File, string, error) {
}
if r0.Cmp(r1) == 0 {
- t.Errorf("%s: the nonce used for two diferent messages was the same", tag)
+ t.Errorf("%s: the nonce used for two different messages was the same", tag)
}
}
BEQ aligned // aligned detected - skip copy
// Copy the unaligned source data into the aligned temporary buffer
- // memove(to=4(R13), from=8(R13), n=12(R13)) - Corrupts all registers
+ // memmove(to=4(R13), from=8(R13), n=12(R13)) - Corrupts all registers
MOVW $buf, Rtable // to
MOVW $64, Rc0 // n
MOVM.IB [Rtable,Rdata,Rc0], (R13)
t.Fatalf("%s resumed: %v, expected: %v", test, hs.DidResume, didResume)
}
if didResume && (hs.PeerCertificates == nil || hs.VerifiedChains == nil) {
- t.Fatalf("expected non-nil certificates after resumption. Got peerCertificates: %#v, verifedCertificates: %#v", hs.PeerCertificates, hs.VerifiedChains)
+ t.Fatalf("expected non-nil certificates after resumption. Got peerCertificates: %#v, verifiedCertificates: %#v", hs.PeerCertificates, hs.VerifiedChains)
}
}
}
if have < want {
- t.Errorf("insufficent overlap between cgo and non-cgo roots; want at least %d, have %d", want, have)
+ t.Errorf("insufficient overlap between cgo and non-cgo roots; want at least %d, have %d", want, have)
}
}
_, err := db.Query("SELECT|non_existent|name|")
if err == nil {
- t.Fatal("Quering non-existent table should fail")
+ t.Fatal("Querying non-existent table should fail")
}
}
Class Class
}
-// A Class is the DWARF 4 class of an attibute value.
+// A Class is the DWARF 4 class of an attribute value.
//
// In general, a given attribute's value may take on one of several
// possible classes defined by DWARF, each of which leads to a
_, err := StdEncoding.Decode(dbuf, []byte(tc.input))
if tc.offset == -1 {
if err != nil {
- t.Error("Decoder wrongly detected coruption in", tc.input)
+ t.Error("Decoder wrongly detected corruption in", tc.input)
}
continue
}
_, err := StdEncoding.Decode(dbuf, []byte(tc.input))
if tc.offset == -1 {
if err != nil {
- t.Error("Decoder wrongly detected coruption in", tc.input)
+ t.Error("Decoder wrongly detected corruption in", tc.input)
}
continue
}
for i := 0; i < b.N; i++ {
var r codeResponse
if err := Unmarshal(codeJSON, &r); err != nil {
- b.Fatal("Unmmarshal:", err)
+ b.Fatal("Unmarshal:", err)
}
}
b.SetBytes(int64(len(codeJSON)))
var r codeResponse
for i := 0; i < b.N; i++ {
if err := Unmarshal(codeJSON, &r); err != nil {
- b.Fatal("Unmmarshal:", err)
+ b.Fatal("Unmarshal:", err)
}
}
}
// the result is safe for the shell.
func expandSrcDir(str string, srcdir string) (string, bool) {
// "\" delimited paths cause safeCgoName to fail
- // so convert native paths with a different delimeter
+ // so convert native paths with a different delimiter
// to "/" before starting (eg: on windows).
srcdir = filepath.ToSlash(srcdir)
t.Errorf("shouldBuild(file1) = false, want true")
}
if !reflect.DeepEqual(m, want1) {
- t.Errorf("shoudBuild(file1) tags = %v, want %v", m, want1)
+ t.Errorf("shouldBuild(file1) tags = %v, want %v", m, want1)
}
m = map[string]bool{}
if ctx.shouldBuild([]byte(file2), m) {
- t.Errorf("shouldBuild(file2) = true, want fakse")
+ t.Errorf("shouldBuild(file2) = true, want false")
}
if !reflect.DeepEqual(m, want2) {
- t.Errorf("shoudBuild(file2) tags = %v, want %v", m, want2)
+ t.Errorf("shouldBuild(file2) tags = %v, want %v", m, want2)
}
m = map[string]bool{}
t.Errorf("shouldBuild(file3) = false, want true")
}
if !reflect.DeepEqual(m, want3) {
- t.Errorf("shoudBuild(file3) tags = %v, want %v", m, want3)
+ t.Errorf("shouldBuild(file3) tags = %v, want %v", m, want3)
}
}
// For qualified names, the returned package is nil (and not created if
// it doesn't exist yet) unless materializePkg is set (which creates an
// unnamed package with valid package path). In the latter case, a
-// subequent import clause is expected to provide a name for the package.
+// subsequent import clause is expected to provide a name for the package.
//
func (p *parser) parseName(parent *types.Package, materializePkg bool) (pkg *types.Package, name string) {
pkg = parent
} else {
// an untyped non-constant argument may appear if
// it contains a (yet untyped non-constant) shift
- // epression: convert it to complex128 which will
+ // expression: convert it to complex128 which will
// result in an error (shift of complex value)
check.convertUntyped(x, Typ[Complex128])
// x should be invalid now, but be conservative and check
type A [iota /* ERROR "cannot use iota" */ ]int
-// constant expressions with operands accross different
+// constant expressions with operands across different
// constant declarations must use the right iota values
const (
_c0 = iota
t.Fatal(err)
}
if len(clone.Templates()) != len(orig.Templates()) {
- t.Fatalf("Invalid lenth of t.Clone().Templates()")
+ t.Fatalf("Invalid length of t.Clone().Templates()")
}
const want = "stuff"
// for an image". In practice, though, giflib (a widely used C
// library) does not enforce this, so we also accept lzwr returning
// io.ErrUnexpectedEOF (meaning that the encoded stream hit io.EOF
- // before the LZW decoder saw an explict end code), provided that
+ // before the LZW decoder saw an explicit end code), provided that
// the io.ReadFull call above successfully read len(m.Pix) bytes.
// See https://golang.org/issue/9856 for an example GIF.
if n, err := lzwr.Read(d.tmp[:1]); n != 0 || (err != io.EOF && err != io.ErrUnexpectedEOF) {
}
}
for n, v := range haveNames {
- t.Errorf("value %s (%v) is found while enumerating, but has not been cretaed", n, v)
+ t.Errorf("value %s (%v) is found while enumerating, but has not been created", n, v)
}
}
// read data with short buffer
gotsize, gottype, err = k.GetValue(test.Name, make([]byte, size-1))
if err == nil {
- t.Errorf("GetValue(%s, [%d]byte) should fail, but suceeded", test.Name, size-1)
+ t.Errorf("GetValue(%s, [%d]byte) should fail, but succeeded", test.Name, size-1)
return
}
if err != registry.ErrShortBuffer {
}
if x.form == finite && y.form == finite {
- // x + y (commom case)
+ // x + y (common case)
z.neg = x.neg
if x.neg == y.neg {
// x + y == x + y
if fcount < 0 {
// The mantissa has a "decimal" point ddd.dddd; and
// -fcount is the number of digits to the right of '.'.
- // Adjust relevant exponent accodingly.
+ // Adjust relevant exponent accordingly.
d := int64(fcount)
switch b {
case 10:
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.
// 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},
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)
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")
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
}
// 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 {
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
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
// 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
// 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
// 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
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
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)
}
}
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, "[") {
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="}}},
"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") +
// 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) }
// (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
{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.
}
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() {
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() {
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() {
}
// 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)
}
}
// 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)
}
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)
{"", "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 {
// 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.
//
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" "" - - - -
}
// 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 {
}
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
}
func netshInterfaceIPv6ShowAddress(name string, netshOutput []byte) []string {
- // adress information is listed like:
+ // Address information is listed like:
//
//Address ::1 Parameters
//---------------------------------------------------------
//
// 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
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)
}
}
//
// We want to test that FDs in the child do not get overwritten
// by one another as this shuffle occurs. The original implementation
- // was buggy in that in some data dependent cases it would ovewrite
+ // was buggy in that in some data dependent cases it would overwrite
// stderr in the child with one of the ExtraFile members.
// Testing for this case is difficult because it relies on using
// the same FD values as that case. In particular, an FD of 3
}
// createFiles copies srcPath file into multiply files.
-// It uses dir as preifx for all destination files.
+// It uses dir as prefix for all destination files.
func createFiles(t *testing.T, dir string, files []string, srcPath string) {
for _, f := range files {
installProg(t, filepath.Join(dir, f), srcPath)
},
{
// LookPath(`a.exe`) will find `.\a.exe`, but prefixing that with
- // dir `p\a.exe` will refer to not existant file
+ // dir `p\a.exe` will refer to a non-existent file
files: []string{`a.exe`, `p\not_important_file`},
dir: `p`,
arg0: `a.exe`,
},
{
// like above, but making test succeed by installing file
- // in refered destination (so LookPath(`a.exe`) will still
+ // in referred destination (so LookPath(`a.exe`) will still
// find `.\a.exe`, but we successfully execute `p\a.exe`)
files: []string{`a.exe`, `p\a.exe`},
dir: `p`,
return s
}
- if got, want := names(mustReadDir("inital readdir")),
+ if got, want := names(mustReadDir("initial readdir")),
[]string{"good1", "good2", "x"}; !reflect.DeepEqual(got, want) {
t.Errorf("initial readdir got %q; want %q", got, want)
}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Simple converions to avoid depending on strconv.
+// Simple conversions to avoid depending on strconv.
package os
if err == nil {
return name, nil
}
- // domain worked neigher as a domain nor as a server
+ // domain worked neither as a domain nor as a server
// could be domain server unavailable
// pretend username is fullname
return username, nil
// joinNonEmpty is like join, but it assumes that the first element is non-empty.
func joinNonEmpty(elem []string) string {
if len(elem[0]) == 2 && elem[0][1] == ':' {
- // First element is drive leter without terminating slash.
+ // First element is drive letter without terminating slash.
// Keep path relative to current directory on that drive.
return Clean(elem[0] + strings.Join(elem[1:], string(Separator)))
}
// off the stack into the frame will store an *Inner there, and then if a garbage collection
// happens to scan that argument frame before it is discarded, it will scan the *Inner
// memory as if it were an *Outer. If the two have different memory layouts, the
-// collection will intepret the memory incorrectly.
+// collection will interpret the memory incorrectly.
//
// One such possible incorrect interpretation is to treat two arbitrary memory words
// (Inner.P1 and Inner.P2 below) as an interface (Outer.R below). Because interpreting
// h REG_MULTIREF multiple digit backref
// i REG_ICASE ignore case
// j REG_SPAN . matches \n
- // k REG_ESCAPE \ to ecape [...] delimiter
+ // k REG_ESCAPE \ to escape [...] delimiter
// l REG_LEFT implicit ^...
// m REG_MINIMAL minimal match
// n REG_NEWLINE explicit \n match
// armPublicationBarrier is a native store/store barrier for ARMv7+.
// On earlier ARM revisions, armPublicationBarrier is a no-op.
// This will not work on SMP ARMv6 machines, if any are in use.
-// To implement publiationBarrier in sys_$GOOS_arm.s using the native
+// To implement publicationBarrier in sys_$GOOS_arm.s using the native
// instructions, use:
//
// TEXT ·publicationBarrier(SB),NOSPLIT,$-4-0
var x_cgo_sys_thread_create byte
var _cgo_sys_thread_create = &x_cgo_sys_thread_create
-// Notifies that the runtime has been intialized.
+// Notifies that the runtime has been initialized.
//
// We currently block at every CGO entry point (via _cgo_wait_runtime_init_done)
// to ensure that the runtime has been initialized before the CGO call is
}
e <- 9
}()
- time.Sleep(time.Millisecond) // make sure goroutine A gets qeueued first on c
+ time.Sleep(time.Millisecond) // make sure goroutine A gets queued first on c
// goroutine B
go func() {
ADDQ $128, DI
CMPQ BX, $128
JAE loop_avx2_huge
- // In the desciption of MOVNTDQ in [1]
+ // In the description of MOVNTDQ in [1]
// "... fencing operation implemented with the SFENCE or MFENCE instruction
// should be used in conjunction with MOVNTDQ instructions..."
// [1] 64-ia-32-architectures-software-developer-manual-325462.pdf
BC 12, 9, backward // I think you should be able to write this as "BGT CR2, backward"
// Copying forward proceeds by copying R6 words then copying R7 bytes.
- // R3 and R4 are advanced as we copy. Becuase PPC64 lacks post-increment
+ // R3 and R4 are advanced as we copy. Because PPC64 lacks post-increment
// load/store, R3 and R4 point before the bytes that are to be copied.
BC 12, 6, noforwardlarge // "BEQ CR1, noforwardlarge"
type workbufhdr struct {
node lfnode // must be first
nobj int
- inuse bool // This workbuf is in use by some gorotuine and is not on the work.empty/full queues.
+ inuse bool // This workbuf is in use by some goroutine and is not on the work.empty/full queues.
log [4]int // line numbers forming a history of ownership changes to workbuf
}
//
// The open and arming mechanisms are serialized using the lock
// inside PollDesc. This is required because the netpoll loop runs
-// asynchonously in respect to other Go code and by the time we get
+// asynchronously in respect to other Go code and by the time we get
// to call port_associate to update the association in the loop, the
// file descriptor might have been closed and reopened already. The
// lock allows runtime·netpollupdate to be called synchronously from
lock(&pd.lock)
// We don't register for any specific type of events yet, that's
// netpollarm's job. We merely ensure we call port_associate before
- // asynchonous connect/accept completes, so when we actually want
+ // asynchronous connect/accept completes, so when we actually want
// to do any I/O, the call to port_associate (from netpollarm,
// with the interested event set) will unblock port_getn right away
// because of the I/O readiness notification.
if runqputslow(_p_, gp, h, t) {
return
}
- // the queue is not full, now the put above must suceed
+ // the queue is not full, now the put above must succeed
goto retry
}
// of the larger addresses must themselves be invalid addresses.
// We might get unlucky and the OS might have mapped one of these
// addresses, but probably not: they're all in the first page, very high
-// adderesses that normally an OS would reserve for itself, or malformed
+// addresses that normally an OS would reserve for itself, or malformed
// addresses. Even so, we might have to remove one or two on different
// systems. We will see.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Software floating point interpretaton of ARM 7500 FP instructions.
+// Software floating point interpretation of ARM 7500 FP instructions.
// The interpretation is not bit compatible with the 7500.
// It uses true little-endian doubles, while the 7500 used mixed-endian.
// pipe(3c) wrapper that returns fds in AX, DX.
// NOT USING GO CALLING CONVENTION.
TEXT runtime·pipe1(SB),NOSPLIT,$0
- SUBQ $16, SP // 8 bytes will do, but stack has to be 16-byte alligned
+ SUBQ $16, SP // 8 bytes will do, but stack has to be 16-byte aligned
MOVQ SP, DI
LEAQ libc_pipe(SB), AX
CALL AX
data.initB()
Stable(data)
if !IsSorted(data) {
- t.Errorf("Stable shuffeled sorted %d ints (order)", n)
+ t.Errorf("Stable shuffled sorted %d ints (order)", n)
}
if !data.inOrder() {
- t.Errorf("Stable shuffeled sorted %d ints (stability)", n)
+ t.Errorf("Stable shuffled sorted %d ints (stability)", n)
}
// sorted reversed
//
// - The kernel form appends leading bytes to the prefix field
// to make the <length, prefix> tuple to be conformed with
- // the routing messeage boundary
+ // the routing message boundary
l := int(rsaAlignOf(int(b[0])))
if len(b) < l {
return nil, EINVAL
package template
-// Tests for mulitple-template parsing and execution.
+// Tests for multiple-template parsing and execution.
import (
"bytes"