mirror of https://github.com/golang/go.git
all: use golang.org/x/... import paths
LGTM=rsc, r R=r, rsc CC=golang-codereview, golang-codereviews https://golang.org/cl/168050043
This commit is contained in:
parent
68e2dbe8b7
commit
7f0be1f781
|
|
@ -78,17 +78,18 @@ well-established conventions.</p>
|
||||||
source code. For Bitbucket, GitHub, Google Code, and Launchpad, the
|
source code. For Bitbucket, GitHub, Google Code, and Launchpad, the
|
||||||
root directory of the repository is identified by the repository's
|
root directory of the repository is identified by the repository's
|
||||||
main URL, without the <code>http://</code> prefix. Subdirectories are named by
|
main URL, without the <code>http://</code> prefix. Subdirectories are named by
|
||||||
adding to that path. For example, the supplemental networking
|
adding to that path.
|
||||||
libraries for Go are obtained by running</p>
|
For example, the Go example programs are obtained by running</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
hg clone http://code.google.com/p/go.net
|
git clone https://github.com/golang/example
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>and thus the import path for the root directory of that repository is
|
<p>and thus the import path for the root directory of that repository is
|
||||||
"<code>code.google.com/p/go.net</code>". The websocket package is stored in a
|
"<code>github.com/golang/example</code>".
|
||||||
subdirectory, so its import path is
|
The <a href="https://godoc.org/github.com/golang/example/stringutil">stringutil</a>
|
||||||
"<code>code.google.com/p/go.net/websocket</code>".</p>
|
package is stored in a subdirectory, so its import path is
|
||||||
|
"<code>github.com/golang/example/stringutil</code>".</p>
|
||||||
|
|
||||||
<p>These paths are on the long side, but in exchange we get an
|
<p>These paths are on the long side, but in exchange we get an
|
||||||
automatically managed name space for import paths and the ability for
|
automatically managed name space for import paths and the ability for
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ details.
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="//godoc.org/code.google.com/p/go.tools/cmd/cover/">cover</a></td>
|
<td><a href="//godoc.org/golang.org/x/tools/cmd/cover/">cover</a></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td>Cover is a program for creating and analyzing the coverage profiles
|
<td>Cover is a program for creating and analyzing the coverage profiles
|
||||||
generated by <code>"go test -coverprofile"</code>.</td>
|
generated by <code>"go test -coverprofile"</code>.</td>
|
||||||
|
|
@ -83,13 +83,13 @@ gofmt</a> command with more general options.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="//godoc.org/code.google.com/p/go.tools/cmd/godoc/">godoc</a></td>
|
<td><a href="//godoc.org/golang.org/x/tools/cmd/godoc/">godoc</a></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td>Godoc extracts and generates documentation for Go packages.</td>
|
<td>Godoc extracts and generates documentation for Go packages.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="//godoc.org/code.google.com/p/go.tools/cmd/vet/">vet</a></td>
|
<td><a href="//godoc.org/golang.org/x/tools/cmd/vet/">vet</a></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td>Vet examines Go source code and reports suspicious constructs, such as Printf
|
<td>Vet examines Go source code and reports suspicious constructs, such as Printf
|
||||||
calls whose arguments do not align with the format string.</td>
|
calls whose arguments do not align with the format string.</td>
|
||||||
|
|
|
||||||
181
doc/code.html
181
doc/code.html
|
|
@ -60,37 +60,35 @@ To give you an idea of how a workspace looks in practice, here's an example:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
bin/
|
bin/
|
||||||
streak # command executable
|
hello # command executable
|
||||||
todo # command executable
|
outyet # command executable
|
||||||
pkg/
|
pkg/
|
||||||
linux_amd64/
|
linux_amd64/
|
||||||
code.google.com/p/goauth2/
|
github.com/golang/example/
|
||||||
oauth.a # package object
|
stringutil.a # package object
|
||||||
github.com/nf/todo/
|
|
||||||
task.a # package object
|
|
||||||
src/
|
src/
|
||||||
code.google.com/p/goauth2/
|
<a href="https://github.com/golang/example/">github.com/golang/example/</a>
|
||||||
.hg/ # mercurial repository metadata
|
.git/ # Git repository metadata
|
||||||
oauth/
|
hello/
|
||||||
oauth.go # package source
|
hello.go # command source
|
||||||
oauth_test.go # test source
|
outyet/
|
||||||
github.com/nf/
|
main.go # command source
|
||||||
streak/
|
main_test.go # test source
|
||||||
.git/ # git repository metadata
|
stringutil/
|
||||||
oauth.go # command source
|
reverse.go # package source
|
||||||
streak.go # command source
|
reverse_test.go # test source
|
||||||
todo/
|
|
||||||
.git/ # git repository metadata
|
|
||||||
task/
|
|
||||||
task.go # package source
|
|
||||||
todo.go # command source
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This workspace contains three repositories (<code>goauth2</code>,
|
This workspace contains one repository (<code>example</code>)
|
||||||
<code>streak</code>, and <code>todo</code>) comprising two commands
|
comprising two commands (<code>hello</code> and <code>outyet</code>)
|
||||||
(<code>streak</code> and <code>todo</code>) and two libraries
|
and one library (<code>stringutil</code>).
|
||||||
(<code>oauth</code> and <code>task</code>).
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
A typical workspace would contain many source repositories containing many
|
||||||
|
packages and commands. Most Go programmers keep <i>all</i> their Go source code
|
||||||
|
and dependencies in a single workspace.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -277,29 +275,29 @@ Let's write a library and use it from the <code>hello</code> program.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Again, the first step is to choose a package path (we'll use
|
Again, the first step is to choose a package path (we'll use
|
||||||
<code>github.com/user/newmath</code>) and create the package directory:
|
<code>github.com/user/stringutil</code>) and create the package directory:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ <b>mkdir $GOPATH/src/github.com/user/newmath</b>
|
$ <b>mkdir $GOPATH/src/github.com/user/stringutil</b>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Next, create a file named <code>sqrt.go</code> in that directory with the
|
Next, create a file named <code>reverse.go</code> in that directory with the
|
||||||
following contents.
|
following contents.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
// Package newmath is a trivial example package.
|
// Package stringutil contains utility functions for working with strings.
|
||||||
package newmath
|
package stringutil
|
||||||
|
|
||||||
// Sqrt returns an approximation to the square root of x.
|
// Reverse returns its argument string reversed rune-wise left to right.
|
||||||
func Sqrt(x float64) float64 {
|
func Reverse(s string) string {
|
||||||
z := 1.0
|
r := []rune(s)
|
||||||
for i := 0; i < 1000; i++ {
|
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
|
||||||
z -= (z*z - x) / (2 * z)
|
r[i], r[j] = r[j], r[i]
|
||||||
}
|
}
|
||||||
return z
|
return string(r)
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
@ -308,7 +306,7 @@ Now, test that the package compiles with <code>go build</code>:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ <b>go build github.com/user/newmath</b>
|
$ <b>go build github.com/user/stringutil</b>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -326,7 +324,7 @@ directory of the workspace.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
After confirming that the <code>newmath</code> package builds,
|
After confirming that the <code>stringutil</code> package builds,
|
||||||
modify your original <code>hello.go</code> (which is in
|
modify your original <code>hello.go</code> (which is in
|
||||||
<code>$GOPATH/src/github.com/user/hello</code>) to use it:
|
<code>$GOPATH/src/github.com/user/hello</code>) to use it:
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -337,18 +335,18 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
<b>"github.com/user/newmath"</b>
|
<b>"github.com/user/stringutil"</b>
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Printf("Hello, world. <b>Sqrt(2) = %v\n", newmath.Sqrt(2)</b>)
|
fmt.Printf(stringutil.Reverse("!oG ,olleH"))
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Whenever the <code>go</code> tool installs a package or binary, it also
|
Whenever the <code>go</code> tool installs a package or binary, it also
|
||||||
installs whatever dependencies it has. So when you install the <code>hello</code>
|
installs whatever dependencies it has.
|
||||||
program
|
So when you install the <code>hello</code> program
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
@ -356,16 +354,16 @@ $ <b>go install github.com/user/hello</b>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
the <code>newmath</code> package will be installed as well, automatically.
|
the <code>stringutil</code> package will be installed as well, automatically.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Running the new version of the program, you should see some numerical output:
|
Running the new version of the program, you should see a new, reversed message:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ <b>hello</b>
|
$ <b>hello</b>
|
||||||
Hello, world. Sqrt(2) = 1.414213562373095
|
Hello, Go!
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -374,22 +372,22 @@ After the steps above, your workspace should look like this:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
bin/
|
bin/
|
||||||
hello # command executable
|
hello # command executable
|
||||||
pkg/
|
pkg/
|
||||||
linux_amd64/ # this will reflect your OS and architecture
|
linux_amd64/ # this will reflect your OS and architecture
|
||||||
github.com/user/
|
github.com/user/
|
||||||
newmath.a # package object
|
stringutil.a # package object
|
||||||
src/
|
src/
|
||||||
github.com/user/
|
github.com/user/
|
||||||
hello/
|
hello/
|
||||||
hello.go # command source
|
hello.go # command source
|
||||||
newmath/
|
stringutil/
|
||||||
sqrt.go # package source
|
reverse.go # package source
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Note that <code>go install</code> placed the <code>newmath.a</code> object in a
|
Note that <code>go install</code> placed the <code>stringutil.a</code> object
|
||||||
directory inside <code>pkg/linux_amd64</code> that mirrors its source
|
in a directory inside <code>pkg/linux_amd64</code> that mirrors its source
|
||||||
directory.
|
directory.
|
||||||
This is so that future invocations of the <code>go</code> tool can find the
|
This is so that future invocations of the <code>go</code> tool can find the
|
||||||
package object and avoid recompiling the package unnecessarily.
|
package object and avoid recompiling the package unnecessarily.
|
||||||
|
|
@ -457,20 +455,29 @@ if the function calls a failure function such as <code>t.Error</code> or
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Add a test to the <code>newmath</code> package by creating the file
|
Add a test to the <code>stringutil</code> package by creating the file
|
||||||
<code>$GOPATH/src/github.com/user/newmath/sqrt_test.go</code> containing the
|
<code>$GOPATH/src/github.com/user/stringutil/reverse_test.go</code> containing
|
||||||
following Go code.
|
the following Go code.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
package newmath
|
package stringutil
|
||||||
|
|
||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestSqrt(t *testing.T) {
|
func TestReverse(t *testing.T) {
|
||||||
const in, out = 4, 2
|
cases := []struct {
|
||||||
if x := Sqrt(in); x != out {
|
in, want string
|
||||||
t.Errorf("Sqrt(%v) = %v, want %v", in, x, out)
|
}{
|
||||||
|
{"Hello, world", "dlrow ,olleH"},
|
||||||
|
{"Hello, 世界", "界世 ,olleH"},
|
||||||
|
{"", ""},
|
||||||
|
}
|
||||||
|
for _, c := range cases {
|
||||||
|
got := Reverse(c.in)
|
||||||
|
if got != c.want {
|
||||||
|
t.Errorf("Reverse(%q) == %q, want %q", c.in, got, c.want)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
@ -480,8 +487,8 @@ Then run the test with <code>go test</code>:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ <b>go test github.com/user/newmath</b>
|
$ <b>go test github.com/user/stringutil</b>
|
||||||
ok github.com/user/newmath 0.165s
|
ok github.com/user/stringutil 0.165s
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -491,7 +498,7 @@ directory, you can omit the package path:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ <b>go test</b>
|
$ <b>go test</b>
|
||||||
ok github.com/user/newmath 0.165s
|
ok github.com/user/stringutil 0.165s
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -507,16 +514,16 @@ An import path can describe how to obtain the package source code using a
|
||||||
revision control system such as Git or Mercurial. The <code>go</code> tool uses
|
revision control system such as Git or Mercurial. The <code>go</code> tool uses
|
||||||
this property to automatically fetch packages from remote repositories.
|
this property to automatically fetch packages from remote repositories.
|
||||||
For instance, the examples described in this document are also kept in a
|
For instance, the examples described in this document are also kept in a
|
||||||
Mercurial repository hosted at Google Code,
|
Git repository hosted at GitHub
|
||||||
<code><a href="//code.google.com/p/go.example">code.google.com/p/go.example</a></code>.
|
<code><a href="https://github.com/golang/example">github.com/golang/example</a></code>.
|
||||||
If you include the repository URL in the package's import path,
|
If you include the repository URL in the package's import path,
|
||||||
<code>go get</code> will fetch, build, and install it automatically:
|
<code>go get</code> will fetch, build, and install it automatically:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ <b>go get code.google.com/p/go.example/hello</b>
|
$ <b>go get github.com/golang/example/hello</b>
|
||||||
$ <b>$GOPATH/bin/hello</b>
|
$ <b>$GOPATH/bin/hello</b>
|
||||||
Hello, world. Sqrt(2) = 1.414213562373095
|
Hello, Go examples!
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -533,37 +540,39 @@ tree should now look like this:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
bin/
|
bin/
|
||||||
hello # command executable
|
hello # command executable
|
||||||
pkg/
|
pkg/
|
||||||
linux_amd64/
|
linux_amd64/
|
||||||
code.google.com/p/go.example/
|
github.com/golang/example/
|
||||||
newmath.a # package object
|
stringutil.a # package object
|
||||||
github.com/user/
|
github.com/user/
|
||||||
newmath.a # package object
|
stringutil.a # package object
|
||||||
src/
|
src/
|
||||||
code.google.com/p/go.example/
|
github.com/golang/example/
|
||||||
|
.git/ # Git repository metadata
|
||||||
hello/
|
hello/
|
||||||
hello.go # command source
|
hello.go # command source
|
||||||
newmath/
|
stringutil/
|
||||||
sqrt.go # package source
|
reverse.go # package source
|
||||||
sqrt_test.go # test source
|
reverse_test.go # test source
|
||||||
github.com/user/
|
github.com/user/
|
||||||
hello/
|
hello/
|
||||||
hello.go # command source
|
hello.go # command source
|
||||||
newmath/
|
stringutil/
|
||||||
sqrt.go # package source
|
reverse.go # package source
|
||||||
sqrt_test.go # test source
|
reverse_test.go # test source
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The <code>hello</code> command hosted at Google Code depends on the
|
The <code>hello</code> command hosted at GitHub depends on the
|
||||||
<code>newmath</code> package within the same repository. The imports in
|
<code>stringutil</code> package within the same repository. The imports in
|
||||||
<code>hello.go</code> file use the same import path convention, so the <code>go
|
<code>hello.go</code> file use the same import path convention, so the
|
||||||
get</code> command is able to locate and install the dependent package, too.
|
<code>go get</code> command is able to locate and install the dependent
|
||||||
|
package, too.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
import "code.google.com/p/go.example/newmath"
|
import "github.com/golang/example/stringutil"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ are inside the go directory when issuing commands.
|
||||||
|
|
||||||
<p>To contribute to subrepositories, edit the <code>.hg/hgrc</code> for each
|
<p>To contribute to subrepositories, edit the <code>.hg/hgrc</code> for each
|
||||||
subrepository in the same way. For example, add the codereview extension to
|
subrepository in the same way. For example, add the codereview extension to
|
||||||
<code>code.google.com/p/go.tools/.hg/hgrc</code>.
|
<code>golang.org/x/tools/.hg/hgrc</code>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3>Understanding the extension</h3>
|
<h3>Understanding the extension</h3>
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ developed software based on Go 1.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Code in sub-repositories of the main go tree, such as
|
Code in sub-repositories of the main go tree, such as
|
||||||
<a href="//code.google.com/p/go.net">code.google.com/p/go.net</a>,
|
<a href="//golang.org/x/net">golang.org/x/net</a>,
|
||||||
may be developed under
|
may be developed under
|
||||||
looser compatibility requirements. However, the sub-repositories
|
looser compatibility requirements. However, the sub-repositories
|
||||||
will be tagged as appropriate to identify versions that are compatible
|
will be tagged as appropriate to identify versions that are compatible
|
||||||
|
|
@ -170,9 +170,9 @@ is therefore outside the purview of the guarantees made here.
|
||||||
As of Go version 1.4, the <code>syscall</code> package is frozen.
|
As of Go version 1.4, the <code>syscall</code> package is frozen.
|
||||||
Any evolution of the system call interface must be supported elsewhere,
|
Any evolution of the system call interface must be supported elsewhere,
|
||||||
such as in the
|
such as in the
|
||||||
<a href="http://godoc.org/code.google.com/p/go.sys">go.sys</a> subrepository.
|
<a href="//golang.org/x/sys">go.sys</a> subrepository.
|
||||||
For details and background, see
|
For details and background, see
|
||||||
<a href="https://golang.org/s/go1.4-syscall">this document</a>.
|
<a href="//golang.org/s/go1.4-syscall">this document</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2 id="tools">Tools</h2>
|
<h2 id="tools">Tools</h2>
|
||||||
|
|
|
||||||
|
|
@ -1616,7 +1616,7 @@ Go is a
|
||||||
fine language in which to implement a self-hosting compiler: a native lexer and
|
fine language in which to implement a self-hosting compiler: a native lexer and
|
||||||
parser are already available in the <a href="/pkg/go/"><code>go</code></a> package
|
parser are already available in the <a href="/pkg/go/"><code>go</code></a> package
|
||||||
and a separate type checking
|
and a separate type checking
|
||||||
<a href="http://godoc.org/code.google.com/p/go.tools/go/types">package</a>
|
<a href="http://godoc.org/golang.org/x/tools/go/types">package</a>
|
||||||
has also been written.
|
has also been written.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -1715,7 +1715,7 @@ func main() {
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Nowadays, most Go programmers use a tool,
|
Nowadays, most Go programmers use a tool,
|
||||||
<a href="http://godoc.org/code.google.com/p/go.tools/cmd/goimports">goimports</a>,
|
<a href="http://godoc.org/golang.org/x/tools/cmd/goimports">goimports</a>,
|
||||||
which automatically rewrites a Go source file to have the correct imports,
|
which automatically rewrites a Go source file to have the correct imports,
|
||||||
eliminating the unused imports issue in practice.
|
eliminating the unused imports issue in practice.
|
||||||
This program is easily connected to most editors to run automatically when a Go source file is written.
|
This program is easily connected to most editors to run automatically when a Go source file is written.
|
||||||
|
|
|
||||||
|
|
@ -241,12 +241,12 @@ provides <b>essential setup instructions</b> for using the Go tools.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The source code for several Go tools (including <a href="/cmd/godoc/">godoc</a>)
|
The source code for several Go tools (including <a href="/cmd/godoc/">godoc</a>)
|
||||||
is kept in <a href="https://code.google.com/p/go.tools">the go.tools repository</a>.
|
is kept in <a href="https://golang.org/x/tools">the go.tools repository</a>.
|
||||||
To install all of them, run the <code>go</code> <code>get</code> command:
|
To install all of them, run the <code>go</code> <code>get</code> command:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ go get code.google.com/p/go.tools/cmd/...
|
$ go get golang.org/x/tools/cmd/...
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -254,7 +254,7 @@ Or if you just want to install a specific command (<code>godoc</code> in this ca
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ go get code.google.com/p/go.tools/cmd/godoc
|
$ go get golang.org/x/tools/cmd/godoc
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -1631,7 +1631,7 @@ def clpatch_or_undo(ui, repo, clname, opts, mode):
|
||||||
try:
|
try:
|
||||||
cmd = subprocess.Popen(argv, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, close_fds=sys.platform != "win32")
|
cmd = subprocess.Popen(argv, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, close_fds=sys.platform != "win32")
|
||||||
except:
|
except:
|
||||||
return "hgapplydiff: " + ExceptionDetail() + "\nInstall hgapplydiff with:\n$ go get code.google.com/p/go.codereview/cmd/hgapplydiff\n"
|
return "hgapplydiff: " + ExceptionDetail() + "\nInstall hgapplydiff with:\n$ go get golang.org/x/codereview/cmd/hgapplydiff\n"
|
||||||
|
|
||||||
out, err = cmd.communicate(patch)
|
out, err = cmd.communicate(patch)
|
||||||
if cmd.returncode != 0 and not opts["ignore_hgapplydiff_failure"]:
|
if cmd.returncode != 0 and not opts["ignore_hgapplydiff_failure"]:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo 'misc/benchcmp has moved:' >&2
|
echo 'misc/benchcmp has moved:' >&2
|
||||||
echo ' go get -u code.google.com/p/go.tools/cmd/benchcmp' >&2
|
echo ' go get -u golang.org/x/tools/cmd/benchcmp' >&2
|
||||||
exit 2
|
exit 2
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,8 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
blogPath = "code.google.com/p/go.blog"
|
blogPath = "golang.org/x/blog"
|
||||||
toolPath = "code.google.com/p/go.tools"
|
toolPath = "golang.org/x/tools"
|
||||||
tourPath = "code.google.com/p/go-tour"
|
tourPath = "code.google.com/p/go-tour"
|
||||||
defaultToolTag = "release-branch.go1.3"
|
defaultToolTag = "release-branch.go1.3"
|
||||||
defaultTourTag = "release-branch.go1.3"
|
defaultTourTag = "release-branch.go1.3"
|
||||||
|
|
@ -64,9 +64,9 @@ const (
|
||||||
// These must be the command that cmd/go knows to install to $GOROOT/bin
|
// These must be the command that cmd/go knows to install to $GOROOT/bin
|
||||||
// or $GOROOT/pkg/tool.
|
// or $GOROOT/pkg/tool.
|
||||||
var toolPaths = []string{
|
var toolPaths = []string{
|
||||||
"code.google.com/p/go.tools/cmd/cover",
|
"golang.org/x/tools/cmd/cover",
|
||||||
"code.google.com/p/go.tools/cmd/godoc",
|
"golang.org/x/tools/cmd/godoc",
|
||||||
"code.google.com/p/go.tools/cmd/vet",
|
"golang.org/x/tools/cmd/vet",
|
||||||
}
|
}
|
||||||
|
|
||||||
var preBuildCleanFiles = []string{
|
var preBuildCleanFiles = []string{
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
// two non-literal codes are a clear code and an EOF code.
|
// two non-literal codes are a clear code and an EOF code.
|
||||||
//
|
//
|
||||||
// The TIFF file format uses a similar but incompatible version of the LZW
|
// The TIFF file format uses a similar but incompatible version of the LZW
|
||||||
// algorithm. See the code.google.com/p/go.image/tiff/lzw package for an
|
// algorithm. See the golang.org/x/image/tiff/lzw package for an
|
||||||
// implementation.
|
// implementation.
|
||||||
package lzw
|
package lzw
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ func (h Hash) HashFunc() Hash {
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MD4 Hash = 1 + iota // import code.google.com/p/go.crypto/md4
|
MD4 Hash = 1 + iota // import golang.org/x/crypto/md4
|
||||||
MD5 // import crypto/md5
|
MD5 // import crypto/md5
|
||||||
SHA1 // import crypto/sha1
|
SHA1 // import crypto/sha1
|
||||||
SHA224 // import crypto/sha256
|
SHA224 // import crypto/sha256
|
||||||
|
|
@ -29,11 +29,11 @@ const (
|
||||||
SHA384 // import crypto/sha512
|
SHA384 // import crypto/sha512
|
||||||
SHA512 // import crypto/sha512
|
SHA512 // import crypto/sha512
|
||||||
MD5SHA1 // no implementation; MD5+SHA1 used for TLS RSA
|
MD5SHA1 // no implementation; MD5+SHA1 used for TLS RSA
|
||||||
RIPEMD160 // import code.google.com/p/go.crypto/ripemd160
|
RIPEMD160 // import golang.org/x/crypto/ripemd160
|
||||||
SHA3_224 // import code.google.com/p/go.crypto/sha3
|
SHA3_224 // import golang.org/x/crypto/sha3
|
||||||
SHA3_256 // import code.google.com/p/go.crypto/sha3
|
SHA3_256 // import golang.org/x/crypto/sha3
|
||||||
SHA3_384 // import code.google.com/p/go.crypto/sha3
|
SHA3_384 // import golang.org/x/crypto/sha3
|
||||||
SHA3_512 // import code.google.com/p/go.crypto/sha3
|
SHA3_512 // import golang.org/x/crypto/sha3
|
||||||
maxHash
|
maxHash
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ var importPathToPrefixTests = []struct {
|
||||||
}{
|
}{
|
||||||
{"runtime", "runtime"},
|
{"runtime", "runtime"},
|
||||||
{"sync/atomic", "sync/atomic"},
|
{"sync/atomic", "sync/atomic"},
|
||||||
{"code.google.com/p/go.tools/godoc", "code.google.com/p/go.tools/godoc"},
|
{"golang.org/x/tools/godoc", "golang.org/x/tools/godoc"},
|
||||||
{"foo.bar/baz.quux", "foo.bar/baz%2equux"},
|
{"foo.bar/baz.quux", "foo.bar/baz%2equux"},
|
||||||
{"", ""},
|
{"", ""},
|
||||||
{"%foo%bar", "%25foo%25bar"},
|
{"%foo%bar", "%25foo%25bar"},
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import (
|
||||||
// set a cookie for bar.com.
|
// set a cookie for bar.com.
|
||||||
//
|
//
|
||||||
// A public suffix list implementation is in the package
|
// A public suffix list implementation is in the package
|
||||||
// code.google.com/p/go.net/publicsuffix.
|
// golang.org/x/net/publicsuffix.
|
||||||
type PublicSuffixList interface {
|
type PublicSuffixList interface {
|
||||||
// PublicSuffix returns the public suffix of domain.
|
// PublicSuffix returns the public suffix of domain.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
// Export the runtime entry point symbol.
|
// Export the runtime entry point symbol.
|
||||||
//
|
//
|
||||||
// Used by the app package to start the Go runtime after loading
|
// Used by the app package to start the Go runtime after loading
|
||||||
// a shared library via JNI. See code.google.com/p/go.mobile/app.
|
// a shared library via JNI. See golang.org/x/mobile/app.
|
||||||
|
|
||||||
void _rt0_arm_linux1();
|
void _rt0_arm_linux1();
|
||||||
#pragma cgo_export_static _rt0_arm_linux1
|
#pragma cgo_export_static _rt0_arm_linux1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue