diff options
Diffstat (limited to 'src/pkg')
| -rw-r--r-- | src/pkg/go/build/build.go | 23 | ||||
| -rw-r--r-- | src/pkg/math/sqrt.go | 2 | ||||
| -rw-r--r-- | src/pkg/net/http/httptest/server.go | 2 | ||||
| -rw-r--r-- | src/pkg/net/smtp/smtp_test.go | 2 | ||||
| -rw-r--r-- | src/pkg/reflect/type.go | 2 | ||||
| -rw-r--r-- | src/pkg/reflect/value.go | 2 | ||||
| -rw-r--r-- | src/pkg/runtime/Makefile | 2 | ||||
| -rw-r--r-- | src/pkg/runtime/debug/stack_test.go | 18 | ||||
| -rw-r--r-- | src/pkg/runtime/pprof/pprof_test.go | 42 | ||||
| -rw-r--r-- | src/pkg/runtime/race/race.go | 2 | ||||
| -rw-r--r-- | src/pkg/runtime/runtime_test.go | 2 | ||||
| -rw-r--r-- | src/pkg/sync/atomic/race.s | 2 |
12 files changed, 45 insertions, 56 deletions
diff --git a/src/pkg/go/build/build.go b/src/pkg/go/build/build.go index 1a133041e8..69cb4b2f6b 100644 --- a/src/pkg/go/build/build.go +++ b/src/pkg/go/build/build.go @@ -207,9 +207,7 @@ func (ctxt *Context) gopath() []string { if p == "" || p == ctxt.GOROOT { // Empty paths are uninteresting. // If the path is the GOROOT, ignore it. - // People sometimes set GOPATH=$GOROOT, which is useless - // but would cause us to find packages with import paths - // like "pkg/math". + // People sometimes set GOPATH=$GOROOT. // Do not get confused by this common mistake. continue } @@ -239,7 +237,7 @@ func (ctxt *Context) gopath() []string { func (ctxt *Context) SrcDirs() []string { var all []string if ctxt.GOROOT != "" { - dir := ctxt.joinPath(ctxt.GOROOT, "src", "pkg") + dir := ctxt.joinPath(ctxt.GOROOT, "src") if ctxt.isDir(dir) { all = append(all, dir) } @@ -479,7 +477,7 @@ func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Packa } // Determine canonical import path, if any. if ctxt.GOROOT != "" { - root := ctxt.joinPath(ctxt.GOROOT, "src", "pkg") + root := ctxt.joinPath(ctxt.GOROOT, "src") if sub, ok := ctxt.hasSubdir(root, p.Dir); ok { p.Goroot = true p.ImportPath = sub @@ -495,7 +493,7 @@ func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Packa // but check that using it wouldn't find something // else first. if ctxt.GOROOT != "" { - if dir := ctxt.joinPath(ctxt.GOROOT, "src", "pkg", sub); ctxt.isDir(dir) { + if dir := ctxt.joinPath(ctxt.GOROOT, "src", sub); ctxt.isDir(dir) { p.ConflictDir = dir goto Found } @@ -529,12 +527,7 @@ func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Packa // Determine directory from import path. if ctxt.GOROOT != "" { - var dir string - if strings.HasPrefix(path, "cmd/") { - dir = ctxt.joinPath(ctxt.GOROOT, "src", path) - } else { - dir = ctxt.joinPath(ctxt.GOROOT, "src", "pkg", path) - } + dir := ctxt.joinPath(ctxt.GOROOT, "src", path) isDir := ctxt.isDir(dir) binaryOnly = !isDir && mode&AllowBinary != 0 && pkga != "" && ctxt.isFile(ctxt.joinPath(ctxt.GOROOT, pkga)) if isDir || binaryOnly { @@ -580,11 +573,7 @@ func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Packa Found: if p.Root != "" { - if p.Goroot { - p.SrcRoot = ctxt.joinPath(p.Root, "src", "pkg") - } else { - p.SrcRoot = ctxt.joinPath(p.Root, "src") - } + p.SrcRoot = ctxt.joinPath(p.Root, "src") p.PkgRoot = ctxt.joinPath(p.Root, "pkg") p.BinDir = ctxt.joinPath(p.Root, "bin") if pkga != "" { diff --git a/src/pkg/math/sqrt.go b/src/pkg/math/sqrt.go index 1bd4437f15..fdc869992e 100644 --- a/src/pkg/math/sqrt.go +++ b/src/pkg/math/sqrt.go @@ -80,7 +80,7 @@ package math // // // Notes: Rounding mode detection omitted. The constants "mask", "shift", -// and "bias" are found in src/pkg/math/bits.go +// and "bias" are found in src/math/bits.go // Sqrt returns the square root of x. // diff --git a/src/pkg/net/http/httptest/server.go b/src/pkg/net/http/httptest/server.go index 7f265552f5..789e7bf41e 100644 --- a/src/pkg/net/http/httptest/server.go +++ b/src/pkg/net/http/httptest/server.go @@ -203,7 +203,7 @@ func (h *waitGroupHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // localhostCert is a PEM-encoded TLS cert with SAN IPs // "127.0.0.1" and "[::1]", expiring at the last second of 2049 (the end // of ASN.1 time). -// generated from src/pkg/crypto/tls: +// generated from src/crypto/tls: // go run generate_cert.go --rsa-bits 512 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h var localhostCert = []byte(`-----BEGIN CERTIFICATE----- MIIBdzCCASOgAwIBAgIBADALBgkqhkiG9w0BAQUwEjEQMA4GA1UEChMHQWNtZSBD diff --git a/src/pkg/net/smtp/smtp_test.go b/src/pkg/net/smtp/smtp_test.go index 3fba1ea5ae..5c659e8a09 100644 --- a/src/pkg/net/smtp/smtp_test.go +++ b/src/pkg/net/smtp/smtp_test.go @@ -669,7 +669,7 @@ func sendMail(hostPort string) error { // localhostCert is a PEM-encoded TLS cert with SAN IPs // "127.0.0.1" and "[::1]", expiring at the last second of 2049 (the end // of ASN.1 time). -// generated from src/pkg/crypto/tls: +// generated from src/crypto/tls: // go run generate_cert.go --rsa-bits 512 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h var localhostCert = []byte(`-----BEGIN CERTIFICATE----- MIIBdzCCASOgAwIBAgIBADALBgkqhkiG9w0BAQUwEjEQMA4GA1UEChMHQWNtZSBD diff --git a/src/pkg/reflect/type.go b/src/pkg/reflect/type.go index 47aecd0023..6817cd74d7 100644 --- a/src/pkg/reflect/type.go +++ b/src/pkg/reflect/type.go @@ -1563,7 +1563,7 @@ const ( bitsPointer = 2 ) -// Make sure these routines stay in sync with ../../pkg/runtime/hashmap.go! +// Make sure these routines stay in sync with ../../runtime/hashmap.go! // These types exist only for GC, so we only fill out GC relevant info. // Currently, that's just size and the GC program. We also fill in string // for possible debugging use. diff --git a/src/pkg/reflect/value.go b/src/pkg/reflect/value.go index adaafab9c9..368116a507 100644 --- a/src/pkg/reflect/value.go +++ b/src/pkg/reflect/value.go @@ -2679,7 +2679,7 @@ func cvtI2I(v Value, typ Type) Value { return cvtT2I(v.Elem(), typ) } -// implemented in ../pkg/runtime +// implemented in ../runtime func chancap(ch unsafe.Pointer) int func chanclose(ch unsafe.Pointer) func chanlen(ch unsafe.Pointer) int diff --git a/src/pkg/runtime/Makefile b/src/pkg/runtime/Makefile index 5827ce134c..55087def04 100644 --- a/src/pkg/runtime/Makefile +++ b/src/pkg/runtime/Makefile @@ -2,4 +2,4 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -include ../../Make.dist +include ../Make.dist diff --git a/src/pkg/runtime/debug/stack_test.go b/src/pkg/runtime/debug/stack_test.go index bbd662618f..28691ee4d5 100644 --- a/src/pkg/runtime/debug/stack_test.go +++ b/src/pkg/runtime/debug/stack_test.go @@ -22,15 +22,15 @@ func (t T) method() []byte { The traceback should look something like this, modulo line numbers and hex constants. Don't worry much about the base levels, but check the ones in our own package. - /Users/r/go/src/pkg/runtime/debug/stack_test.go:15 (0x13878) + /Users/r/go/src/runtime/debug/stack_test.go:15 (0x13878) (*T).ptrmethod: return Stack() - /Users/r/go/src/pkg/runtime/debug/stack_test.go:18 (0x138dd) + /Users/r/go/src/runtime/debug/stack_test.go:18 (0x138dd) T.method: return t.ptrmethod() - /Users/r/go/src/pkg/runtime/debug/stack_test.go:23 (0x13920) + /Users/r/go/src/runtime/debug/stack_test.go:23 (0x13920) TestStack: b := T(0).method() - /Users/r/go/src/pkg/testing/testing.go:132 (0x14a7a) + /Users/r/go/src/testing/testing.go:132 (0x14a7a) tRunner: test.F(t) - /Users/r/go/src/pkg/runtime/proc.c:145 (0xc970) + /Users/r/go/src/runtime/proc.c:145 (0xc970) ???: runtimeĀ·unlock(&runtimeĀ·sched); */ func TestStack(t *testing.T) { @@ -49,10 +49,10 @@ func TestStack(t *testing.T) { n++ } } - frame("src/pkg/runtime/debug/stack_test.go", "\t(*T).ptrmethod: return Stack()") - frame("src/pkg/runtime/debug/stack_test.go", "\tT.method: return t.ptrmethod()") - frame("src/pkg/runtime/debug/stack_test.go", "\tTestStack: b := T(0).method()") - frame("src/pkg/testing/testing.go", "") + frame("src/runtime/debug/stack_test.go", "\t(*T).ptrmethod: return Stack()") + frame("src/runtime/debug/stack_test.go", "\tT.method: return t.ptrmethod()") + frame("src/runtime/debug/stack_test.go", "\tTestStack: b := T(0).method()") + frame("src/testing/testing.go", "") } func check(t *testing.T, line, has string) { diff --git a/src/pkg/runtime/pprof/pprof_test.go b/src/pkg/runtime/pprof/pprof_test.go index df271273ce..54f93f8610 100644 --- a/src/pkg/runtime/pprof/pprof_test.go +++ b/src/pkg/runtime/pprof/pprof_test.go @@ -310,45 +310,45 @@ func TestBlockProfile(t *testing.T) { tests := [...]TestCase{ {"chan recv", blockChanRecv, ` [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ -# 0x[0-9,a-f]+ runtime\.chanrecv1\+0x[0-9,a-f]+ .*/src/pkg/runtime/chan.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.blockChanRecv\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime\.chanrecv1\+0x[0-9,a-f]+ .*/src/runtime/chan.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.blockChanRecv\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ `}, {"chan send", blockChanSend, ` [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ -# 0x[0-9,a-f]+ runtime\.chansend1\+0x[0-9,a-f]+ .*/src/pkg/runtime/chan.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.blockChanSend\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime\.chansend1\+0x[0-9,a-f]+ .*/src/runtime/chan.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.blockChanSend\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ `}, {"chan close", blockChanClose, ` [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ -# 0x[0-9,a-f]+ runtime\.chanrecv1\+0x[0-9,a-f]+ .*/src/pkg/runtime/chan.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.blockChanClose\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime\.chanrecv1\+0x[0-9,a-f]+ .*/src/runtime/chan.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.blockChanClose\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ `}, {"select recv async", blockSelectRecvAsync, ` [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ -# 0x[0-9,a-f]+ runtime\.selectgo\+0x[0-9,a-f]+ .*/src/pkg/runtime/select.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.blockSelectRecvAsync\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime\.selectgo\+0x[0-9,a-f]+ .*/src/runtime/select.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.blockSelectRecvAsync\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ `}, {"select send sync", blockSelectSendSync, ` [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ -# 0x[0-9,a-f]+ runtime\.selectgo\+0x[0-9,a-f]+ .*/src/pkg/runtime/select.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.blockSelectSendSync\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime\.selectgo\+0x[0-9,a-f]+ .*/src/runtime/select.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.blockSelectSendSync\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ `}, {"mutex", blockMutex, ` [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ -# 0x[0-9,a-f]+ sync\.\(\*Mutex\)\.Lock\+0x[0-9,a-f]+ .*/src/pkg/sync/mutex\.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.blockMutex\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ sync\.\(\*Mutex\)\.Lock\+0x[0-9,a-f]+ .*/src/sync/mutex\.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.blockMutex\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ `}, {"cond", blockCond, ` [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ -# 0x[0-9,a-f]+ sync\.\(\*Cond\)\.Wait\+0x[0-9,a-f]+ .*/src/pkg/sync/cond\.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.blockCond\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ -# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ sync\.\(\*Cond\)\.Wait\+0x[0-9,a-f]+ .*/src/sync/cond\.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.blockCond\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ +# 0x[0-9,a-f]+ runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+ `}, } diff --git a/src/pkg/runtime/race/race.go b/src/pkg/runtime/race/race.go index 3c297e84b2..31deedd73d 100644 --- a/src/pkg/runtime/race/race.go +++ b/src/pkg/runtime/race/race.go @@ -9,7 +9,7 @@ package race // This file merely ensures that we link in runtime/cgo in race build, // this is turn ensures that runtime uses pthread_create to create threads. // The prebuilt race runtime lives in race_GOOS_GOARCH.syso. -// Calls to the runtime are done directly from src/pkg/runtime/race.c. +// Calls to the runtime are done directly from src/runtime/race.c. // void __race_unused_func(void); import "C" diff --git a/src/pkg/runtime/runtime_test.go b/src/pkg/runtime/runtime_test.go index 5e24e2570c..cffc9f7d35 100644 --- a/src/pkg/runtime/runtime_test.go +++ b/src/pkg/runtime/runtime_test.go @@ -106,7 +106,7 @@ func TestRuntimeGogoBytes(t *testing.T) { } defer os.RemoveAll(dir) - out, err := exec.Command("go", "build", "-o", dir+"/hello", "../../../test/helloworld.go").CombinedOutput() + out, err := exec.Command("go", "build", "-o", dir+"/hello", "../../test/helloworld.go").CombinedOutput() if err != nil { t.Fatalf("building hello world: %v\n%s", err, out) } diff --git a/src/pkg/sync/atomic/race.s b/src/pkg/sync/atomic/race.s index 4dadc9ed7e..bdce7668bc 100644 --- a/src/pkg/sync/atomic/race.s +++ b/src/pkg/sync/atomic/race.s @@ -5,4 +5,4 @@ // +build race // This file is here only to allow external functions. -// The operations are implemented in src/pkg/runtime/race_amd64.s +// The operations are implemented in src/runtime/race_amd64.s |
