mirror of https://github.com/golang/go.git
all: fix typos and spelling
Change-Id: Icd06d99c42b8299fd931c7da821e1f418684d913 Reviewed-on: https://go-review.googlesource.com/19829 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
4feb47bc76
commit
fdd0179bb1
|
|
@ -705,7 +705,7 @@ func (b *Writer) ReadFrom(r io.Reader) (n int64, err error) {
|
|||
}
|
||||
}
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ func TestSplitError(t *testing.T) {
|
|||
// 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 {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ The GOOS and GOARCH environment variables set the desired target.
|
|||
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
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ again:
|
|||
//
|
||||
// LSTXR reg ',' addr ',' reg
|
||||
// {
|
||||
// outtcode($1, &$2, &$4, &$6);
|
||||
// outcode($1, &$2, &$4, &$6);
|
||||
// }
|
||||
LDAXRW (R0), R2
|
||||
STLXRW R1, (R0), R3
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ var (
|
|||
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 (
|
||||
|
|
@ -29,7 +29,7 @@ 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")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ func elimshortmov(g *gc.Graph) {
|
|||
}
|
||||
|
||||
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).
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ func dodiv(op gc.Op, nl *gc.Node, nr *gc.Node, res *gc.Node) {
|
|||
// 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
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ amount of space to hold the list without the need to grow it later.
|
|||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import (
|
|||
"math"
|
||||
)
|
||||
|
||||
/// implements float arihmetic
|
||||
// implements float arithmetic
|
||||
|
||||
func newMpflt() *Mpflt {
|
||||
var a Mpflt
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ func ordercall(n *Node, order *Order) {
|
|||
|
||||
// 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:
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ func addedge(from *BasicBlock, to *BasicBlock) {
|
|||
}
|
||||
|
||||
// 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,
|
||||
|
|
|
|||
|
|
@ -1380,7 +1380,7 @@ func dalgsym(t *Type) *Sym {
|
|||
// 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.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ func dodiv(op gc.Op, nl *gc.Node, nr *gc.Node, res *gc.Node) {
|
|||
// 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
|
||||
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ func elimshortmov(g *gc.Graph) {
|
|||
}
|
||||
|
||||
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).
|
||||
|
|
|
|||
|
|
@ -1150,7 +1150,7 @@ func defaulttarg() string {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -2122,7 +2122,7 @@ func TestIssue7108(t *testing.T) {
|
|||
// 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)
|
||||
|
|
|
|||
|
|
@ -1220,7 +1220,7 @@ var isGoRelease = strings.HasPrefix(runtime.Version(), "go1")
|
|||
// 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.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ func progedit(ctxt *obj.Link, p *obj.Prog) {
|
|||
}
|
||||
}
|
||||
|
||||
// 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:
|
||||
|
|
|
|||
|
|
@ -1234,7 +1234,7 @@ func markregused(ctxt *obj.Link, s *Sch) {
|
|||
}
|
||||
|
||||
/*
|
||||
* 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 {
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ func progedit(ctxt *obj.Link, p *obj.Prog) {
|
|||
}
|
||||
}
|
||||
|
||||
// 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:
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ func gentext() {
|
|||
}
|
||||
|
||||
// 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))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ func archinit() {
|
|||
}
|
||||
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ func machoreloc1(r *ld.Reloc, sectoff int64) int {
|
|||
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 {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ const (
|
|||
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
|
||||
|
|
|
|||
|
|
@ -1066,9 +1066,9 @@ func readelfsym(elfobj *ElfObj, i int, sym *ElfSym, needSym int) (err error) {
|
|||
}
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ func Asmbmacho() {
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -1340,7 +1340,7 @@ const (
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ func getMissingFunctionSource(filename string, asm map[int]nodes, start, end int
|
|||
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) {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ func testNonceSafety(t *testing.T, c elliptic.Curve, tag string) {
|
|||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ loop:
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ func TestClientResumption(t *testing.T) {
|
|||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,6 @@ func TestSystemRoots(t *testing.T) {
|
|||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1591,7 +1591,7 @@ func TestStmtCloseOrder(t *testing.T) {
|
|||
|
||||
_, 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")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ type Field struct {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ func TestDecodeCorrupt(t *testing.T) {
|
|||
_, 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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ func TestDecodeCorrupt(t *testing.T) {
|
|||
_, 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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ func BenchmarkCodeUnmarshal(b *testing.B) {
|
|||
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)))
|
||||
|
|
@ -173,7 +173,7 @@ func BenchmarkCodeUnmarshalReuse(b *testing.B) {
|
|||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1230,7 +1230,7 @@ func (ctxt *Context) saveCgo(filename string, di *Package, cg *ast.CommentGroup)
|
|||
// 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)
|
||||
|
||||
|
|
|
|||
|
|
@ -155,15 +155,15 @@ func TestShouldBuild(t *testing.T) {
|
|||
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{}
|
||||
|
|
@ -172,7 +172,7 @@ func TestShouldBuild(t *testing.T) {
|
|||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ func (p *parser) parseMapType(parent *types.Package) types.Type {
|
|||
// 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
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
|
|||
} 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
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ const (
|
|||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ func TestTemplateClone(t *testing.T) {
|
|||
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"
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ func (d *decoder) decode(r io.Reader, configOnly bool) error {
|
|||
// 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) {
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ func enumerateValues(t *testing.T, k registry.Key) {
|
|||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -335,7 +335,7 @@ func testGetValue(t *testing.T, k registry.Key, test ValueTest, size int) {
|
|||
// 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 {
|
||||
|
|
|
|||
|
|
@ -1427,7 +1427,7 @@ func (z *Float) Add(x, y *Float) *Float {
|
|||
}
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ func (z *Float) scan(r io.ByteScanner, base int) (f *Float, b int, err error) {
|
|||
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:
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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, "[") {
|
||||
|
|
|
|||
|
|
@ -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="}}},
|
||||
|
|
|
|||
|
|
@ -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") +
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
//---------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ func TestExtraFilesFDShuffle(t *testing.T) {
|
|||
//
|
||||
// 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
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ func createEnv(dir, PATH, PATHEXT string) []string {
|
|||
}
|
||||
|
||||
// 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)
|
||||
|
|
@ -431,7 +431,7 @@ var commandTests = []commandTest{
|
|||
},
|
||||
{
|
||||
// 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`,
|
||||
|
|
@ -440,7 +440,7 @@ var commandTests = []commandTest{
|
|||
},
|
||||
{
|
||||
// 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`,
|
||||
|
|
|
|||
|
|
@ -538,7 +538,7 @@ func TestReaddirStatFailures(t *testing.T) {
|
|||
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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// 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
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ func lookupFullName(domain, username, domainAndUser string) (string, error) {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ func join(elem []string) string {
|
|||
// 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)))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4465,7 +4465,7 @@ func TestFieldByIndexNil(t *testing.T) {
|
|||
// 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
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ Reading:
|
|||
// 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
|
||||
|
|
|
|||
|
|
@ -706,7 +706,7 @@ TEXT runtime·abort(SB),NOSPLIT,$-4-0
|
|||
// 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
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ var _cgo_thread_start = &x_cgo_thread_start
|
|||
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
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ func TestSelectDuplicateChannel(t *testing.T) {
|
|||
}
|
||||
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() {
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ loop_avx2_huge:
|
|||
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
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ check:
|
|||
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"
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ func (w *gcWork) empty() bool {
|
|||
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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ import "unsafe"
|
|||
//
|
||||
// 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
|
||||
|
|
@ -125,7 +125,7 @@ func netpollopen(fd uintptr, pd *pollDesc) int32 {
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -3910,7 +3910,7 @@ retry:
|
|||
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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ func TestStopCPUProfilingWithProfilerOff(t *testing.T) {
|
|||
// 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.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ TEXT runtime·nanotime1(SB),NOSPLIT,$0
|
|||
// 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
|
||||
|
|
|
|||
|
|
@ -506,10 +506,10 @@ func TestStability(t *testing.T) {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ func parseNetworkLayerAddr(b []byte, family byte) (Sockaddr, error) {
|
|||
//
|
||||
// - 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
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
package template
|
||||
|
||||
// Tests for mulitple-template parsing and execution.
|
||||
// Tests for multiple-template parsing and execution.
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
|
|
|||
Loading…
Reference in New Issue