diff --git a/doc/go1.1.html b/doc/go1.1.html index 4aa5fa55da..49ee97b1c4 100644 --- a/doc/go1.1.html +++ b/doc/go1.1.html @@ -72,21 +72,38 @@ Functions written in assembly will need to be revised at least to adjust frame pointer offsets.

-

Data race detector

+

Changes to the go tool

-

-The implementation now includes a built-in data race detector. +

The go tool has acquired several improvements which are intended to improve the experience for new Go users.

+ +

Firstly, when compiling, testing, or running Go code, the go tool will now give more detailed errors messages, including a list of paths searched, when a package cannot be located.

-

Symbol table

+
+$ go build foo/quxx
+can't load package: package foo/quxx: cannot find package "foo/quxx" in any of:
+        /home/User/go/src/pkg/foo/quxx (from $GOROOT)
+        /home/User/src/foo/quxx (from $GOPATH) 
+

-In the gc toolchain, the symbol table format has been extended to allow -little-endian encoding of symbol values, and the extension is used in -binaries generated by the Go 1.1 version of the gc linker. -To the Go 1.0 toolchain and libraries, these new symbol tables appear empty. +Secondly, the go get command no longer allows $GOROOT as the default destination when downloading package source. To use go get command, a valid $GOPATH is now required.

+
+$ GOPATH= go get code.google.com/p/foo/quxx
+package code.google.com/p/foo/quxx: cannot download, $GOPATH not set. For more details see: go help gopath 
+
+ +

Finally, as a result of the previous change, the go get command will also fail when $GOPATH and $GOROOT are set to the same value. +

+ +
+$ GOPATH=$GOROOT go get code.google.com/p/foo/quxx
+warning: GOPATH set to GOROOT (/home/User/go) has no effect
+package code.google.com/p/foo/quxx: cannot download, $GOPATH must not be set to $GOROOT. For more details see: go help gopath
+
+

Changes to the standard library

debug/elf

diff --git a/src/cmd/go/doc.go b/src/cmd/go/doc.go index 18c5e8818c..09cf9a7f19 100644 --- a/src/cmd/go/doc.go +++ b/src/cmd/go/doc.go @@ -453,7 +453,7 @@ On Unix, the value is a colon-separated string. On Windows, the value is a semicolon-separated string. On Plan 9, the value is a list. -GOPATH must be set to build and install packages outside the +GOPATH must be set to get, build and install packages outside the standard Go tree. Each directory listed in GOPATH must have a prescribed structure: diff --git a/src/cmd/go/get.go b/src/cmd/go/get.go index 0abb2d5288..abcc2ba434 100644 --- a/src/cmd/go/get.go +++ b/src/cmd/go/get.go @@ -247,16 +247,17 @@ func downloadPackage(p *Package) error { } if p.build.SrcRoot == "" { - // Package not found. Put in first directory of $GOPATH or else $GOROOT. - // Guard against people setting GOPATH=$GOROOT. We have to use - // $GOROOT's directory hierarchy (src/pkg, not just src) in that case. - if list := filepath.SplitList(buildContext.GOPATH); len(list) > 0 && list[0] != goroot { - p.build.SrcRoot = filepath.Join(list[0], "src") - p.build.PkgRoot = filepath.Join(list[0], "pkg") - } else { - p.build.SrcRoot = filepath.Join(goroot, "src", "pkg") - p.build.PkgRoot = filepath.Join(goroot, "pkg") + // Package not found. Put in first directory of $GOPATH. + list := filepath.SplitList(buildContext.GOPATH) + if len(list) == 0 { + return fmt.Errorf("cannot download, $GOPATH not set. For more details see: go help gopath") } + // Guard against people setting GOPATH=$GOROOT. + if list[0] == goroot { + return fmt.Errorf("cannot download, $GOPATH must not be set to $GOROOT. For more details see: go help gopath") + } + p.build.SrcRoot = filepath.Join(list[0], "src") + p.build.PkgRoot = filepath.Join(list[0], "pkg") } root := filepath.Join(p.build.SrcRoot, rootPath) // If we've considered this repository already, don't do it again. diff --git a/src/cmd/go/help.go b/src/cmd/go/help.go index 7539753af0..6d2bd7dbb9 100644 --- a/src/cmd/go/help.go +++ b/src/cmd/go/help.go @@ -186,7 +186,7 @@ On Unix, the value is a colon-separated string. On Windows, the value is a semicolon-separated string. On Plan 9, the value is a list. -GOPATH must be set to build and install packages outside the +GOPATH must be set to get, build and install packages outside the standard Go tree. Each directory listed in GOPATH must have a prescribed structure: