if v.Type.IsMemory() {
// All memory ops aren't needed here, but we do need
// to keep calls at least (because they might have
- // syncronization operations we can't see).
+ // synchronization operations we can't see).
return false
}
if v.Op.HasSideEffects() {
Written by hand.
Test case for getting a package that has been moved to a nested module,
-with a +incompatible verison (and thus no go.mod file) at the root module.
+with a +incompatible version (and thus no go.mod file) at the root module.
-- .mod --
module example.com/split-incompatible/subpkg
-# This test checks error messages for non-existant packages in module mode.
+# This test checks error messages for non-existent packages in module mode.
# Veries golang.org/issue/35414
env GO111MODULE=on
cd $WORK
go install cmd/addr2line
! stderr .
-# 'go run' with a verison should fail due to syntax.
+# 'go run' with a version should fail due to syntax.
! go run example.com/printversion@v1.0.0
stderr 'can only use path@version syntax with'
stdout -count=1 '{"Time":"[0-9TZ:.+-]{20,40}","Action":"output","Package":"command-line-arguments","Test":"TestChattyParallel/sub-2","Output":"=== CONT TestChattyParallel/sub-2\\n"}\n{"Time":"[0-9TZ:.+-]{20,40}","Action":"output","Package":"command-line-arguments","Test":"TestChattyParallel/sub-2","Output":" chatty_parallel_test.go:38: error from sub-2\\n"}'
-- chatty_parallel_test.go --
-package chatty_paralell_test
+package chatty_parallel_test
import (
"testing"
stdout -count=2 '{"Time":"[0-9TZ:.+-]{20,40}","Action":"output","Package":"command-line-arguments","Test":"TestChattyParallel/sub-2","Output":"=== CONT TestChattyParallel/sub-2\\n"}\n{"Time":"[0-9TZ:.+-]{20,40}","Action":"output","Package":"command-line-arguments","Test":"TestChattyParallel/sub-2","Output":" chatty_parallel_test.go:32: this is sub-2\\n"}'
-- chatty_parallel_test.go --
-package chatty_paralell_test
+package chatty_parallel_test
import (
"testing"
stdout '--- PASS: TestFast \([0-9.]{4}s\)\n=== CONT TestSlow\n chatty_parallel_test.go:31: this is the second TestSlow log\n--- PASS: TestSlow \([0-9.]{4}s\)'
-- chatty_parallel_test.go --
-package chatty_paralell_test
+package chatty_parallel_test
import (
"testing"
continue
}
if e.Type != EntryGoObj {
- t.Errorf("wrong type of object: wnat EntryGoObj, got %v", e.Type)
+ t.Errorf("wrong type of object: want EntryGoObj, got %v", e.Type)
}
if !bytes.Contains(e.Obj.TextHeader, []byte(runtime.GOARCH)) {
t.Errorf("text header does not contain GOARCH %s: %q", runtime.GOARCH, e.Obj.TextHeader)
continue
}
if e.Type != EntryGoObj {
- t.Errorf("wrong type of object: wnat EntryGoObj, got %v", e.Type)
+ t.Errorf("wrong type of object: want EntryGoObj, got %v", e.Type)
}
if !bytes.Contains(e.Obj.TextHeader, []byte(runtime.GOARCH)) {
t.Errorf("text header does not contain GOARCH %s: %q", runtime.GOARCH, e.Obj.TextHeader)
func (r *RefFlags) Write(w *Writer) { w.Bytes(r[:]) }
-// Used to construct an artifically large array type when reading an
+// Used to construct an artificially large array type when reading an
// item from the object file relocs section or aux sym section (needs
// to work on 32-bit as well as 64-bit). See issue 41621.
const huge = (1<<31 - 1) / RelocSize
func (w *writer) Hash64(s *LSym) {
if !s.ContentAddressable() || len(s.R) != 0 {
- panic("Hash of non-content-addresable symbol")
+ panic("Hash of non-content-addressable symbol")
}
b := contentHash64(s)
w.Bytes(b[:])
func (w *writer) Hash(s *LSym) {
if !s.ContentAddressable() {
- panic("Hash of non-content-addresable symbol")
+ panic("Hash of non-content-addressable symbol")
}
b := w.contentHash(s)
w.Bytes(b[:])
oldval := val
fn := func_.Func()
if fn.Text == nil {
- // Return the emtpy symbol we've built so far.
+ // Return the empty symbol we've built so far.
return sym
}
func fusedJump(p *obj.Prog) (bool, uint8) {
var fusedSize uint8
- // The first instruction in a macro fused pair may be preceeded by the LOCK prefix,
+ // The first instruction in a macro fused pair may be preceded by the LOCK prefix,
// or possibly an XACQUIRE/XRELEASE prefix followed by a LOCK prefix. If it is, we
// need to be careful to insert any padding before the locks rather than directly after them.
}
// addGeneratedSym adds a generator symbol to pclntab, returning the new Sym.
-// It is the caller's responsibilty to save they symbol in state.
+// It is the caller's responsibility to save they symbol in state.
func (state *pclntab) addGeneratedSym(ctxt *Link, name string, size int64, f generatorFunc) loader.Sym {
size = Rnd(size, int64(ctxt.Arch.PtrSize))
state.size += size
// then not loading extra filenames), and just use the hash value of the
// symbol name to do this cataloging.
//
- // TOOD: Store filenames as symbols. (Note this would be easiest if you
+ // TODO: Store filenames as symbols. (Note this would be easiest if you
// also move strings to ALWAYS using the larger content addressable hash
// function, and use that hash value for uniqueness testing.)
cuEntries := make([]goobj.CUFileIndex, len(compUnits))
// regular compiler-generated Go symbols), but in the case of
// building with "-linkshared" (when a symbol is read from a
// shared library), will hold the library name.
-// NOTE: this correspondes to sym.Symbol.File field.
+// NOTE: this corresponds to sym.Symbol.File field.
func (l *Loader) SymPkg(i Sym) string {
if f, ok := l.symPkg[i]; ok {
return f
}
if c.DidResume {
return nil
- // The SCTs and OCSP Responce are dropped on resumption.
+ // The SCTs and OCSP Response are dropped on resumption.
// See http://golang.org/issue/39075.
}
if len(c.OCSPResponse) == 0 {
}
if c.DidResume {
return nil
- // The SCTs and OCSP Responce are dropped on resumption.
+ // The SCTs and OCSP Response are dropped on resumption.
// See http://golang.org/issue/39075.
}
if len(c.OCSPResponse) == 0 {
}
if c.DidResume {
return nil
- // The SCTs and OCSP Responce are dropped on resumption.
+ // The SCTs and OCSP Response are dropped on resumption.
// See http://golang.org/issue/39075.
}
if len(c.OCSPResponse) == 0 {
// Go supports Linux >= 2.6.33, so the system call
// may not be present.
//
- // If we see ENOSYS, we have certainly not transfered
+ // If we see ENOSYS, we have certainly not transferred
// any data, so we can tell the caller that we
// couldn't handle the transfer and let them fall
// back to more generic code.
// Prior to Linux 5.3, it was not possible to
// copy_file_range across file systems. Similarly to
// the ENOSYS case above, if we see EXDEV, we have
- // not transfered any data, and we can let the caller
+ // not transferred any data, and we can let the caller
// fall back to generic code.
//
// As for EINVAL, that is what we see if, for example,
// dst or src refer to a pipe rather than a regular
// file. This is another case where no data has been
- // transfered, so we consider it unhandled.
+ // transferred, so we consider it unhandled.
//
// If src and dst are on CIFS, we can see EIO.
// See issue #42334.
t.Fatal(err)
}
if n != int64(len(data)) {
- t.Fatalf("transfered %d, want %d", n, len(data))
+ t.Fatalf("transferred %d, want %d", n, len(data))
}
if !hook.called {
t.Fatalf("should have called poll.CopyFileRange")
t.Fatal(err)
}
if n != int64(len(data)) {
- t.Fatalf("transfered %d, want %d", n, len(data))
+ t.Fatalf("transferred %d, want %d", n, len(data))
}
if !hook.called {
t.Fatalf("should have called poll.CopyFileRange")
t.Fatal(err)
}
if n != int64(len(data)) {
- t.Fatalf("transfered %d, want %d", n, len(data))
+ t.Fatalf("transferred %d, want %d", n, len(data))
}
if !hook.called {
t.Fatalf("should have called poll.CopyFileRange")
// channel. See issue 40641 for more details on the problem.
//
// The way we try to induce this failure is to set up two
- // goroutines: a sender and a reciever that communicate across
+ // goroutines: a sender and a receiver that communicate across
// a channel. We try to set up a situation where the sender
// grows its stack temporarily then *fully* blocks on a channel
// often. Meanwhile a GC is triggered so that we try to get a
go send(c, done)
// Wait a little bit before triggering
// the GC to make sure the sender and
- // reciever have gotten into their groove.
+ // receiver have gotten into their groove.
time.Sleep(50 * time.Microsecond)
runtime.GC()
<-done
func lockWithRankMayAcquire(l *mutex, rank lockRank) {
gp := getg()
if gp.m.locksHeldLen == 0 {
- // No possibilty of lock ordering problem if no other locks held
+ // No possibility of lock ordering problem if no other locks held
return
}
// Acquire the metricsSema but with handoff. This operation
// is expensive enough that queueing up goroutines and handing
- // off between them will be noticably better-behaved.
+ // off between them will be noticeably better-behaved.
semacquire1(&metricsSema, true, 0, 0)
// Ensure the map is initialized.
// Ready the goroutine by injecting it. We use injectglist instead
// of ready or goready in order to allow us to run this function
// without a P. injectglist also avoids placing the goroutine in
- // the current P's runnext slot, which is desireable to prevent
+ // the current P's runnext slot, which is desirable to prevent
// the scavenger from interfering with user goroutine scheduling
// too much.
var list gList
// opt, an earlier pass, has already replaced it.
// The fix for this issue allows prove to zero a right shift that was added as
// part of the less-than-optimal reqwrite. That change by prove then allows
-// lateopt to clean up all the unneccesary parts of the original division
+// lateopt to clean up all the unnecessary parts of the original division
// replacement. See issue #36159.
func divShiftClean(n int) int {
if n < 0 {