mirror of
https://github.com/golang/go.git
synced 2026-01-30 15:42:04 +03:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edecc650ec | ||
|
|
2e150a0aa7 | ||
|
|
f0377a2851 | ||
|
|
2287d95e9b | ||
|
|
a2f37b7fe1 | ||
|
|
ca0b97e80a | ||
|
|
230c3918a8 | ||
|
|
b67902fee7 | ||
|
|
5a589904a3 | ||
|
|
f75aafdf56 | ||
|
|
b261730e56 | ||
|
|
40712a9625 | ||
|
|
24f46bd34f | ||
|
|
c24b5d43a6 | ||
|
|
dc3612e0d1 | ||
|
|
6f12826a86 | ||
|
|
3129c67db7 | ||
|
|
bb8706890b | ||
|
|
287be1e42d | ||
|
|
308bdd0256 | ||
|
|
9b4e323e88 | ||
|
|
a5add8c726 | ||
|
|
e464c08bef | ||
|
|
c0f5de1ad2 | ||
|
|
1861ac159e | ||
|
|
759c2c48ea | ||
|
|
09fa0b8e95 | ||
|
|
0d81858868 | ||
|
|
681a667ced | ||
|
|
806a84d3f1 | ||
|
|
87d4bd1997 | ||
|
|
1e933ed7c0 | ||
|
|
78d024a588 | ||
|
|
09fc3cc5df | ||
|
|
17a48e0a00 |
14
.gitattributes
vendored
14
.gitattributes
vendored
@@ -1,16 +1,10 @@
|
||||
# Treat all files in the Go repo as binary, with no git magic updating
|
||||
# line endings. This produces predictable results in different environments.
|
||||
#
|
||||
# Windows users contributing to Go will need to use a modern version
|
||||
# of git and editors capable of LF line endings.
|
||||
#
|
||||
# Windows .bat files are known to have multiple bugs when run with LF
|
||||
# endings, and so they are checked in with CRLF endings, with a test
|
||||
# in test/winbatch.go to catch problems. (See golang.org/issue/37791.)
|
||||
# line endings. Windows users contributing to Go will need to use a
|
||||
# modern version of git and editors capable of LF line endings.
|
||||
#
|
||||
# We'll prevent accidental CRLF line endings from entering the repo
|
||||
# via the git-codereview gofmt checks and tests.
|
||||
# via the git-review gofmt checks.
|
||||
#
|
||||
# See golang.org/issue/9281.
|
||||
# See golang.org/issue/9281
|
||||
|
||||
* -text
|
||||
|
||||
3
.github/CODE_OF_CONDUCT.md
vendored
3
.github/CODE_OF_CONDUCT.md
vendored
@@ -1,3 +0,0 @@
|
||||
# Code of Conduct
|
||||
|
||||
Please read the [Go Community Code of Conduct](https://golang.org/conduct).
|
||||
30
.github/ISSUE_TEMPLATE
vendored
30
.github/ISSUE_TEMPLATE
vendored
@@ -1,38 +1,20 @@
|
||||
<!--
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
|
||||
-->
|
||||
|
||||
### What version of Go are you using (`go version`)?
|
||||
|
||||
<pre>
|
||||
$ go version
|
||||
|
||||
</pre>
|
||||
|
||||
### Does this issue reproduce with the latest release?
|
||||
1. What version of Go are you using (`go version`)?
|
||||
|
||||
|
||||
2. What operating system and processor architecture are you using (`go env`)?
|
||||
|
||||
### What operating system and processor architecture are you using (`go env`)?
|
||||
|
||||
<details><summary><code>go env</code> Output</summary><br><pre>
|
||||
$ go env
|
||||
|
||||
</pre></details>
|
||||
|
||||
### What did you do?
|
||||
|
||||
<!--
|
||||
3. What did you do?
|
||||
If possible, provide a recipe for reproducing the error.
|
||||
A complete runnable program is good.
|
||||
A link on play.golang.org is best.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### What did you expect to see?
|
||||
4. What did you expect to see?
|
||||
|
||||
|
||||
5. What did you see instead?
|
||||
|
||||
|
||||
### What did you see instead?
|
||||
|
||||
26
.github/PULL_REQUEST_TEMPLATE
vendored
26
.github/PULL_REQUEST_TEMPLATE
vendored
@@ -1,25 +1,7 @@
|
||||
This PR will be imported into Gerrit with the title and first
|
||||
comment (this text) used to generate the subject and body of
|
||||
the Gerrit change.
|
||||
Please do not send pull requests to the golang/* repositories.
|
||||
|
||||
**Please ensure you adhere to every item in this list.**
|
||||
We do, however, take contributions gladly.
|
||||
|
||||
More info can be found at https://github.com/golang/go/wiki/CommitMessage
|
||||
See https://golang.org/doc/contribute.html
|
||||
|
||||
+ The PR title is formatted as follows: `net/http: frob the quux before blarfing`
|
||||
+ The package name goes before the colon
|
||||
+ The part after the colon uses the verb tense + phrase that completes the blank in,
|
||||
"This change modifies Go to ___________"
|
||||
+ Lowercase verb after the colon
|
||||
+ No trailing period
|
||||
+ Keep the title as short as possible. ideally under 76 characters or shorter
|
||||
+ No Markdown
|
||||
+ The first PR comment (this one) is wrapped at 76 characters, unless it's
|
||||
really needed (ASCII art, table, or long link)
|
||||
+ If there is a corresponding issue, add either `Fixes #1234` or `Updates #1234`
|
||||
(the latter if this is not a complete fix) to this comment
|
||||
+ If referring to a repo other than `golang/go` you can use the
|
||||
`owner/repo#issue_number` syntax: `Fixes golang/tools#1234`
|
||||
+ We do not use Signed-off-by lines in Go. Please don't add them.
|
||||
Our Gerrit server & GitHub bots enforce CLA compliance instead.
|
||||
+ Delete these instructions once you have read and applied them
|
||||
Thanks!
|
||||
|
||||
14
.github/SUPPORT.md
vendored
14
.github/SUPPORT.md
vendored
@@ -1,14 +0,0 @@
|
||||
Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions.
|
||||
We only use our bug tracker for tracking bugs and tracking proposals going through the [Proposal Process](https://golang.org/s/proposal-process).
|
||||
|
||||
For asking questions, see:
|
||||
|
||||
* [The golang-nuts mailing list](https://groups.google.com/d/forum/golang-nuts)
|
||||
|
||||
* [The Go Forum](https://forum.golangbridge.org/), a web-based forum
|
||||
|
||||
* [Gophers Slack](https://gophers.slack.com), use the [invite app](https://invite.slack.golangbridge.org/) for access
|
||||
|
||||
* [Stack Overflow](https://stackoverflow.com/questions/tagged/go) with questions tagged "go"
|
||||
|
||||
* **IRC** channel #go-nuts on Freenode
|
||||
54
.gitignore
vendored
54
.gitignore
vendored
@@ -18,34 +18,28 @@ _cgo_*
|
||||
_obj
|
||||
_test
|
||||
_testmain.go
|
||||
build.out
|
||||
test.out
|
||||
doc/articles/wiki/*.bin
|
||||
misc/cgo/life/run.out
|
||||
misc/cgo/stdio/run.out
|
||||
misc/cgo/testso/main
|
||||
src/cmd/cgo/zdefaultcc.go
|
||||
src/cmd/go/zdefaultcc.go
|
||||
src/cmd/go/zosarch.go
|
||||
src/cmd/internal/obj/zbootstrap.go
|
||||
src/go/build/zcgo.go
|
||||
src/go/doc/headscan
|
||||
src/runtime/internal/sys/zversion.go
|
||||
src/unicode/maketables
|
||||
src/*.*/
|
||||
test/pass.out
|
||||
test/run.out
|
||||
test/times.out
|
||||
test/garbage/*.out
|
||||
goinstall.log
|
||||
last-change
|
||||
VERSION.cache
|
||||
|
||||
/VERSION.cache
|
||||
/bin/
|
||||
/build.out
|
||||
/doc/articles/wiki/*.bin
|
||||
/goinstall.log
|
||||
/last-change
|
||||
/misc/cgo/life/run.out
|
||||
/misc/cgo/stdio/run.out
|
||||
/misc/cgo/testso/main
|
||||
/pkg/
|
||||
/src/*.*/
|
||||
/src/cmd/cgo/zdefaultcc.go
|
||||
/src/cmd/dist/dist
|
||||
/src/cmd/go/internal/cfg/zdefaultcc.go
|
||||
/src/cmd/go/internal/cfg/zosarch.go
|
||||
/src/cmd/internal/objabi/zbootstrap.go
|
||||
/src/go/build/zcgo.go
|
||||
/src/go/doc/headscan
|
||||
/src/runtime/internal/sys/zversion.go
|
||||
/src/unicode/maketables
|
||||
/test.out
|
||||
/test/garbage/*.out
|
||||
/test/pass.out
|
||||
/test/run.out
|
||||
/test/times.out
|
||||
|
||||
# This file includes artifacts of Go build that should not be checked in.
|
||||
# For files created by specific development environment (e.g. editor),
|
||||
# use alternative ways to exclude files from git.
|
||||
# For example, set up .git/info/exclude or use a global .gitignore.
|
||||
bin/
|
||||
pkg/
|
||||
|
||||
@@ -4,19 +4,10 @@ Go is an open source project.
|
||||
|
||||
It is the work of hundreds of contributors. We appreciate your help!
|
||||
|
||||
## Before filing an issue
|
||||
|
||||
If you are unsure whether you have found a bug, please consider asking in the [golang-nuts mailing
|
||||
list](https://groups.google.com/forum/#!forum/golang-nuts) or [other forums](https://golang.org/help/) first. If
|
||||
the behavior you are seeing is confirmed as a bug or issue, it can easily be re-raised in the issue tracker.
|
||||
|
||||
## Filing issues
|
||||
|
||||
Sensitive security-related issues should be reported to [security@golang.org](mailto:security@golang.org).
|
||||
See the [security policy](https://golang.org/security) for details.
|
||||
|
||||
The recommended way to file an issue is by running `go bug`.
|
||||
Otherwise, when filing an issue, make sure to answer these five questions:
|
||||
When filing an issue, make sure to answer these five questions:
|
||||
|
||||
1. What version of Go are you using (`go version`)?
|
||||
2. What operating system and processor architecture are you using?
|
||||
@@ -24,11 +15,19 @@ Otherwise, when filing an issue, make sure to answer these five questions:
|
||||
4. What did you expect to see?
|
||||
5. What did you see instead?
|
||||
|
||||
For change proposals, see [Proposing Changes To Go](https://github.com/golang/proposal/).
|
||||
General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.
|
||||
The gophers there will answer or ask you to file an issue if you've tripped over a bug.
|
||||
|
||||
Sensitive security-related issues should be reported to [security@golang.org](mailto:security@golang.org).
|
||||
|
||||
## Contributing code
|
||||
|
||||
Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) before sending patches.
|
||||
Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html)
|
||||
before sending patches.
|
||||
|
||||
**We do not accept GitHub pull requests**
|
||||
(we use [an instance](https://go-review.googlesource.com/) of the
|
||||
[Gerrit](https://www.gerritcodereview.com/) code review system instead).
|
||||
|
||||
Unless otherwise noted, the Go source files are distributed under
|
||||
the BSD-style license found in the LICENSE file.
|
||||
|
||||
1470
CONTRIBUTORS
1470
CONTRIBUTORS
File diff suppressed because it is too large
Load Diff
57
README.md
57
README.md
@@ -4,41 +4,40 @@ Go is an open source programming language that makes it easy to build simple,
|
||||
reliable, and efficient software.
|
||||
|
||||

|
||||
*Gopher image by [Renee French][rf], licensed under [Creative Commons 3.0 Attributions license][cc3-by].*
|
||||
|
||||
For documentation about how to install and use Go,
|
||||
visit https://golang.org/ or load doc/install-source.html
|
||||
in your web browser.
|
||||
|
||||
Our canonical Git repository is located at https://go.googlesource.com/go.
|
||||
There is a mirror of the repository at https://github.com/golang/go.
|
||||
|
||||
Unless otherwise noted, the Go source files are distributed under the
|
||||
BSD-style license found in the LICENSE file.
|
||||
|
||||
### Download and Install
|
||||
|
||||
#### Binary Distributions
|
||||
|
||||
Official binary distributions are available at https://golang.org/dl/.
|
||||
|
||||
After downloading a binary release, visit https://golang.org/doc/install
|
||||
or load [doc/install.html](./doc/install.html) in your web browser for installation
|
||||
instructions.
|
||||
|
||||
#### Install From Source
|
||||
|
||||
If a binary distribution is not available for your combination of
|
||||
operating system and architecture, visit
|
||||
https://golang.org/doc/install/source or load [doc/install-source.html](./doc/install-source.html)
|
||||
in your web browser for source installation instructions.
|
||||
|
||||
### Contributing
|
||||
|
||||
Go is the work of thousands of contributors. We appreciate your help!
|
||||
Go is the work of hundreds of contributors. We appreciate your help!
|
||||
|
||||
To contribute, please read the contribution guidelines:
|
||||
https://golang.org/doc/contribute.html
|
||||
|
||||
Note that the Go project uses the issue tracker for bug reports and
|
||||
proposals only. See https://golang.org/wiki/Questions for a list of
|
||||
places to ask questions about the Go language.
|
||||
##### Note that we do not accept pull requests and that we use the issue tracker for bug reports and proposals only. Please ask questions on https://forum.golangbridge.org or https://groups.google.com/forum/#!forum/golang-nuts.
|
||||
|
||||
[rf]: https://reneefrench.blogspot.com/
|
||||
[cc3-by]: https://creativecommons.org/licenses/by/3.0/
|
||||
Unless otherwise noted, the Go source files are distributed
|
||||
under the BSD-style license found in the LICENSE file.
|
||||
|
||||
--
|
||||
|
||||
## Binary Distribution Notes
|
||||
|
||||
If you have just untarred a binary Go distribution, you need to set
|
||||
the environment variable $GOROOT to the full path of the go
|
||||
directory (the one containing this file). You can omit the
|
||||
variable if you unpack it into /usr/local/go, or if you rebuild
|
||||
from sources by running all.bash (see doc/install-source.html).
|
||||
You should also add the Go binary directory $GOROOT/bin
|
||||
to your shell's path.
|
||||
|
||||
For example, if you extracted the tar file into $HOME/go, you might
|
||||
put the following in your .profile:
|
||||
|
||||
export GOROOT=$HOME/go
|
||||
export PATH=$PATH:$GOROOT/bin
|
||||
|
||||
See https://golang.org/doc/install or doc/install.html for more details.
|
||||
|
||||
13
SECURITY.md
13
SECURITY.md
@@ -1,13 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
We support the past two Go releases (for example, Go 1.12.x and Go 1.13.x).
|
||||
|
||||
See https://golang.org/wiki/Go-Release-Cycle and in particular the
|
||||
[Release Maintenance](https://github.com/golang/go/wiki/Go-Release-Cycle#release-maintenance)
|
||||
part of that page.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
See https://golang.org/security for how to report a vulnerability.
|
||||
@@ -11,3 +11,4 @@ compatibility.
|
||||
next.txt is the only file intended to be mutated. It's a list of
|
||||
features that may be added to the next version. It only affects
|
||||
warning output from the go api tool.
|
||||
|
||||
|
||||
317
api/except.txt
317
api/except.txt
@@ -1,124 +1,25 @@
|
||||
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
|
||||
pkg math/big, const MaxBase = 36
|
||||
pkg math/big, type Word uintptr
|
||||
pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
|
||||
pkg os, const ModeType = 2399141888
|
||||
pkg os, const ModeType = 2399666176
|
||||
pkg syscall (darwin-386), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-386-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-amd64), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-amd64-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-386), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-amd64), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-arm), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-arm-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (netbsd-arm), func Fchflags(string, int) error
|
||||
pkg syscall (netbsd-arm-cgo), func Fchflags(string, int) error
|
||||
pkg testing, func RegisterCover(Cover)
|
||||
pkg text/template/parse, type DotNode bool
|
||||
pkg text/template/parse, type Node interface { Copy, String, Type }
|
||||
pkg os (linux-arm), const O_SYNC = 4096
|
||||
pkg os (linux-arm-cgo), const O_SYNC = 4096
|
||||
pkg os (linux-arm), const O_SYNC = 1052672
|
||||
pkg os (linux-arm-cgo), const O_SYNC = 1052672
|
||||
pkg syscall (darwin-386), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-386-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-amd64), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-amd64), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-amd64-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-amd64-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-386), const AF_MAX = 38
|
||||
pkg syscall (freebsd-386), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-386), const ELAST = 94
|
||||
pkg syscall (freebsd-386), const ImplementsGetwd = false
|
||||
pkg syscall (freebsd-386), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-386), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-386-cgo), const AF_MAX = 38
|
||||
pkg syscall (freebsd-386-cgo), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-386-cgo), const ELAST = 94
|
||||
pkg syscall (freebsd-386-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (freebsd-386-cgo), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-amd64), const AF_MAX = 38
|
||||
pkg syscall (freebsd-amd64), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-amd64), const ELAST = 94
|
||||
pkg syscall (freebsd-amd64), const ImplementsGetwd = false
|
||||
pkg syscall (freebsd-amd64), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-amd64), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-amd64-cgo), const AF_MAX = 38
|
||||
pkg syscall (freebsd-amd64-cgo), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-amd64-cgo), const ELAST = 94
|
||||
pkg syscall (freebsd-amd64-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (freebsd-amd64-cgo), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-arm), const AF_MAX = 38
|
||||
pkg syscall (freebsd-arm), const BIOCGRTIMEOUT = 1074545262
|
||||
pkg syscall (freebsd-arm), const BIOCSRTIMEOUT = 2148287085
|
||||
pkg syscall (freebsd-arm), const ELAST = 94
|
||||
pkg syscall (freebsd-arm), const ImplementsGetwd = false
|
||||
pkg syscall (freebsd-arm), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-arm), const SIOCAIFADDR = 2151967019
|
||||
pkg syscall (freebsd-arm), const SIOCGIFSTATUS = 3274991931
|
||||
pkg syscall (freebsd-arm), const SIOCSIFPHYADDR = 2151967046
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET = 537
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT = 536
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET = 535
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT = 534
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET = 515
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT = 533
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm), const SizeofBpfHdr = 24
|
||||
pkg syscall (freebsd-arm), const SizeofIfData = 88
|
||||
pkg syscall (freebsd-arm), const SizeofIfMsghdr = 104
|
||||
pkg syscall (freebsd-arm), const SizeofSockaddrDatalink = 56
|
||||
pkg syscall (freebsd-arm), const SizeofSockaddrUnix = 108
|
||||
pkg syscall (freebsd-arm), const TIOCTIMESTAMP = 1074558041
|
||||
pkg syscall (freebsd-arm), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-arm), type BpfHdr struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Pad_cgo_0 [4]uint8
|
||||
pkg syscall (freebsd-arm-cgo), const AF_MAX = 38
|
||||
pkg syscall (freebsd-arm-cgo), const BIOCGRTIMEOUT = 1074545262
|
||||
pkg syscall (freebsd-arm-cgo), const BIOCSRTIMEOUT = 2148287085
|
||||
pkg syscall (freebsd-arm-cgo), const ELAST = 94
|
||||
pkg syscall (freebsd-arm-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (freebsd-arm-cgo), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-arm-cgo), const SIOCAIFADDR = 2151967019
|
||||
pkg syscall (freebsd-arm-cgo), const SIOCGIFSTATUS = 3274991931
|
||||
pkg syscall (freebsd-arm-cgo), const SIOCSIFPHYADDR = 2151967046
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET = 537
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT = 536
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET = 535
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT = 534
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET = 515
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT = 533
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofBpfHdr = 24
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofIfData = 88
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofIfMsghdr = 104
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofSockaddrDatalink = 56
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofSockaddrUnix = 108
|
||||
pkg syscall (freebsd-arm-cgo), const TIOCTIMESTAMP = 1074558041
|
||||
pkg syscall (freebsd-arm-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm-cgo), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Pad_cgo_0 [4]uint8
|
||||
pkg syscall (linux-386), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-386-cgo), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-amd64), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-amd64-cgo), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-arm), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-arm-cgo), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (netbsd-386), const ImplementsGetwd = false
|
||||
pkg syscall (netbsd-386-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (netbsd-amd64), const ImplementsGetwd = false
|
||||
pkg syscall (netbsd-amd64-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (netbsd-arm), const ImplementsGetwd = false
|
||||
pkg syscall (netbsd-arm-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (netbsd-arm), const SizeofIfData = 132
|
||||
pkg syscall (netbsd-arm), func Fchflags(string, int) error
|
||||
pkg syscall (netbsd-arm), type IfMsghdr struct, Pad_cgo_1 [4]uint8
|
||||
pkg syscall (netbsd-arm-cgo), const SizeofIfData = 132
|
||||
pkg syscall (netbsd-arm-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Pad_cgo_1 [4]uint8
|
||||
pkg syscall (openbsd-386), const BIOCGRTIMEOUT = 1074283118
|
||||
pkg syscall (openbsd-386), const BIOCSRTIMEOUT = 2148024941
|
||||
pkg syscall (openbsd-386), const ImplementsGetwd = false
|
||||
pkg syscall (openbsd-386), const RTF_FMASK = 63496
|
||||
pkg syscall (openbsd-386), const RTM_VERSION = 4
|
||||
pkg syscall (openbsd-386), const SIOCBRDGDADDR = 2150132039
|
||||
@@ -171,7 +72,6 @@ pkg syscall (openbsd-386), type Timespec struct, Sec int32
|
||||
pkg syscall (openbsd-386), type Timeval struct, Sec int32
|
||||
pkg syscall (openbsd-386-cgo), const BIOCGRTIMEOUT = 1074283118
|
||||
pkg syscall (openbsd-386-cgo), const BIOCSRTIMEOUT = 2148024941
|
||||
pkg syscall (openbsd-386-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (openbsd-386-cgo), const RTF_FMASK = 63496
|
||||
pkg syscall (openbsd-386-cgo), const RTM_VERSION = 4
|
||||
pkg syscall (openbsd-386-cgo), const SIOCBRDGDADDR = 2150132039
|
||||
@@ -234,7 +134,6 @@ pkg syscall (openbsd-amd64), const EFER_NXE = 2048
|
||||
pkg syscall (openbsd-amd64), const EFER_NXE ideal-int
|
||||
pkg syscall (openbsd-amd64), const EFER_SCE = 1
|
||||
pkg syscall (openbsd-amd64), const EFER_SCE ideal-int
|
||||
pkg syscall (openbsd-amd64), const ImplementsGetwd = false
|
||||
pkg syscall (openbsd-amd64), const PMC5_PIPELINE_FLUSH = 21
|
||||
pkg syscall (openbsd-amd64), const PMC5_PIPELINE_FLUSH ideal-int
|
||||
pkg syscall (openbsd-amd64), const RTF_FMASK = 63496
|
||||
@@ -297,7 +196,6 @@ pkg syscall (openbsd-amd64-cgo), const EFER_NXE = 2048
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_NXE ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_SCE = 1
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_SCE ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (openbsd-amd64-cgo), const PMC5_PIPELINE_FLUSH = 21
|
||||
pkg syscall (openbsd-amd64-cgo), const PMC5_PIPELINE_FLUSH ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const RTF_FMASK = 63496
|
||||
@@ -348,112 +246,87 @@ pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_spare [3]uint32
|
||||
pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, Pad_cgo_1 [4]uint8
|
||||
pkg syscall (openbsd-amd64-cgo), type Timespec struct, Pad_cgo_0 [4]uint8
|
||||
pkg syscall (openbsd-amd64-cgo), type Timespec struct, Sec int32
|
||||
pkg testing, func RegisterCover(Cover)
|
||||
pkg testing, func MainStart(func(string, string) (bool, error), []InternalTest, []InternalBenchmark, []InternalExample) *M
|
||||
pkg text/template/parse, type DotNode bool
|
||||
pkg text/template/parse, type Node interface { Copy, String, Type }
|
||||
pkg unicode, const Version = "6.2.0"
|
||||
pkg syscall (freebsd-386), const AF_MAX = 38
|
||||
pkg syscall (freebsd-386), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-386), const ELAST = 94
|
||||
pkg syscall (freebsd-386), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-386-cgo), const AF_MAX = 38
|
||||
pkg syscall (freebsd-386-cgo), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-386-cgo), const ELAST = 94
|
||||
pkg syscall (freebsd-386-cgo), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-amd64), const AF_MAX = 38
|
||||
pkg syscall (freebsd-amd64), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-amd64), const ELAST = 94
|
||||
pkg syscall (freebsd-amd64), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-amd64-cgo), const AF_MAX = 38
|
||||
pkg syscall (freebsd-amd64-cgo), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-amd64-cgo), const ELAST = 94
|
||||
pkg syscall (freebsd-amd64-cgo), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-arm), const AF_MAX = 38
|
||||
pkg syscall (freebsd-arm), const BIOCGRTIMEOUT = 1074545262
|
||||
pkg syscall (freebsd-arm), const BIOCSRTIMEOUT = 2148287085
|
||||
pkg syscall (freebsd-arm), const ELAST = 94
|
||||
pkg syscall (freebsd-arm), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-arm), const SIOCAIFADDR = 2151967019
|
||||
pkg syscall (freebsd-arm), const SIOCGIFSTATUS = 3274991931
|
||||
pkg syscall (freebsd-arm), const SIOCSIFPHYADDR = 2151967046
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET = 537
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT = 536
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET = 535
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT = 534
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET = 515
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT = 533
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm), const SizeofBpfHdr = 24
|
||||
pkg syscall (freebsd-arm), const SizeofIfData = 88
|
||||
pkg syscall (freebsd-arm), const SizeofIfMsghdr = 104
|
||||
pkg syscall (freebsd-arm), const SizeofSockaddrDatalink = 56
|
||||
pkg syscall (freebsd-arm), const SizeofSockaddrUnix = 108
|
||||
pkg syscall (freebsd-arm), const TIOCTIMESTAMP = 1074558041
|
||||
pkg syscall (freebsd-arm), type BpfHdr struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Pad_cgo_0 [4]uint8
|
||||
pkg syscall (freebsd-arm-cgo), const AF_MAX = 38
|
||||
pkg syscall (freebsd-arm-cgo), const BIOCGRTIMEOUT = 1074545262
|
||||
pkg syscall (freebsd-arm-cgo), const BIOCSRTIMEOUT = 2148287085
|
||||
pkg syscall (freebsd-arm-cgo), const ELAST = 94
|
||||
pkg syscall (freebsd-arm-cgo), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-arm-cgo), const SIOCAIFADDR = 2151967019
|
||||
pkg syscall (freebsd-arm-cgo), const SIOCGIFSTATUS = 3274991931
|
||||
pkg syscall (freebsd-arm-cgo), const SIOCSIFPHYADDR = 2151967046
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET = 537
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT = 536
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET = 535
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT = 534
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET = 515
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT = 533
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofBpfHdr = 24
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofIfData = 88
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofIfMsghdr = 104
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofSockaddrDatalink = 56
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofSockaddrUnix = 108
|
||||
pkg syscall (freebsd-arm-cgo), const TIOCTIMESTAMP = 1074558041
|
||||
pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm-cgo), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Pad_cgo_0 [4]uint8
|
||||
pkg syscall (netbsd-arm), const SizeofIfData = 132
|
||||
pkg syscall (netbsd-arm), type IfMsghdr struct, Pad_cgo_1 [4]uint8
|
||||
pkg syscall (netbsd-arm-cgo), const SizeofIfData = 132
|
||||
pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Pad_cgo_1 [4]uint8
|
||||
pkg unicode, const Version = "6.3.0"
|
||||
pkg unicode, const Version = "7.0.0"
|
||||
pkg unicode, const Version = "8.0.0"
|
||||
pkg syscall (openbsd-386), const SYS_KILL = 37
|
||||
pkg syscall (openbsd-386-cgo), const SYS_KILL = 37
|
||||
pkg syscall (openbsd-amd64), const SYS_KILL = 37
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_KILL = 37
|
||||
pkg unicode, const Version = "9.0.0"
|
||||
pkg syscall (windows-386), const TOKEN_ALL_ACCESS = 983295
|
||||
pkg syscall (windows-386), type AddrinfoW struct, Addr uintptr
|
||||
pkg syscall (windows-386), type CertChainPolicyPara struct, ExtraPolicyPara uintptr
|
||||
pkg syscall (windows-386), type CertChainPolicyStatus struct, ExtraPolicyStatus uintptr
|
||||
pkg syscall (windows-386), type CertContext struct, CertInfo uintptr
|
||||
pkg syscall (windows-386), type CertRevocationInfo struct, CrlInfo uintptr
|
||||
pkg syscall (windows-386), type CertRevocationInfo struct, OidSpecificInfo uintptr
|
||||
pkg syscall (windows-386), type CertSimpleChain struct, TrustListInfo uintptr
|
||||
pkg syscall (windows-386), type RawSockaddrAny struct, Pad [96]int8
|
||||
pkg syscall (windows-amd64), const TOKEN_ALL_ACCESS = 983295
|
||||
pkg syscall (windows-amd64), type AddrinfoW struct, Addr uintptr
|
||||
pkg syscall (windows-amd64), type CertChainPolicyPara struct, ExtraPolicyPara uintptr
|
||||
pkg syscall (windows-amd64), type CertChainPolicyStatus struct, ExtraPolicyStatus uintptr
|
||||
pkg syscall (windows-amd64), type CertContext struct, CertInfo uintptr
|
||||
pkg syscall (windows-amd64), type CertRevocationInfo struct, CrlInfo uintptr
|
||||
pkg syscall (windows-amd64), type CertRevocationInfo struct, OidSpecificInfo uintptr
|
||||
pkg syscall (windows-amd64), type CertSimpleChain struct, TrustListInfo uintptr
|
||||
pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [96]int8
|
||||
pkg syscall (freebsd-386), func Mknod(string, uint32, int) error
|
||||
pkg syscall (freebsd-386), type Dirent struct, Fileno uint32
|
||||
pkg syscall (freebsd-386), type Dirent struct, Namlen uint8
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Blksize uint32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Dev uint32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Gen uint32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Ino uint32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Lspare int32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Nlink uint16
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Pad_cgo_0 [8]uint8
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Rdev uint32
|
||||
pkg syscall (freebsd-386), type Statfs_t struct, Mntfromname [88]int8
|
||||
pkg syscall (freebsd-386), type Statfs_t struct, Mntonname [88]int8
|
||||
pkg syscall (freebsd-386-cgo), func Mknod(string, uint32, int) error
|
||||
pkg syscall (freebsd-386-cgo), type Dirent struct, Fileno uint32
|
||||
pkg syscall (freebsd-386-cgo), type Dirent struct, Namlen uint8
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Blksize uint32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Dev uint32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Gen uint32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Ino uint32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Lspare int32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Nlink uint16
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Pad_cgo_0 [8]uint8
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Rdev uint32
|
||||
pkg syscall (freebsd-386-cgo), type Statfs_t struct, Mntfromname [88]int8
|
||||
pkg syscall (freebsd-386-cgo), type Statfs_t struct, Mntonname [88]int8
|
||||
pkg syscall (freebsd-amd64), func Mknod(string, uint32, int) error
|
||||
pkg syscall (freebsd-amd64), type Dirent struct, Fileno uint32
|
||||
pkg syscall (freebsd-amd64), type Dirent struct, Namlen uint8
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Blksize uint32
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Dev uint32
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Gen uint32
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Ino uint32
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Lspare int32
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Nlink uint16
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Rdev uint32
|
||||
pkg syscall (freebsd-amd64), type Statfs_t struct, Mntfromname [88]int8
|
||||
pkg syscall (freebsd-amd64), type Statfs_t struct, Mntonname [88]int8
|
||||
pkg syscall (freebsd-amd64-cgo), func Mknod(string, uint32, int) error
|
||||
pkg syscall (freebsd-amd64-cgo), type Dirent struct, Fileno uint32
|
||||
pkg syscall (freebsd-amd64-cgo), type Dirent struct, Namlen uint8
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Blksize uint32
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Dev uint32
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Gen uint32
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ino uint32
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Lspare int32
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Nlink uint16
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Rdev uint32
|
||||
pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntfromname [88]int8
|
||||
pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntonname [88]int8
|
||||
pkg syscall (freebsd-arm), func Mknod(string, uint32, int) error
|
||||
pkg syscall (freebsd-arm), type Dirent struct, Fileno uint32
|
||||
pkg syscall (freebsd-arm), type Dirent struct, Namlen uint8
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Blksize uint32
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Dev uint32
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Gen uint32
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Ino uint32
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Lspare int32
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Nlink uint16
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Rdev uint32
|
||||
pkg syscall (freebsd-arm), type Statfs_t struct, Mntfromname [88]int8
|
||||
pkg syscall (freebsd-arm), type Statfs_t struct, Mntonname [88]int8
|
||||
pkg syscall (freebsd-arm-cgo), func Mknod(string, uint32, int) error
|
||||
pkg syscall (freebsd-arm-cgo), type Dirent struct, Fileno uint32
|
||||
pkg syscall (freebsd-arm-cgo), type Dirent struct, Namlen uint8
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Blksize uint32
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Dev uint32
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Gen uint32
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ino uint32
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Lspare int32
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Nlink uint16
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Rdev uint32
|
||||
pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntfromname [88]int8
|
||||
pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntonname [88]int8
|
||||
pkg text/scanner, const GoTokens = 1012
|
||||
pkg unicode, const Version = "10.0.0"
|
||||
pkg unicode, const Version = "11.0.0"
|
||||
pkg unicode, const Version = "12.0.0"
|
||||
|
||||
627
api/go1.10.txt
627
api/go1.10.txt
@@ -1,627 +0,0 @@
|
||||
pkg archive/tar, const FormatGNU = 8
|
||||
pkg archive/tar, const FormatGNU Format
|
||||
pkg archive/tar, const FormatPAX = 4
|
||||
pkg archive/tar, const FormatPAX Format
|
||||
pkg archive/tar, const FormatUSTAR = 2
|
||||
pkg archive/tar, const FormatUSTAR Format
|
||||
pkg archive/tar, const FormatUnknown = 0
|
||||
pkg archive/tar, const FormatUnknown Format
|
||||
pkg archive/tar, method (Format) String() string
|
||||
pkg archive/tar, type Format int
|
||||
pkg archive/tar, type Header struct, Format Format
|
||||
pkg archive/tar, type Header struct, PAXRecords map[string]string
|
||||
pkg archive/zip, method (*Writer) SetComment(string) error
|
||||
pkg archive/zip, type FileHeader struct, Modified time.Time
|
||||
pkg archive/zip, type FileHeader struct, NonUTF8 bool
|
||||
pkg bufio, method (*Reader) Size() int
|
||||
pkg bufio, method (*Writer) Size() int
|
||||
pkg crypto/tls, const ECDSAWithSHA1 = 515
|
||||
pkg crypto/tls, const ECDSAWithSHA1 SignatureScheme
|
||||
pkg crypto/x509, const CANotAuthorizedForExtKeyUsage = 9
|
||||
pkg crypto/x509, const CANotAuthorizedForExtKeyUsage InvalidReason
|
||||
pkg crypto/x509, const ExtKeyUsageMicrosoftCommercialCodeSigning = 12
|
||||
pkg crypto/x509, const ExtKeyUsageMicrosoftCommercialCodeSigning ExtKeyUsage
|
||||
pkg crypto/x509, const ExtKeyUsageMicrosoftKernelCodeSigning = 13
|
||||
pkg crypto/x509, const ExtKeyUsageMicrosoftKernelCodeSigning ExtKeyUsage
|
||||
pkg crypto/x509, const NameConstraintsWithoutSANs = 6
|
||||
pkg crypto/x509, const NameConstraintsWithoutSANs InvalidReason
|
||||
pkg crypto/x509, const TooManyConstraints = 8
|
||||
pkg crypto/x509, const TooManyConstraints InvalidReason
|
||||
pkg crypto/x509, const UnconstrainedName = 7
|
||||
pkg crypto/x509, const UnconstrainedName InvalidReason
|
||||
pkg crypto/x509, func MarshalPKCS1PublicKey(*rsa.PublicKey) []uint8
|
||||
pkg crypto/x509, func MarshalPKCS8PrivateKey(interface{}) ([]uint8, error)
|
||||
pkg crypto/x509, func ParsePKCS1PublicKey([]uint8) (*rsa.PublicKey, error)
|
||||
pkg crypto/x509, method (PublicKeyAlgorithm) String() string
|
||||
pkg crypto/x509, type Certificate struct, ExcludedEmailAddresses []string
|
||||
pkg crypto/x509, type Certificate struct, ExcludedIPRanges []*net.IPNet
|
||||
pkg crypto/x509, type Certificate struct, ExcludedURIDomains []string
|
||||
pkg crypto/x509, type Certificate struct, PermittedEmailAddresses []string
|
||||
pkg crypto/x509, type Certificate struct, PermittedIPRanges []*net.IPNet
|
||||
pkg crypto/x509, type Certificate struct, PermittedURIDomains []string
|
||||
pkg crypto/x509, type Certificate struct, URIs []*url.URL
|
||||
pkg crypto/x509, type CertificateInvalidError struct, Detail string
|
||||
pkg crypto/x509, type CertificateRequest struct, URIs []*url.URL
|
||||
pkg crypto/x509, type VerifyOptions struct, MaxConstraintComparisions int
|
||||
pkg crypto/x509/pkix, method (Name) String() string
|
||||
pkg crypto/x509/pkix, method (RDNSequence) String() string
|
||||
pkg database/sql, func OpenDB(driver.Connector) *DB
|
||||
pkg database/sql/driver, type Connector interface { Connect, Driver }
|
||||
pkg database/sql/driver, type Connector interface, Connect(context.Context) (Conn, error)
|
||||
pkg database/sql/driver, type Connector interface, Driver() Driver
|
||||
pkg database/sql/driver, type DriverContext interface { OpenConnector }
|
||||
pkg database/sql/driver, type DriverContext interface, OpenConnector(string) (Connector, error)
|
||||
pkg database/sql/driver, type SessionResetter interface { ResetSession }
|
||||
pkg database/sql/driver, type SessionResetter interface, ResetSession(context.Context) error
|
||||
pkg debug/elf, const R_386_16 = 20
|
||||
pkg debug/elf, const R_386_16 R_386
|
||||
pkg debug/elf, const R_386_32PLT = 11
|
||||
pkg debug/elf, const R_386_32PLT R_386
|
||||
pkg debug/elf, const R_386_8 = 22
|
||||
pkg debug/elf, const R_386_8 R_386
|
||||
pkg debug/elf, const R_386_GOT32X = 43
|
||||
pkg debug/elf, const R_386_GOT32X R_386
|
||||
pkg debug/elf, const R_386_IRELATIVE = 42
|
||||
pkg debug/elf, const R_386_IRELATIVE R_386
|
||||
pkg debug/elf, const R_386_PC16 = 21
|
||||
pkg debug/elf, const R_386_PC16 R_386
|
||||
pkg debug/elf, const R_386_PC8 = 23
|
||||
pkg debug/elf, const R_386_PC8 R_386
|
||||
pkg debug/elf, const R_386_SIZE32 = 38
|
||||
pkg debug/elf, const R_386_SIZE32 R_386
|
||||
pkg debug/elf, const R_386_TLS_DESC = 41
|
||||
pkg debug/elf, const R_386_TLS_DESC R_386
|
||||
pkg debug/elf, const R_386_TLS_DESC_CALL = 40
|
||||
pkg debug/elf, const R_386_TLS_DESC_CALL R_386
|
||||
pkg debug/elf, const R_386_TLS_GOTDESC = 39
|
||||
pkg debug/elf, const R_386_TLS_GOTDESC R_386
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOTOFF_LO15 = 310
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOTOFF_LO15 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOTPAGE_LO15 = 313
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOTPAGE_LO15 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_ADR_PREL21 = 512
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_ADR_PREL21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_MOVW_G0_NC = 516
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_MOVW_G0_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_MOVW_G1 = 515
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_MOVW_G1 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_ADR_PAGE21 = 518
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_ADR_PAGE21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_ADR_PREL21 = 517
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_ADR_PREL21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_LDST128_DTPREL_LO12 = 572
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_LDST128_DTPREL_LO12 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC = 573
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_LDST128_TPREL_LO12 = 570
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_LDST128_TPREL_LO12 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC = 571
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_ARM_ABS32_NOI = 55
|
||||
pkg debug/elf, const R_ARM_ABS32_NOI R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_15_8 = 33
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_15_8 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_23_15 = 34
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_23_15 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_7_0 = 32
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_7_0 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G0 = 58
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G0_NC = 57
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G0_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G1 = 60
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G1_NC = 59
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G1_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G2 = 61
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SBREL_19_12_NC = 36
|
||||
pkg debug/elf, const R_ARM_ALU_SBREL_19_12_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SBREL_27_20_CK = 37
|
||||
pkg debug/elf, const R_ARM_ALU_SBREL_27_20_CK R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G0 = 71
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G0_NC = 70
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G0_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G1 = 73
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G1_NC = 72
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G1_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G2 = 74
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_BASE_ABS = 31
|
||||
pkg debug/elf, const R_ARM_BASE_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_CALL = 28
|
||||
pkg debug/elf, const R_ARM_CALL R_ARM
|
||||
pkg debug/elf, const R_ARM_GOTOFF12 = 98
|
||||
pkg debug/elf, const R_ARM_GOTOFF12 R_ARM
|
||||
pkg debug/elf, const R_ARM_GOTRELAX = 99
|
||||
pkg debug/elf, const R_ARM_GOTRELAX R_ARM
|
||||
pkg debug/elf, const R_ARM_GOT_ABS = 95
|
||||
pkg debug/elf, const R_ARM_GOT_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_GOT_BREL12 = 97
|
||||
pkg debug/elf, const R_ARM_GOT_BREL12 R_ARM
|
||||
pkg debug/elf, const R_ARM_GOT_PREL = 96
|
||||
pkg debug/elf, const R_ARM_GOT_PREL R_ARM
|
||||
pkg debug/elf, const R_ARM_IRELATIVE = 160
|
||||
pkg debug/elf, const R_ARM_IRELATIVE R_ARM
|
||||
pkg debug/elf, const R_ARM_JUMP24 = 29
|
||||
pkg debug/elf, const R_ARM_JUMP24 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G0 = 67
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G1 = 68
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G2 = 69
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G0 = 81
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G1 = 82
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G2 = 83
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G0 = 64
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G1 = 65
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G2 = 66
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G0 = 78
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G1 = 79
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G2 = 80
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_PC_G1 = 62
|
||||
pkg debug/elf, const R_ARM_LDR_PC_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_PC_G2 = 63
|
||||
pkg debug/elf, const R_ARM_LDR_PC_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_SBREL_11_10_NC = 35
|
||||
pkg debug/elf, const R_ARM_LDR_SBREL_11_10_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G0 = 75
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G1 = 76
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G2 = 77
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_ME_TOO = 128
|
||||
pkg debug/elf, const R_ARM_ME_TOO R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVT_ABS = 44
|
||||
pkg debug/elf, const R_ARM_MOVT_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVT_BREL = 85
|
||||
pkg debug/elf, const R_ARM_MOVT_BREL R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVT_PREL = 46
|
||||
pkg debug/elf, const R_ARM_MOVT_PREL R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVW_ABS_NC = 43
|
||||
pkg debug/elf, const R_ARM_MOVW_ABS_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVW_BREL = 86
|
||||
pkg debug/elf, const R_ARM_MOVW_BREL R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVW_BREL_NC = 84
|
||||
pkg debug/elf, const R_ARM_MOVW_BREL_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVW_PREL_NC = 45
|
||||
pkg debug/elf, const R_ARM_MOVW_PREL_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_PLT32_ABS = 94
|
||||
pkg debug/elf, const R_ARM_PLT32_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_PREL31 = 42
|
||||
pkg debug/elf, const R_ARM_PREL31 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_0 = 112
|
||||
pkg debug/elf, const R_ARM_PRIVATE_0 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_1 = 113
|
||||
pkg debug/elf, const R_ARM_PRIVATE_1 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_10 = 122
|
||||
pkg debug/elf, const R_ARM_PRIVATE_10 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_11 = 123
|
||||
pkg debug/elf, const R_ARM_PRIVATE_11 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_12 = 124
|
||||
pkg debug/elf, const R_ARM_PRIVATE_12 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_13 = 125
|
||||
pkg debug/elf, const R_ARM_PRIVATE_13 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_14 = 126
|
||||
pkg debug/elf, const R_ARM_PRIVATE_14 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_15 = 127
|
||||
pkg debug/elf, const R_ARM_PRIVATE_15 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_2 = 114
|
||||
pkg debug/elf, const R_ARM_PRIVATE_2 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_3 = 115
|
||||
pkg debug/elf, const R_ARM_PRIVATE_3 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_4 = 116
|
||||
pkg debug/elf, const R_ARM_PRIVATE_4 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_5 = 117
|
||||
pkg debug/elf, const R_ARM_PRIVATE_5 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_6 = 118
|
||||
pkg debug/elf, const R_ARM_PRIVATE_6 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_7 = 119
|
||||
pkg debug/elf, const R_ARM_PRIVATE_7 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_8 = 120
|
||||
pkg debug/elf, const R_ARM_PRIVATE_8 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_9 = 121
|
||||
pkg debug/elf, const R_ARM_PRIVATE_9 R_ARM
|
||||
pkg debug/elf, const R_ARM_REL32_NOI = 56
|
||||
pkg debug/elf, const R_ARM_REL32_NOI R_ARM
|
||||
pkg debug/elf, const R_ARM_RXPC25 = 249
|
||||
pkg debug/elf, const R_ARM_RXPC25 R_ARM
|
||||
pkg debug/elf, const R_ARM_SBREL31 = 39
|
||||
pkg debug/elf, const R_ARM_SBREL31 R_ARM
|
||||
pkg debug/elf, const R_ARM_TARGET1 = 38
|
||||
pkg debug/elf, const R_ARM_TARGET1 R_ARM
|
||||
pkg debug/elf, const R_ARM_TARGET2 = 41
|
||||
pkg debug/elf, const R_ARM_TARGET2 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G0_NC = 132
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G0_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G1_NC = 133
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G1_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G2_NC = 134
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G2_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G3 = 135
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G3 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_PREL_11_0 = 53
|
||||
pkg debug/elf, const R_ARM_THM_ALU_PREL_11_0 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_GOT_BREL12 = 131
|
||||
pkg debug/elf, const R_ARM_THM_GOT_BREL12 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP11 = 102
|
||||
pkg debug/elf, const R_ARM_THM_JUMP11 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP19 = 51
|
||||
pkg debug/elf, const R_ARM_THM_JUMP19 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP24 = 30
|
||||
pkg debug/elf, const R_ARM_THM_JUMP24 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP6 = 52
|
||||
pkg debug/elf, const R_ARM_THM_JUMP6 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP8 = 103
|
||||
pkg debug/elf, const R_ARM_THM_JUMP8 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_ABS = 48
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_BREL = 88
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_BREL R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_PREL = 50
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_PREL R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_ABS_NC = 47
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_ABS_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_BREL = 89
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_BREL R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_BREL_NC = 87
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_BREL_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_PREL_NC = 49
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_PREL_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_PC12 = 54
|
||||
pkg debug/elf, const R_ARM_THM_PC12 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_TLS_CALL = 93
|
||||
pkg debug/elf, const R_ARM_THM_TLS_CALL R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_TLS_DESCSEQ16 = 129
|
||||
pkg debug/elf, const R_ARM_THM_TLS_DESCSEQ16 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_TLS_DESCSEQ32 = 130
|
||||
pkg debug/elf, const R_ARM_THM_TLS_DESCSEQ32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_CALL = 91
|
||||
pkg debug/elf, const R_ARM_TLS_CALL R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_DESCSEQ = 92
|
||||
pkg debug/elf, const R_ARM_TLS_DESCSEQ R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_DTPMOD32 = 17
|
||||
pkg debug/elf, const R_ARM_TLS_DTPMOD32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_DTPOFF32 = 18
|
||||
pkg debug/elf, const R_ARM_TLS_DTPOFF32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_GD32 = 104
|
||||
pkg debug/elf, const R_ARM_TLS_GD32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_GOTDESC = 90
|
||||
pkg debug/elf, const R_ARM_TLS_GOTDESC R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_IE12GP = 111
|
||||
pkg debug/elf, const R_ARM_TLS_IE12GP R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_IE32 = 107
|
||||
pkg debug/elf, const R_ARM_TLS_IE32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LDM32 = 105
|
||||
pkg debug/elf, const R_ARM_TLS_LDM32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LDO12 = 109
|
||||
pkg debug/elf, const R_ARM_TLS_LDO12 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LDO32 = 106
|
||||
pkg debug/elf, const R_ARM_TLS_LDO32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LE12 = 110
|
||||
pkg debug/elf, const R_ARM_TLS_LE12 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LE32 = 108
|
||||
pkg debug/elf, const R_ARM_TLS_LE32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_TPOFF32 = 19
|
||||
pkg debug/elf, const R_ARM_TLS_TPOFF32 R_ARM
|
||||
pkg debug/elf, const R_ARM_V4BX = 40
|
||||
pkg debug/elf, const R_ARM_V4BX R_ARM
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGH = 110
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGH R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHA = 111
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR64_LOCAL = 117
|
||||
pkg debug/elf, const R_PPC64_ADDR64_LOCAL R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGH = 114
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGH R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHA = 115
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ENTRY = 118
|
||||
pkg debug/elf, const R_PPC64_ENTRY R_PPC64
|
||||
pkg debug/elf, const R_PPC64_IRELATIVE = 248
|
||||
pkg debug/elf, const R_PPC64_IRELATIVE R_PPC64
|
||||
pkg debug/elf, const R_PPC64_JMP_IREL = 247
|
||||
pkg debug/elf, const R_PPC64_JMP_IREL R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLT16_LO_DS = 60
|
||||
pkg debug/elf, const R_PPC64_PLT16_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16 = 52
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_DS = 65
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_HA = 55
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_HI = 54
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_LO = 53
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT_LO_DS = 66
|
||||
pkg debug/elf, const R_PPC64_PLTGOT_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL16DX_HA = 246
|
||||
pkg debug/elf, const R_PPC64_REL16DX_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL24_NOTOC = 116
|
||||
pkg debug/elf, const R_PPC64_REL24_NOTOC R_PPC64
|
||||
pkg debug/elf, const R_PPC64_SECTOFF_DS = 61
|
||||
pkg debug/elf, const R_PPC64_SECTOFF_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_SECTOFF_LO_DS = 61
|
||||
pkg debug/elf, const R_PPC64_SECTOFF_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TOCSAVE = 109
|
||||
pkg debug/elf, const R_PPC64_TOCSAVE R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGH = 112
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGH R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHA = 113
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHA R_PPC64
|
||||
pkg debug/elf, const R_X86_64_GOT64 = 27
|
||||
pkg debug/elf, const R_X86_64_GOT64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTOFF64 = 25
|
||||
pkg debug/elf, const R_X86_64_GOTOFF64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPC32 = 26
|
||||
pkg debug/elf, const R_X86_64_GOTPC32 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPC32_TLSDESC = 34
|
||||
pkg debug/elf, const R_X86_64_GOTPC32_TLSDESC R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPC64 = 29
|
||||
pkg debug/elf, const R_X86_64_GOTPC64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPCREL64 = 28
|
||||
pkg debug/elf, const R_X86_64_GOTPCREL64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPCRELX = 41
|
||||
pkg debug/elf, const R_X86_64_GOTPCRELX R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPLT64 = 30
|
||||
pkg debug/elf, const R_X86_64_GOTPLT64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_IRELATIVE = 37
|
||||
pkg debug/elf, const R_X86_64_IRELATIVE R_X86_64
|
||||
pkg debug/elf, const R_X86_64_PC32_BND = 39
|
||||
pkg debug/elf, const R_X86_64_PC32_BND R_X86_64
|
||||
pkg debug/elf, const R_X86_64_PC64 = 24
|
||||
pkg debug/elf, const R_X86_64_PC64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_PLT32_BND = 40
|
||||
pkg debug/elf, const R_X86_64_PLT32_BND R_X86_64
|
||||
pkg debug/elf, const R_X86_64_PLTOFF64 = 31
|
||||
pkg debug/elf, const R_X86_64_PLTOFF64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_RELATIVE64 = 38
|
||||
pkg debug/elf, const R_X86_64_RELATIVE64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_REX_GOTPCRELX = 42
|
||||
pkg debug/elf, const R_X86_64_REX_GOTPCRELX R_X86_64
|
||||
pkg debug/elf, const R_X86_64_SIZE32 = 32
|
||||
pkg debug/elf, const R_X86_64_SIZE32 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_SIZE64 = 33
|
||||
pkg debug/elf, const R_X86_64_SIZE64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_TLSDESC = 36
|
||||
pkg debug/elf, const R_X86_64_TLSDESC R_X86_64
|
||||
pkg debug/elf, const R_X86_64_TLSDESC_CALL = 35
|
||||
pkg debug/elf, const R_X86_64_TLSDESC_CALL R_X86_64
|
||||
pkg debug/macho, const ARM64_RELOC_ADDEND = 10
|
||||
pkg debug/macho, const ARM64_RELOC_ADDEND RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_BRANCH26 = 2
|
||||
pkg debug/macho, const ARM64_RELOC_BRANCH26 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_GOT_LOAD_PAGE21 = 5
|
||||
pkg debug/macho, const ARM64_RELOC_GOT_LOAD_PAGE21 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_GOT_LOAD_PAGEOFF12 = 6
|
||||
pkg debug/macho, const ARM64_RELOC_GOT_LOAD_PAGEOFF12 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_PAGE21 = 3
|
||||
pkg debug/macho, const ARM64_RELOC_PAGE21 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_PAGEOFF12 = 4
|
||||
pkg debug/macho, const ARM64_RELOC_PAGEOFF12 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_POINTER_TO_GOT = 7
|
||||
pkg debug/macho, const ARM64_RELOC_POINTER_TO_GOT RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_SUBTRACTOR = 1
|
||||
pkg debug/macho, const ARM64_RELOC_SUBTRACTOR RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_TLVP_LOAD_PAGE21 = 8
|
||||
pkg debug/macho, const ARM64_RELOC_TLVP_LOAD_PAGE21 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_TLVP_LOAD_PAGEOFF12 = 9
|
||||
pkg debug/macho, const ARM64_RELOC_TLVP_LOAD_PAGEOFF12 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_UNSIGNED = 0
|
||||
pkg debug/macho, const ARM64_RELOC_UNSIGNED RelocTypeARM64
|
||||
pkg debug/macho, const ARM_RELOC_BR24 = 5
|
||||
pkg debug/macho, const ARM_RELOC_BR24 RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_HALF = 8
|
||||
pkg debug/macho, const ARM_RELOC_HALF RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_HALF_SECTDIFF = 9
|
||||
pkg debug/macho, const ARM_RELOC_HALF_SECTDIFF RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_LOCAL_SECTDIFF = 3
|
||||
pkg debug/macho, const ARM_RELOC_LOCAL_SECTDIFF RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_PAIR = 1
|
||||
pkg debug/macho, const ARM_RELOC_PAIR RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_PB_LA_PTR = 4
|
||||
pkg debug/macho, const ARM_RELOC_PB_LA_PTR RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_SECTDIFF = 2
|
||||
pkg debug/macho, const ARM_RELOC_SECTDIFF RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_VANILLA = 0
|
||||
pkg debug/macho, const ARM_RELOC_VANILLA RelocTypeARM
|
||||
pkg debug/macho, const ARM_THUMB_32BIT_BRANCH = 7
|
||||
pkg debug/macho, const ARM_THUMB_32BIT_BRANCH RelocTypeARM
|
||||
pkg debug/macho, const ARM_THUMB_RELOC_BR22 = 6
|
||||
pkg debug/macho, const ARM_THUMB_RELOC_BR22 RelocTypeARM
|
||||
pkg debug/macho, const FlagAllModsBound = 4096
|
||||
pkg debug/macho, const FlagAllModsBound uint32
|
||||
pkg debug/macho, const FlagAllowStackExecution = 131072
|
||||
pkg debug/macho, const FlagAllowStackExecution uint32
|
||||
pkg debug/macho, const FlagAppExtensionSafe = 33554432
|
||||
pkg debug/macho, const FlagAppExtensionSafe uint32
|
||||
pkg debug/macho, const FlagBindAtLoad = 8
|
||||
pkg debug/macho, const FlagBindAtLoad uint32
|
||||
pkg debug/macho, const FlagBindsToWeak = 65536
|
||||
pkg debug/macho, const FlagBindsToWeak uint32
|
||||
pkg debug/macho, const FlagCanonical = 16384
|
||||
pkg debug/macho, const FlagCanonical uint32
|
||||
pkg debug/macho, const FlagDeadStrippableDylib = 4194304
|
||||
pkg debug/macho, const FlagDeadStrippableDylib uint32
|
||||
pkg debug/macho, const FlagDyldLink = 4
|
||||
pkg debug/macho, const FlagDyldLink uint32
|
||||
pkg debug/macho, const FlagForceFlat = 256
|
||||
pkg debug/macho, const FlagForceFlat uint32
|
||||
pkg debug/macho, const FlagHasTLVDescriptors = 8388608
|
||||
pkg debug/macho, const FlagHasTLVDescriptors uint32
|
||||
pkg debug/macho, const FlagIncrLink = 2
|
||||
pkg debug/macho, const FlagIncrLink uint32
|
||||
pkg debug/macho, const FlagLazyInit = 64
|
||||
pkg debug/macho, const FlagLazyInit uint32
|
||||
pkg debug/macho, const FlagNoFixPrebinding = 1024
|
||||
pkg debug/macho, const FlagNoFixPrebinding uint32
|
||||
pkg debug/macho, const FlagNoHeapExecution = 16777216
|
||||
pkg debug/macho, const FlagNoHeapExecution uint32
|
||||
pkg debug/macho, const FlagNoMultiDefs = 512
|
||||
pkg debug/macho, const FlagNoMultiDefs uint32
|
||||
pkg debug/macho, const FlagNoReexportedDylibs = 1048576
|
||||
pkg debug/macho, const FlagNoReexportedDylibs uint32
|
||||
pkg debug/macho, const FlagNoUndefs = 1
|
||||
pkg debug/macho, const FlagNoUndefs uint32
|
||||
pkg debug/macho, const FlagPIE = 2097152
|
||||
pkg debug/macho, const FlagPIE uint32
|
||||
pkg debug/macho, const FlagPrebindable = 2048
|
||||
pkg debug/macho, const FlagPrebindable uint32
|
||||
pkg debug/macho, const FlagPrebound = 16
|
||||
pkg debug/macho, const FlagPrebound uint32
|
||||
pkg debug/macho, const FlagRootSafe = 262144
|
||||
pkg debug/macho, const FlagRootSafe uint32
|
||||
pkg debug/macho, const FlagSetuidSafe = 524288
|
||||
pkg debug/macho, const FlagSetuidSafe uint32
|
||||
pkg debug/macho, const FlagSplitSegs = 32
|
||||
pkg debug/macho, const FlagSplitSegs uint32
|
||||
pkg debug/macho, const FlagSubsectionsViaSymbols = 8192
|
||||
pkg debug/macho, const FlagSubsectionsViaSymbols uint32
|
||||
pkg debug/macho, const FlagTwoLevel = 128
|
||||
pkg debug/macho, const FlagTwoLevel uint32
|
||||
pkg debug/macho, const FlagWeakDefines = 32768
|
||||
pkg debug/macho, const FlagWeakDefines uint32
|
||||
pkg debug/macho, const GENERIC_RELOC_LOCAL_SECTDIFF = 4
|
||||
pkg debug/macho, const GENERIC_RELOC_LOCAL_SECTDIFF RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_PAIR = 1
|
||||
pkg debug/macho, const GENERIC_RELOC_PAIR RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_PB_LA_PTR = 3
|
||||
pkg debug/macho, const GENERIC_RELOC_PB_LA_PTR RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_SECTDIFF = 2
|
||||
pkg debug/macho, const GENERIC_RELOC_SECTDIFF RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_TLV = 5
|
||||
pkg debug/macho, const GENERIC_RELOC_TLV RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_VANILLA = 0
|
||||
pkg debug/macho, const GENERIC_RELOC_VANILLA RelocTypeGeneric
|
||||
pkg debug/macho, const LoadCmdRpath = 2147483676
|
||||
pkg debug/macho, const LoadCmdRpath LoadCmd
|
||||
pkg debug/macho, const X86_64_RELOC_BRANCH = 2
|
||||
pkg debug/macho, const X86_64_RELOC_BRANCH RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_GOT = 4
|
||||
pkg debug/macho, const X86_64_RELOC_GOT RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_GOT_LOAD = 3
|
||||
pkg debug/macho, const X86_64_RELOC_GOT_LOAD RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED = 1
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_1 = 6
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_1 RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_2 = 7
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_2 RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_4 = 8
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_4 RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SUBTRACTOR = 5
|
||||
pkg debug/macho, const X86_64_RELOC_SUBTRACTOR RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_TLV = 9
|
||||
pkg debug/macho, const X86_64_RELOC_TLV RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_UNSIGNED = 0
|
||||
pkg debug/macho, const X86_64_RELOC_UNSIGNED RelocTypeX86_64
|
||||
pkg debug/macho, method (RelocTypeARM) GoString() string
|
||||
pkg debug/macho, method (RelocTypeARM) String() string
|
||||
pkg debug/macho, method (RelocTypeARM64) GoString() string
|
||||
pkg debug/macho, method (RelocTypeARM64) String() string
|
||||
pkg debug/macho, method (RelocTypeGeneric) GoString() string
|
||||
pkg debug/macho, method (RelocTypeGeneric) String() string
|
||||
pkg debug/macho, method (RelocTypeX86_64) GoString() string
|
||||
pkg debug/macho, method (RelocTypeX86_64) String() string
|
||||
pkg debug/macho, method (Rpath) Raw() []uint8
|
||||
pkg debug/macho, method (Type) GoString() string
|
||||
pkg debug/macho, method (Type) String() string
|
||||
pkg debug/macho, type Reloc struct
|
||||
pkg debug/macho, type Reloc struct, Addr uint32
|
||||
pkg debug/macho, type Reloc struct, Extern bool
|
||||
pkg debug/macho, type Reloc struct, Len uint8
|
||||
pkg debug/macho, type Reloc struct, Pcrel bool
|
||||
pkg debug/macho, type Reloc struct, Scattered bool
|
||||
pkg debug/macho, type Reloc struct, Type uint8
|
||||
pkg debug/macho, type Reloc struct, Value uint32
|
||||
pkg debug/macho, type RelocTypeARM int
|
||||
pkg debug/macho, type RelocTypeARM64 int
|
||||
pkg debug/macho, type RelocTypeGeneric int
|
||||
pkg debug/macho, type RelocTypeX86_64 int
|
||||
pkg debug/macho, type Rpath struct
|
||||
pkg debug/macho, type Rpath struct, Path string
|
||||
pkg debug/macho, type Rpath struct, embedded LoadBytes
|
||||
pkg debug/macho, type RpathCmd struct
|
||||
pkg debug/macho, type RpathCmd struct, Cmd LoadCmd
|
||||
pkg debug/macho, type RpathCmd struct, Len uint32
|
||||
pkg debug/macho, type RpathCmd struct, Path uint32
|
||||
pkg debug/macho, type Section struct, Relocs []Reloc
|
||||
pkg encoding/asn1, const TagNumericString = 18
|
||||
pkg encoding/asn1, const TagNumericString ideal-int
|
||||
pkg encoding/asn1, func MarshalWithParams(interface{}, string) ([]uint8, error)
|
||||
pkg encoding/csv, type ParseError struct, StartLine int
|
||||
pkg encoding/hex, func NewDecoder(io.Reader) io.Reader
|
||||
pkg encoding/hex, func NewEncoder(io.Writer) io.Writer
|
||||
pkg encoding/json, method (*Decoder) DisallowUnknownFields()
|
||||
pkg encoding/xml, func NewTokenDecoder(TokenReader) *Decoder
|
||||
pkg encoding/xml, type TokenReader interface { Token }
|
||||
pkg encoding/xml, type TokenReader interface, Token() (Token, error)
|
||||
pkg flag, method (*FlagSet) ErrorHandling() ErrorHandling
|
||||
pkg flag, method (*FlagSet) Name() string
|
||||
pkg flag, method (*FlagSet) Output() io.Writer
|
||||
pkg html/template, type Srcset string
|
||||
pkg math, func Erfcinv(float64) float64
|
||||
pkg math, func Erfinv(float64) float64
|
||||
pkg math, func Round(float64) float64
|
||||
pkg math, func RoundToEven(float64) float64
|
||||
pkg math/big, const MaxBase = 62
|
||||
pkg math/big, method (*Float) Sqrt(*Float) *Float
|
||||
pkg math/big, method (*Int) CmpAbs(*Int) int
|
||||
pkg math/rand, func Shuffle(int, func(int, int))
|
||||
pkg math/rand, method (*Rand) Shuffle(int, func(int, int))
|
||||
pkg net, method (*TCPListener) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, method (*UnixListener) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net/smtp, method (*Client) Noop() error
|
||||
pkg os, func IsTimeout(error) bool
|
||||
pkg os, method (*File) SetDeadline(time.Time) error
|
||||
pkg os, method (*File) SetReadDeadline(time.Time) error
|
||||
pkg os, method (*File) SetWriteDeadline(time.Time) error
|
||||
pkg os, method (*PathError) Timeout() bool
|
||||
pkg os, method (*SyscallError) Timeout() bool
|
||||
pkg os, var ErrNoDeadline error
|
||||
pkg strings, method (*Builder) Grow(int)
|
||||
pkg strings, method (*Builder) Len() int
|
||||
pkg strings, method (*Builder) Reset()
|
||||
pkg strings, method (*Builder) String() string
|
||||
pkg strings, method (*Builder) Write([]uint8) (int, error)
|
||||
pkg strings, method (*Builder) WriteByte(uint8) error
|
||||
pkg strings, method (*Builder) WriteRune(int32) (int, error)
|
||||
pkg strings, method (*Builder) WriteString(string) (int, error)
|
||||
pkg strings, type Builder struct
|
||||
pkg syscall (freebsd-386), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-386), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-386-cgo), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-386-cgo), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-amd64), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-amd64), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-arm), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (windows-386), func CreateProcessAsUser(Token, *uint16, *uint16, *SecurityAttributes, *SecurityAttributes, bool, uint32, *uint16, *uint16, *StartupInfo, *ProcessInformation) error
|
||||
pkg syscall (windows-386), type SysProcAttr struct, Token Token
|
||||
pkg syscall (windows-amd64), func CreateProcessAsUser(Token, *uint16, *uint16, *SecurityAttributes, *SecurityAttributes, bool, uint32, *uint16, *uint16, *StartupInfo, *ProcessInformation) error
|
||||
pkg syscall (windows-amd64), type SysProcAttr struct, Token Token
|
||||
pkg time, func LoadLocationFromTZData(string, []uint8) (*Location, error)
|
||||
pkg unicode, const Version = "10.0.0"
|
||||
pkg unicode, var Masaram_Gondi *RangeTable
|
||||
pkg unicode, var Nushu *RangeTable
|
||||
pkg unicode, var Regional_Indicator *RangeTable
|
||||
pkg unicode, var Soyombo *RangeTable
|
||||
pkg unicode, var Zanabazar_Square *RangeTable
|
||||
559
api/go1.11.txt
559
api/go1.11.txt
@@ -1,559 +0,0 @@
|
||||
pkg crypto/cipher, func NewGCMWithTagSize(Block, int) (AEAD, error)
|
||||
pkg crypto/rsa, method (*PrivateKey) Size() int
|
||||
pkg crypto/rsa, method (*PublicKey) Size() int
|
||||
pkg crypto/tls, method (*ConnectionState) ExportKeyingMaterial(string, []uint8, int) ([]uint8, error)
|
||||
pkg database/sql, method (IsolationLevel) String() string
|
||||
pkg database/sql, type DBStats struct, Idle int
|
||||
pkg database/sql, type DBStats struct, InUse int
|
||||
pkg database/sql, type DBStats struct, MaxIdleClosed int64
|
||||
pkg database/sql, type DBStats struct, MaxLifetimeClosed int64
|
||||
pkg database/sql, type DBStats struct, MaxOpenConnections int
|
||||
pkg database/sql, type DBStats struct, WaitCount int64
|
||||
pkg database/sql, type DBStats struct, WaitDuration time.Duration
|
||||
pkg debug/elf, const ELFOSABI_AROS = 15
|
||||
pkg debug/elf, const ELFOSABI_AROS OSABI
|
||||
pkg debug/elf, const ELFOSABI_CLOUDABI = 17
|
||||
pkg debug/elf, const ELFOSABI_CLOUDABI OSABI
|
||||
pkg debug/elf, const ELFOSABI_FENIXOS = 16
|
||||
pkg debug/elf, const ELFOSABI_FENIXOS OSABI
|
||||
pkg debug/elf, const EM_56800EX = 200
|
||||
pkg debug/elf, const EM_56800EX Machine
|
||||
pkg debug/elf, const EM_68HC05 = 72
|
||||
pkg debug/elf, const EM_68HC05 Machine
|
||||
pkg debug/elf, const EM_68HC08 = 71
|
||||
pkg debug/elf, const EM_68HC08 Machine
|
||||
pkg debug/elf, const EM_68HC11 = 70
|
||||
pkg debug/elf, const EM_68HC11 Machine
|
||||
pkg debug/elf, const EM_68HC16 = 69
|
||||
pkg debug/elf, const EM_68HC16 Machine
|
||||
pkg debug/elf, const EM_78KOR = 199
|
||||
pkg debug/elf, const EM_78KOR Machine
|
||||
pkg debug/elf, const EM_8051 = 165
|
||||
pkg debug/elf, const EM_8051 Machine
|
||||
pkg debug/elf, const EM_ALTERA_NIOS2 = 113
|
||||
pkg debug/elf, const EM_ALTERA_NIOS2 Machine
|
||||
pkg debug/elf, const EM_AMDGPU = 224
|
||||
pkg debug/elf, const EM_AMDGPU Machine
|
||||
pkg debug/elf, const EM_ARCA = 109
|
||||
pkg debug/elf, const EM_ARCA Machine
|
||||
pkg debug/elf, const EM_ARC_COMPACT = 93
|
||||
pkg debug/elf, const EM_ARC_COMPACT Machine
|
||||
pkg debug/elf, const EM_ARC_COMPACT2 = 195
|
||||
pkg debug/elf, const EM_ARC_COMPACT2 Machine
|
||||
pkg debug/elf, const EM_AVR = 83
|
||||
pkg debug/elf, const EM_AVR Machine
|
||||
pkg debug/elf, const EM_AVR32 = 185
|
||||
pkg debug/elf, const EM_AVR32 Machine
|
||||
pkg debug/elf, const EM_BA1 = 201
|
||||
pkg debug/elf, const EM_BA1 Machine
|
||||
pkg debug/elf, const EM_BA2 = 202
|
||||
pkg debug/elf, const EM_BA2 Machine
|
||||
pkg debug/elf, const EM_BLACKFIN = 106
|
||||
pkg debug/elf, const EM_BLACKFIN Machine
|
||||
pkg debug/elf, const EM_BPF = 247
|
||||
pkg debug/elf, const EM_BPF Machine
|
||||
pkg debug/elf, const EM_C166 = 116
|
||||
pkg debug/elf, const EM_C166 Machine
|
||||
pkg debug/elf, const EM_CDP = 215
|
||||
pkg debug/elf, const EM_CDP Machine
|
||||
pkg debug/elf, const EM_CE = 119
|
||||
pkg debug/elf, const EM_CE Machine
|
||||
pkg debug/elf, const EM_CLOUDSHIELD = 192
|
||||
pkg debug/elf, const EM_CLOUDSHIELD Machine
|
||||
pkg debug/elf, const EM_COGE = 216
|
||||
pkg debug/elf, const EM_COGE Machine
|
||||
pkg debug/elf, const EM_COOL = 217
|
||||
pkg debug/elf, const EM_COOL Machine
|
||||
pkg debug/elf, const EM_COREA_1ST = 193
|
||||
pkg debug/elf, const EM_COREA_1ST Machine
|
||||
pkg debug/elf, const EM_COREA_2ND = 194
|
||||
pkg debug/elf, const EM_COREA_2ND Machine
|
||||
pkg debug/elf, const EM_CR = 103
|
||||
pkg debug/elf, const EM_CR Machine
|
||||
pkg debug/elf, const EM_CR16 = 177
|
||||
pkg debug/elf, const EM_CR16 Machine
|
||||
pkg debug/elf, const EM_CRAYNV2 = 172
|
||||
pkg debug/elf, const EM_CRAYNV2 Machine
|
||||
pkg debug/elf, const EM_CRIS = 76
|
||||
pkg debug/elf, const EM_CRIS Machine
|
||||
pkg debug/elf, const EM_CRX = 114
|
||||
pkg debug/elf, const EM_CRX Machine
|
||||
pkg debug/elf, const EM_CSR_KALIMBA = 219
|
||||
pkg debug/elf, const EM_CSR_KALIMBA Machine
|
||||
pkg debug/elf, const EM_CUDA = 190
|
||||
pkg debug/elf, const EM_CUDA Machine
|
||||
pkg debug/elf, const EM_CYPRESS_M8C = 161
|
||||
pkg debug/elf, const EM_CYPRESS_M8C Machine
|
||||
pkg debug/elf, const EM_D10V = 85
|
||||
pkg debug/elf, const EM_D10V Machine
|
||||
pkg debug/elf, const EM_D30V = 86
|
||||
pkg debug/elf, const EM_D30V Machine
|
||||
pkg debug/elf, const EM_DSP24 = 136
|
||||
pkg debug/elf, const EM_DSP24 Machine
|
||||
pkg debug/elf, const EM_DSPIC30F = 118
|
||||
pkg debug/elf, const EM_DSPIC30F Machine
|
||||
pkg debug/elf, const EM_DXP = 112
|
||||
pkg debug/elf, const EM_DXP Machine
|
||||
pkg debug/elf, const EM_ECOG1 = 168
|
||||
pkg debug/elf, const EM_ECOG1 Machine
|
||||
pkg debug/elf, const EM_ECOG16 = 176
|
||||
pkg debug/elf, const EM_ECOG16 Machine
|
||||
pkg debug/elf, const EM_ECOG1X = 168
|
||||
pkg debug/elf, const EM_ECOG1X Machine
|
||||
pkg debug/elf, const EM_ECOG2 = 134
|
||||
pkg debug/elf, const EM_ECOG2 Machine
|
||||
pkg debug/elf, const EM_ETPU = 178
|
||||
pkg debug/elf, const EM_ETPU Machine
|
||||
pkg debug/elf, const EM_EXCESS = 111
|
||||
pkg debug/elf, const EM_EXCESS Machine
|
||||
pkg debug/elf, const EM_F2MC16 = 104
|
||||
pkg debug/elf, const EM_F2MC16 Machine
|
||||
pkg debug/elf, const EM_FIREPATH = 78
|
||||
pkg debug/elf, const EM_FIREPATH Machine
|
||||
pkg debug/elf, const EM_FR30 = 84
|
||||
pkg debug/elf, const EM_FR30 Machine
|
||||
pkg debug/elf, const EM_FT32 = 222
|
||||
pkg debug/elf, const EM_FT32 Machine
|
||||
pkg debug/elf, const EM_FX66 = 66
|
||||
pkg debug/elf, const EM_FX66 Machine
|
||||
pkg debug/elf, const EM_HUANY = 81
|
||||
pkg debug/elf, const EM_HUANY Machine
|
||||
pkg debug/elf, const EM_INTEL205 = 205
|
||||
pkg debug/elf, const EM_INTEL205 Machine
|
||||
pkg debug/elf, const EM_INTEL206 = 206
|
||||
pkg debug/elf, const EM_INTEL206 Machine
|
||||
pkg debug/elf, const EM_INTEL207 = 207
|
||||
pkg debug/elf, const EM_INTEL207 Machine
|
||||
pkg debug/elf, const EM_INTEL208 = 208
|
||||
pkg debug/elf, const EM_INTEL208 Machine
|
||||
pkg debug/elf, const EM_INTEL209 = 209
|
||||
pkg debug/elf, const EM_INTEL209 Machine
|
||||
pkg debug/elf, const EM_IP2K = 101
|
||||
pkg debug/elf, const EM_IP2K Machine
|
||||
pkg debug/elf, const EM_JAVELIN = 77
|
||||
pkg debug/elf, const EM_JAVELIN Machine
|
||||
pkg debug/elf, const EM_K10M = 181
|
||||
pkg debug/elf, const EM_K10M Machine
|
||||
pkg debug/elf, const EM_KM32 = 210
|
||||
pkg debug/elf, const EM_KM32 Machine
|
||||
pkg debug/elf, const EM_KMX16 = 212
|
||||
pkg debug/elf, const EM_KMX16 Machine
|
||||
pkg debug/elf, const EM_KMX32 = 211
|
||||
pkg debug/elf, const EM_KMX32 Machine
|
||||
pkg debug/elf, const EM_KMX8 = 213
|
||||
pkg debug/elf, const EM_KMX8 Machine
|
||||
pkg debug/elf, const EM_KVARC = 214
|
||||
pkg debug/elf, const EM_KVARC Machine
|
||||
pkg debug/elf, const EM_L10M = 180
|
||||
pkg debug/elf, const EM_L10M Machine
|
||||
pkg debug/elf, const EM_LANAI = 244
|
||||
pkg debug/elf, const EM_LANAI Machine
|
||||
pkg debug/elf, const EM_LATTICEMICO32 = 138
|
||||
pkg debug/elf, const EM_LATTICEMICO32 Machine
|
||||
pkg debug/elf, const EM_M16C = 117
|
||||
pkg debug/elf, const EM_M16C Machine
|
||||
pkg debug/elf, const EM_M32C = 120
|
||||
pkg debug/elf, const EM_M32C Machine
|
||||
pkg debug/elf, const EM_M32R = 88
|
||||
pkg debug/elf, const EM_M32R Machine
|
||||
pkg debug/elf, const EM_MANIK = 171
|
||||
pkg debug/elf, const EM_MANIK Machine
|
||||
pkg debug/elf, const EM_MAX = 102
|
||||
pkg debug/elf, const EM_MAX Machine
|
||||
pkg debug/elf, const EM_MAXQ30 = 169
|
||||
pkg debug/elf, const EM_MAXQ30 Machine
|
||||
pkg debug/elf, const EM_MCHP_PIC = 204
|
||||
pkg debug/elf, const EM_MCHP_PIC Machine
|
||||
pkg debug/elf, const EM_MCST_ELBRUS = 175
|
||||
pkg debug/elf, const EM_MCST_ELBRUS Machine
|
||||
pkg debug/elf, const EM_METAG = 174
|
||||
pkg debug/elf, const EM_METAG Machine
|
||||
pkg debug/elf, const EM_MICROBLAZE = 189
|
||||
pkg debug/elf, const EM_MICROBLAZE Machine
|
||||
pkg debug/elf, const EM_MMDSP_PLUS = 160
|
||||
pkg debug/elf, const EM_MMDSP_PLUS Machine
|
||||
pkg debug/elf, const EM_MMIX = 80
|
||||
pkg debug/elf, const EM_MMIX Machine
|
||||
pkg debug/elf, const EM_MN10200 = 90
|
||||
pkg debug/elf, const EM_MN10200 Machine
|
||||
pkg debug/elf, const EM_MN10300 = 89
|
||||
pkg debug/elf, const EM_MN10300 Machine
|
||||
pkg debug/elf, const EM_MOXIE = 223
|
||||
pkg debug/elf, const EM_MOXIE Machine
|
||||
pkg debug/elf, const EM_MSP430 = 105
|
||||
pkg debug/elf, const EM_MSP430 Machine
|
||||
pkg debug/elf, const EM_NDS32 = 167
|
||||
pkg debug/elf, const EM_NDS32 Machine
|
||||
pkg debug/elf, const EM_NORC = 218
|
||||
pkg debug/elf, const EM_NORC Machine
|
||||
pkg debug/elf, const EM_NS32K = 97
|
||||
pkg debug/elf, const EM_NS32K Machine
|
||||
pkg debug/elf, const EM_OPEN8 = 196
|
||||
pkg debug/elf, const EM_OPEN8 Machine
|
||||
pkg debug/elf, const EM_OPENRISC = 92
|
||||
pkg debug/elf, const EM_OPENRISC Machine
|
||||
pkg debug/elf, const EM_PDP10 = 64
|
||||
pkg debug/elf, const EM_PDP10 Machine
|
||||
pkg debug/elf, const EM_PDP11 = 65
|
||||
pkg debug/elf, const EM_PDP11 Machine
|
||||
pkg debug/elf, const EM_PDSP = 63
|
||||
pkg debug/elf, const EM_PDSP Machine
|
||||
pkg debug/elf, const EM_PJ = 91
|
||||
pkg debug/elf, const EM_PJ Machine
|
||||
pkg debug/elf, const EM_PRISM = 82
|
||||
pkg debug/elf, const EM_PRISM Machine
|
||||
pkg debug/elf, const EM_QDSP6 = 164
|
||||
pkg debug/elf, const EM_QDSP6 Machine
|
||||
pkg debug/elf, const EM_R32C = 162
|
||||
pkg debug/elf, const EM_R32C Machine
|
||||
pkg debug/elf, const EM_RISCV = 243
|
||||
pkg debug/elf, const EM_RISCV Machine
|
||||
pkg debug/elf, const EM_RL78 = 197
|
||||
pkg debug/elf, const EM_RL78 Machine
|
||||
pkg debug/elf, const EM_RS08 = 132
|
||||
pkg debug/elf, const EM_RS08 Machine
|
||||
pkg debug/elf, const EM_RX = 173
|
||||
pkg debug/elf, const EM_RX Machine
|
||||
pkg debug/elf, const EM_SCORE7 = 135
|
||||
pkg debug/elf, const EM_SCORE7 Machine
|
||||
pkg debug/elf, const EM_SEP = 108
|
||||
pkg debug/elf, const EM_SEP Machine
|
||||
pkg debug/elf, const EM_SE_C17 = 139
|
||||
pkg debug/elf, const EM_SE_C17 Machine
|
||||
pkg debug/elf, const EM_SE_C33 = 107
|
||||
pkg debug/elf, const EM_SE_C33 Machine
|
||||
pkg debug/elf, const EM_SHARC = 133
|
||||
pkg debug/elf, const EM_SHARC Machine
|
||||
pkg debug/elf, const EM_SLE9X = 179
|
||||
pkg debug/elf, const EM_SLE9X Machine
|
||||
pkg debug/elf, const EM_SNP1K = 99
|
||||
pkg debug/elf, const EM_SNP1K Machine
|
||||
pkg debug/elf, const EM_ST19 = 74
|
||||
pkg debug/elf, const EM_ST19 Machine
|
||||
pkg debug/elf, const EM_ST200 = 100
|
||||
pkg debug/elf, const EM_ST200 Machine
|
||||
pkg debug/elf, const EM_ST7 = 68
|
||||
pkg debug/elf, const EM_ST7 Machine
|
||||
pkg debug/elf, const EM_ST9PLUS = 67
|
||||
pkg debug/elf, const EM_ST9PLUS Machine
|
||||
pkg debug/elf, const EM_STM8 = 186
|
||||
pkg debug/elf, const EM_STM8 Machine
|
||||
pkg debug/elf, const EM_STXP7X = 166
|
||||
pkg debug/elf, const EM_STXP7X Machine
|
||||
pkg debug/elf, const EM_SVX = 73
|
||||
pkg debug/elf, const EM_SVX Machine
|
||||
pkg debug/elf, const EM_TILE64 = 187
|
||||
pkg debug/elf, const EM_TILE64 Machine
|
||||
pkg debug/elf, const EM_TILEGX = 191
|
||||
pkg debug/elf, const EM_TILEGX Machine
|
||||
pkg debug/elf, const EM_TILEPRO = 188
|
||||
pkg debug/elf, const EM_TILEPRO Machine
|
||||
pkg debug/elf, const EM_TI_ARP32 = 143
|
||||
pkg debug/elf, const EM_TI_ARP32 Machine
|
||||
pkg debug/elf, const EM_TI_C2000 = 141
|
||||
pkg debug/elf, const EM_TI_C2000 Machine
|
||||
pkg debug/elf, const EM_TI_C5500 = 142
|
||||
pkg debug/elf, const EM_TI_C5500 Machine
|
||||
pkg debug/elf, const EM_TI_C6000 = 140
|
||||
pkg debug/elf, const EM_TI_C6000 Machine
|
||||
pkg debug/elf, const EM_TI_PRU = 144
|
||||
pkg debug/elf, const EM_TI_PRU Machine
|
||||
pkg debug/elf, const EM_TMM_GPP = 96
|
||||
pkg debug/elf, const EM_TMM_GPP Machine
|
||||
pkg debug/elf, const EM_TPC = 98
|
||||
pkg debug/elf, const EM_TPC Machine
|
||||
pkg debug/elf, const EM_TRIMEDIA = 163
|
||||
pkg debug/elf, const EM_TRIMEDIA Machine
|
||||
pkg debug/elf, const EM_TSK3000 = 131
|
||||
pkg debug/elf, const EM_TSK3000 Machine
|
||||
pkg debug/elf, const EM_UNICORE = 110
|
||||
pkg debug/elf, const EM_UNICORE Machine
|
||||
pkg debug/elf, const EM_V850 = 87
|
||||
pkg debug/elf, const EM_V850 Machine
|
||||
pkg debug/elf, const EM_VAX = 75
|
||||
pkg debug/elf, const EM_VAX Machine
|
||||
pkg debug/elf, const EM_VIDEOCORE = 95
|
||||
pkg debug/elf, const EM_VIDEOCORE Machine
|
||||
pkg debug/elf, const EM_VIDEOCORE3 = 137
|
||||
pkg debug/elf, const EM_VIDEOCORE3 Machine
|
||||
pkg debug/elf, const EM_VIDEOCORE5 = 198
|
||||
pkg debug/elf, const EM_VIDEOCORE5 Machine
|
||||
pkg debug/elf, const EM_VISIUM = 221
|
||||
pkg debug/elf, const EM_VISIUM Machine
|
||||
pkg debug/elf, const EM_XCORE = 203
|
||||
pkg debug/elf, const EM_XCORE Machine
|
||||
pkg debug/elf, const EM_XGATE = 115
|
||||
pkg debug/elf, const EM_XGATE Machine
|
||||
pkg debug/elf, const EM_XIMO16 = 170
|
||||
pkg debug/elf, const EM_XIMO16 Machine
|
||||
pkg debug/elf, const EM_XTENSA = 94
|
||||
pkg debug/elf, const EM_XTENSA Machine
|
||||
pkg debug/elf, const EM_Z80 = 220
|
||||
pkg debug/elf, const EM_Z80 Machine
|
||||
pkg debug/elf, const EM_ZSP = 79
|
||||
pkg debug/elf, const EM_ZSP Machine
|
||||
pkg debug/elf, const R_RISCV_32 = 1
|
||||
pkg debug/elf, const R_RISCV_32 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_64 = 2
|
||||
pkg debug/elf, const R_RISCV_64 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_ADD16 = 34
|
||||
pkg debug/elf, const R_RISCV_ADD16 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_ADD32 = 35
|
||||
pkg debug/elf, const R_RISCV_ADD32 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_ADD64 = 36
|
||||
pkg debug/elf, const R_RISCV_ADD64 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_ADD8 = 33
|
||||
pkg debug/elf, const R_RISCV_ADD8 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_ALIGN = 43
|
||||
pkg debug/elf, const R_RISCV_ALIGN R_RISCV
|
||||
pkg debug/elf, const R_RISCV_BRANCH = 16
|
||||
pkg debug/elf, const R_RISCV_BRANCH R_RISCV
|
||||
pkg debug/elf, const R_RISCV_CALL = 18
|
||||
pkg debug/elf, const R_RISCV_CALL R_RISCV
|
||||
pkg debug/elf, const R_RISCV_CALL_PLT = 19
|
||||
pkg debug/elf, const R_RISCV_CALL_PLT R_RISCV
|
||||
pkg debug/elf, const R_RISCV_COPY = 4
|
||||
pkg debug/elf, const R_RISCV_COPY R_RISCV
|
||||
pkg debug/elf, const R_RISCV_GNU_VTENTRY = 42
|
||||
pkg debug/elf, const R_RISCV_GNU_VTENTRY R_RISCV
|
||||
pkg debug/elf, const R_RISCV_GNU_VTINHERIT = 41
|
||||
pkg debug/elf, const R_RISCV_GNU_VTINHERIT R_RISCV
|
||||
pkg debug/elf, const R_RISCV_GOT_HI20 = 20
|
||||
pkg debug/elf, const R_RISCV_GOT_HI20 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_GPREL_I = 47
|
||||
pkg debug/elf, const R_RISCV_GPREL_I R_RISCV
|
||||
pkg debug/elf, const R_RISCV_GPREL_S = 48
|
||||
pkg debug/elf, const R_RISCV_GPREL_S R_RISCV
|
||||
pkg debug/elf, const R_RISCV_HI20 = 26
|
||||
pkg debug/elf, const R_RISCV_HI20 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_JAL = 17
|
||||
pkg debug/elf, const R_RISCV_JAL R_RISCV
|
||||
pkg debug/elf, const R_RISCV_JUMP_SLOT = 5
|
||||
pkg debug/elf, const R_RISCV_JUMP_SLOT R_RISCV
|
||||
pkg debug/elf, const R_RISCV_LO12_I = 27
|
||||
pkg debug/elf, const R_RISCV_LO12_I R_RISCV
|
||||
pkg debug/elf, const R_RISCV_LO12_S = 28
|
||||
pkg debug/elf, const R_RISCV_LO12_S R_RISCV
|
||||
pkg debug/elf, const R_RISCV_NONE = 0
|
||||
pkg debug/elf, const R_RISCV_NONE R_RISCV
|
||||
pkg debug/elf, const R_RISCV_PCREL_HI20 = 23
|
||||
pkg debug/elf, const R_RISCV_PCREL_HI20 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_PCREL_LO12_I = 24
|
||||
pkg debug/elf, const R_RISCV_PCREL_LO12_I R_RISCV
|
||||
pkg debug/elf, const R_RISCV_PCREL_LO12_S = 25
|
||||
pkg debug/elf, const R_RISCV_PCREL_LO12_S R_RISCV
|
||||
pkg debug/elf, const R_RISCV_RELATIVE = 3
|
||||
pkg debug/elf, const R_RISCV_RELATIVE R_RISCV
|
||||
pkg debug/elf, const R_RISCV_RELAX = 51
|
||||
pkg debug/elf, const R_RISCV_RELAX R_RISCV
|
||||
pkg debug/elf, const R_RISCV_RVC_BRANCH = 44
|
||||
pkg debug/elf, const R_RISCV_RVC_BRANCH R_RISCV
|
||||
pkg debug/elf, const R_RISCV_RVC_JUMP = 45
|
||||
pkg debug/elf, const R_RISCV_RVC_JUMP R_RISCV
|
||||
pkg debug/elf, const R_RISCV_RVC_LUI = 46
|
||||
pkg debug/elf, const R_RISCV_RVC_LUI R_RISCV
|
||||
pkg debug/elf, const R_RISCV_SET16 = 55
|
||||
pkg debug/elf, const R_RISCV_SET16 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_SET32 = 56
|
||||
pkg debug/elf, const R_RISCV_SET32 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_SET6 = 53
|
||||
pkg debug/elf, const R_RISCV_SET6 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_SET8 = 54
|
||||
pkg debug/elf, const R_RISCV_SET8 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_SUB16 = 38
|
||||
pkg debug/elf, const R_RISCV_SUB16 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_SUB32 = 39
|
||||
pkg debug/elf, const R_RISCV_SUB32 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_SUB6 = 52
|
||||
pkg debug/elf, const R_RISCV_SUB6 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_SUB64 = 40
|
||||
pkg debug/elf, const R_RISCV_SUB64 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_SUB8 = 37
|
||||
pkg debug/elf, const R_RISCV_SUB8 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TLS_DTPMOD32 = 6
|
||||
pkg debug/elf, const R_RISCV_TLS_DTPMOD32 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TLS_DTPMOD64 = 7
|
||||
pkg debug/elf, const R_RISCV_TLS_DTPMOD64 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TLS_DTPREL32 = 8
|
||||
pkg debug/elf, const R_RISCV_TLS_DTPREL32 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TLS_DTPREL64 = 9
|
||||
pkg debug/elf, const R_RISCV_TLS_DTPREL64 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TLS_GD_HI20 = 22
|
||||
pkg debug/elf, const R_RISCV_TLS_GD_HI20 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TLS_GOT_HI20 = 21
|
||||
pkg debug/elf, const R_RISCV_TLS_GOT_HI20 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TLS_TPREL32 = 10
|
||||
pkg debug/elf, const R_RISCV_TLS_TPREL32 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TLS_TPREL64 = 11
|
||||
pkg debug/elf, const R_RISCV_TLS_TPREL64 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TPREL_ADD = 32
|
||||
pkg debug/elf, const R_RISCV_TPREL_ADD R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TPREL_HI20 = 29
|
||||
pkg debug/elf, const R_RISCV_TPREL_HI20 R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TPREL_I = 49
|
||||
pkg debug/elf, const R_RISCV_TPREL_I R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TPREL_LO12_I = 30
|
||||
pkg debug/elf, const R_RISCV_TPREL_LO12_I R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TPREL_LO12_S = 31
|
||||
pkg debug/elf, const R_RISCV_TPREL_LO12_S R_RISCV
|
||||
pkg debug/elf, const R_RISCV_TPREL_S = 50
|
||||
pkg debug/elf, const R_RISCV_TPREL_S R_RISCV
|
||||
pkg debug/elf, method (R_RISCV) GoString() string
|
||||
pkg debug/elf, method (R_RISCV) String() string
|
||||
pkg debug/elf, type R_RISCV int
|
||||
pkg debug/macho, const CpuArm64 = 16777228
|
||||
pkg debug/macho, const CpuArm64 Cpu
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_ARCHITECTURE = 7
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_ARCHITECTURE ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_BASERELOC = 5
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_BASERELOC ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR = 14
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_DEBUG = 6
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_DEBUG ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT = 13
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_EXCEPTION ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_EXPORT = 0
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_EXPORT ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_GLOBALPTR ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_IAT = 12
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_IAT ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_IMPORT = 1
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_IMPORT ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_RESOURCE = 2
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_RESOURCE ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_SECURITY = 4
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_SECURITY ideal-int
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_TLS = 9
|
||||
pkg debug/pe, const IMAGE_DIRECTORY_ENTRY_TLS ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_ARM64 = 43620
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_ARM64 ideal-int
|
||||
pkg go/ast, type CompositeLit struct, Incomplete bool
|
||||
pkg go/token, method (*File) AddLineColumnInfo(int, string, int, int)
|
||||
pkg go/types, func NewInterfaceType([]*Func, []Type) *Interface
|
||||
pkg go/types, method (*Interface) EmbeddedType(int) Type
|
||||
pkg go/types, method (*Var) Embedded() bool
|
||||
pkg net, method (*ListenConfig) Listen(context.Context, string, string) (Listener, error)
|
||||
pkg net, method (*ListenConfig) ListenPacket(context.Context, string, string) (PacketConn, error)
|
||||
pkg net, type Dialer struct, Control func(string, string, syscall.RawConn) error
|
||||
pkg net, type ListenConfig struct
|
||||
pkg net, type ListenConfig struct, Control func(string, string, syscall.RawConn) error
|
||||
pkg net/http, const SameSiteDefaultMode = 1
|
||||
pkg net/http, const SameSiteDefaultMode SameSite
|
||||
pkg net/http, const SameSiteLaxMode = 2
|
||||
pkg net/http, const SameSiteLaxMode SameSite
|
||||
pkg net/http, const SameSiteStrictMode = 3
|
||||
pkg net/http, const SameSiteStrictMode SameSite
|
||||
pkg net/http, const StatusMisdirectedRequest = 421
|
||||
pkg net/http, const StatusMisdirectedRequest ideal-int
|
||||
pkg net/http, type Cookie struct, SameSite SameSite
|
||||
pkg net/http, type SameSite int
|
||||
pkg net/http, type Transport struct, MaxConnsPerHost int
|
||||
pkg net/http/httptrace, type ClientTrace struct, Got1xxResponse func(int, textproto.MIMEHeader) error
|
||||
pkg net/http/httptrace, type ClientTrace struct, WroteHeaderField func(string, []string)
|
||||
pkg net/http/httputil, type ReverseProxy struct, ErrorHandler func(http.ResponseWriter, *http.Request, error)
|
||||
pkg os, const ModeIrregular = 524288
|
||||
pkg os, const ModeIrregular FileMode
|
||||
pkg os, const ModeType = 2399666176
|
||||
pkg os, func UserCacheDir() (string, error)
|
||||
pkg os/signal, func Ignored(os.Signal) bool
|
||||
pkg regexp/syntax, method (Op) String() string
|
||||
pkg runtime/trace, func IsEnabled() bool
|
||||
pkg runtime/trace, func Log(context.Context, string, string)
|
||||
pkg runtime/trace, func Logf(context.Context, string, string, ...interface{})
|
||||
pkg runtime/trace, func NewTask(context.Context, string) (context.Context, *Task)
|
||||
pkg runtime/trace, func StartRegion(context.Context, string) *Region
|
||||
pkg runtime/trace, func WithRegion(context.Context, string, func())
|
||||
pkg runtime/trace, method (*Region) End()
|
||||
pkg runtime/trace, method (*Task) End()
|
||||
pkg runtime/trace, type Region struct
|
||||
pkg runtime/trace, type Task struct
|
||||
pkg syscall (netbsd-386), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (netbsd-386), func Pipe2([]int, int) error
|
||||
pkg syscall (netbsd-386-cgo), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (netbsd-386-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (netbsd-amd64), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (netbsd-amd64), func Pipe2([]int, int) error
|
||||
pkg syscall (netbsd-amd64-cgo), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (netbsd-amd64-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (netbsd-arm), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (netbsd-arm), func Pipe2([]int, int) error
|
||||
pkg syscall (netbsd-arm-cgo), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (netbsd-arm-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (openbsd-386), const SOCK_CLOEXEC = 32768
|
||||
pkg syscall (openbsd-386), const SOCK_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-386), const SOCK_NONBLOCK = 16384
|
||||
pkg syscall (openbsd-386), const SOCK_NONBLOCK ideal-int
|
||||
pkg syscall (openbsd-386), const SYS_ACCEPT4 = 93
|
||||
pkg syscall (openbsd-386), const SYS_ACCEPT4 ideal-int
|
||||
pkg syscall (openbsd-386), const SYS_PIPE2 = 101
|
||||
pkg syscall (openbsd-386), const SYS_PIPE2 ideal-int
|
||||
pkg syscall (openbsd-386), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (openbsd-386), func Pipe2([]int, int) error
|
||||
pkg syscall (openbsd-386-cgo), const SOCK_CLOEXEC = 32768
|
||||
pkg syscall (openbsd-386-cgo), const SOCK_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-386-cgo), const SOCK_NONBLOCK = 16384
|
||||
pkg syscall (openbsd-386-cgo), const SOCK_NONBLOCK ideal-int
|
||||
pkg syscall (openbsd-386-cgo), const SYS_ACCEPT4 = 93
|
||||
pkg syscall (openbsd-386-cgo), const SYS_ACCEPT4 ideal-int
|
||||
pkg syscall (openbsd-386-cgo), const SYS_PIPE2 = 101
|
||||
pkg syscall (openbsd-386-cgo), const SYS_PIPE2 ideal-int
|
||||
pkg syscall (openbsd-386-cgo), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (openbsd-386-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (openbsd-amd64), const SOCK_CLOEXEC = 32768
|
||||
pkg syscall (openbsd-amd64), const SOCK_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-amd64), const SOCK_NONBLOCK = 16384
|
||||
pkg syscall (openbsd-amd64), const SOCK_NONBLOCK ideal-int
|
||||
pkg syscall (openbsd-amd64), const SYS_ACCEPT4 = 93
|
||||
pkg syscall (openbsd-amd64), const SYS_ACCEPT4 ideal-int
|
||||
pkg syscall (openbsd-amd64), const SYS_PIPE2 = 101
|
||||
pkg syscall (openbsd-amd64), const SYS_PIPE2 ideal-int
|
||||
pkg syscall (openbsd-amd64), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (openbsd-amd64), func Pipe2([]int, int) error
|
||||
pkg syscall (openbsd-amd64-cgo), const SOCK_CLOEXEC = 32768
|
||||
pkg syscall (openbsd-amd64-cgo), const SOCK_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const SOCK_NONBLOCK = 16384
|
||||
pkg syscall (openbsd-amd64-cgo), const SOCK_NONBLOCK ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_ACCEPT4 = 93
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_ACCEPT4 ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_PIPE2 = 101
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_PIPE2 ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), func Accept4(int, int) (int, Sockaddr, error)
|
||||
pkg syscall (openbsd-amd64-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (windows-386), const TOKEN_ADJUST_SESSIONID = 256
|
||||
pkg syscall (windows-386), const TOKEN_ADJUST_SESSIONID ideal-int
|
||||
pkg syscall (windows-386), const TOKEN_ALL_ACCESS = 983551
|
||||
pkg syscall (windows-386), type AddrinfoW struct, Addr Pointer
|
||||
pkg syscall (windows-386), type CertChainPolicyPara struct, ExtraPolicyPara Pointer
|
||||
pkg syscall (windows-386), type CertChainPolicyStatus struct, ExtraPolicyStatus Pointer
|
||||
pkg syscall (windows-386), type CertContext struct, CertInfo *CertInfo
|
||||
pkg syscall (windows-386), type CertInfo struct
|
||||
pkg syscall (windows-386), type CertRevocationCrlInfo struct
|
||||
pkg syscall (windows-386), type CertRevocationInfo struct, CrlInfo *CertRevocationCrlInfo
|
||||
pkg syscall (windows-386), type CertRevocationInfo struct, OidSpecificInfo Pointer
|
||||
pkg syscall (windows-386), type CertSimpleChain struct, TrustListInfo *CertTrustListInfo
|
||||
pkg syscall (windows-386), type CertTrustListInfo struct
|
||||
pkg syscall (windows-386), type Pointer *struct
|
||||
pkg syscall (windows-amd64), const TOKEN_ADJUST_SESSIONID = 256
|
||||
pkg syscall (windows-amd64), const TOKEN_ADJUST_SESSIONID ideal-int
|
||||
pkg syscall (windows-amd64), const TOKEN_ALL_ACCESS = 983551
|
||||
pkg syscall (windows-amd64), type AddrinfoW struct, Addr Pointer
|
||||
pkg syscall (windows-amd64), type CertChainPolicyPara struct, ExtraPolicyPara Pointer
|
||||
pkg syscall (windows-amd64), type CertChainPolicyStatus struct, ExtraPolicyStatus Pointer
|
||||
pkg syscall (windows-amd64), type CertContext struct, CertInfo *CertInfo
|
||||
pkg syscall (windows-amd64), type CertInfo struct
|
||||
pkg syscall (windows-amd64), type CertRevocationCrlInfo struct
|
||||
pkg syscall (windows-amd64), type CertRevocationInfo struct, CrlInfo *CertRevocationCrlInfo
|
||||
pkg syscall (windows-amd64), type CertRevocationInfo struct, OidSpecificInfo Pointer
|
||||
pkg syscall (windows-amd64), type CertSimpleChain struct, TrustListInfo *CertTrustListInfo
|
||||
pkg syscall (windows-amd64), type CertTrustListInfo struct
|
||||
pkg syscall (windows-amd64), type Pointer *struct
|
||||
pkg syscall, const ImplementsGetwd = true
|
||||
pkg text/template/parse, type PipeNode struct, IsAssign bool
|
||||
228
api/go1.12.txt
228
api/go1.12.txt
@@ -1,228 +0,0 @@
|
||||
pkg bytes, func ReplaceAll([]uint8, []uint8, []uint8) []uint8
|
||||
pkg crypto/tls, const TLS_AES_128_GCM_SHA256 = 4865
|
||||
pkg crypto/tls, const TLS_AES_128_GCM_SHA256 uint16
|
||||
pkg crypto/tls, const TLS_AES_256_GCM_SHA384 = 4866
|
||||
pkg crypto/tls, const TLS_AES_256_GCM_SHA384 uint16
|
||||
pkg crypto/tls, const TLS_CHACHA20_POLY1305_SHA256 = 4867
|
||||
pkg crypto/tls, const TLS_CHACHA20_POLY1305_SHA256 uint16
|
||||
pkg crypto/tls, const VersionTLS13 = 772
|
||||
pkg crypto/tls, const VersionTLS13 ideal-int
|
||||
pkg crypto/tls, type RecordHeaderError struct, Conn net.Conn
|
||||
pkg debug/elf, const R_RISCV_32_PCREL = 57
|
||||
pkg debug/elf, const R_RISCV_32_PCREL R_RISCV
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_ARMNT = 452
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_ARMNT ideal-int
|
||||
pkg expvar, method (*Map) Delete(string)
|
||||
pkg go/doc, const PreserveAST = 4
|
||||
pkg go/doc, const PreserveAST Mode
|
||||
pkg go/importer, func ForCompiler(*token.FileSet, string, Lookup) types.Importer
|
||||
pkg go/token, method (*File) LineStart(int) Pos
|
||||
pkg io, type StringWriter interface { WriteString }
|
||||
pkg io, type StringWriter interface, WriteString(string) (int, error)
|
||||
pkg log, method (*Logger) Writer() io.Writer
|
||||
pkg math/bits, func Add(uint, uint, uint) (uint, uint)
|
||||
pkg math/bits, func Add32(uint32, uint32, uint32) (uint32, uint32)
|
||||
pkg math/bits, func Add64(uint64, uint64, uint64) (uint64, uint64)
|
||||
pkg math/bits, func Div(uint, uint, uint) (uint, uint)
|
||||
pkg math/bits, func Div32(uint32, uint32, uint32) (uint32, uint32)
|
||||
pkg math/bits, func Div64(uint64, uint64, uint64) (uint64, uint64)
|
||||
pkg math/bits, func Mul(uint, uint) (uint, uint)
|
||||
pkg math/bits, func Mul32(uint32, uint32) (uint32, uint32)
|
||||
pkg math/bits, func Mul64(uint64, uint64) (uint64, uint64)
|
||||
pkg math/bits, func Sub(uint, uint, uint) (uint, uint)
|
||||
pkg math/bits, func Sub32(uint32, uint32, uint32) (uint32, uint32)
|
||||
pkg math/bits, func Sub64(uint64, uint64, uint64) (uint64, uint64)
|
||||
pkg net/http, const StatusTooEarly = 425
|
||||
pkg net/http, const StatusTooEarly ideal-int
|
||||
pkg net/http, method (*Client) CloseIdleConnections()
|
||||
pkg os, const ModeType = 2401763328
|
||||
pkg os, func UserHomeDir() (string, error)
|
||||
pkg os, method (*File) SyscallConn() (syscall.RawConn, error)
|
||||
pkg os, method (*ProcessState) ExitCode() int
|
||||
pkg os/exec, method (ExitError) ExitCode() int
|
||||
pkg reflect, method (*MapIter) Key() Value
|
||||
pkg reflect, method (*MapIter) Next() bool
|
||||
pkg reflect, method (*MapIter) Value() Value
|
||||
pkg reflect, method (Value) MapRange() *MapIter
|
||||
pkg reflect, type MapIter struct
|
||||
pkg runtime/debug, func ReadBuildInfo() (*BuildInfo, bool)
|
||||
pkg runtime/debug, type BuildInfo struct
|
||||
pkg runtime/debug, type BuildInfo struct, Deps []*Module
|
||||
pkg runtime/debug, type BuildInfo struct, Main Module
|
||||
pkg runtime/debug, type BuildInfo struct, Path string
|
||||
pkg runtime/debug, type Module struct
|
||||
pkg runtime/debug, type Module struct, Path string
|
||||
pkg runtime/debug, type Module struct, Replace *Module
|
||||
pkg runtime/debug, type Module struct, Sum string
|
||||
pkg runtime/debug, type Module struct, Version string
|
||||
pkg strings, func ReplaceAll(string, string, string) string
|
||||
pkg strings, method (*Builder) Cap() int
|
||||
pkg syscall (freebsd-386), const S_IRWXG = 56
|
||||
pkg syscall (freebsd-386), const S_IRWXG ideal-int
|
||||
pkg syscall (freebsd-386), const S_IRWXO = 7
|
||||
pkg syscall (freebsd-386), const S_IRWXO ideal-int
|
||||
pkg syscall (freebsd-386), func Fstatat(int, string, *Stat_t, int) error
|
||||
pkg syscall (freebsd-386), func Mknod(string, uint32, uint64) error
|
||||
pkg syscall (freebsd-386), type Dirent struct, Fileno uint64
|
||||
pkg syscall (freebsd-386), type Dirent struct, Namlen uint16
|
||||
pkg syscall (freebsd-386), type Dirent struct, Off int64
|
||||
pkg syscall (freebsd-386), type Dirent struct, Pad0 uint8
|
||||
pkg syscall (freebsd-386), type Dirent struct, Pad1 uint16
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Atim_ext int32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Blksize int32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Btim_ext int32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Ctim_ext int32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Dev uint64
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Gen uint64
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Ino uint64
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Mtim_ext int32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Nlink uint64
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Padding0 int16
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Padding1 int32
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Rdev uint64
|
||||
pkg syscall (freebsd-386), type Stat_t struct, Spare [10]uint64
|
||||
pkg syscall (freebsd-386), type Statfs_t struct, Mntfromname [1024]int8
|
||||
pkg syscall (freebsd-386), type Statfs_t struct, Mntonname [1024]int8
|
||||
pkg syscall (freebsd-386-cgo), const S_IRWXG = 56
|
||||
pkg syscall (freebsd-386-cgo), const S_IRWXG ideal-int
|
||||
pkg syscall (freebsd-386-cgo), const S_IRWXO = 7
|
||||
pkg syscall (freebsd-386-cgo), const S_IRWXO ideal-int
|
||||
pkg syscall (freebsd-386-cgo), func Fstatat(int, string, *Stat_t, int) error
|
||||
pkg syscall (freebsd-386-cgo), func Mknod(string, uint32, uint64) error
|
||||
pkg syscall (freebsd-386-cgo), type Dirent struct, Fileno uint64
|
||||
pkg syscall (freebsd-386-cgo), type Dirent struct, Namlen uint16
|
||||
pkg syscall (freebsd-386-cgo), type Dirent struct, Off int64
|
||||
pkg syscall (freebsd-386-cgo), type Dirent struct, Pad0 uint8
|
||||
pkg syscall (freebsd-386-cgo), type Dirent struct, Pad1 uint16
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Atim_ext int32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Blksize int32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Btim_ext int32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Ctim_ext int32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Dev uint64
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Gen uint64
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Ino uint64
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Mtim_ext int32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Nlink uint64
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Padding0 int16
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Padding1 int32
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Rdev uint64
|
||||
pkg syscall (freebsd-386-cgo), type Stat_t struct, Spare [10]uint64
|
||||
pkg syscall (freebsd-386-cgo), type Statfs_t struct, Mntfromname [1024]int8
|
||||
pkg syscall (freebsd-386-cgo), type Statfs_t struct, Mntonname [1024]int8
|
||||
pkg syscall (freebsd-amd64), const S_IRWXG = 56
|
||||
pkg syscall (freebsd-amd64), const S_IRWXG ideal-int
|
||||
pkg syscall (freebsd-amd64), const S_IRWXO = 7
|
||||
pkg syscall (freebsd-amd64), const S_IRWXO ideal-int
|
||||
pkg syscall (freebsd-amd64), func Fstatat(int, string, *Stat_t, int) error
|
||||
pkg syscall (freebsd-amd64), func Mknod(string, uint32, uint64) error
|
||||
pkg syscall (freebsd-amd64), type Dirent struct, Fileno uint64
|
||||
pkg syscall (freebsd-amd64), type Dirent struct, Namlen uint16
|
||||
pkg syscall (freebsd-amd64), type Dirent struct, Off int64
|
||||
pkg syscall (freebsd-amd64), type Dirent struct, Pad0 uint8
|
||||
pkg syscall (freebsd-amd64), type Dirent struct, Pad1 uint16
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Blksize int32
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Dev uint64
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Gen uint64
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Ino uint64
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Nlink uint64
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Padding0 int16
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Padding1 int32
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Rdev uint64
|
||||
pkg syscall (freebsd-amd64), type Stat_t struct, Spare [10]uint64
|
||||
pkg syscall (freebsd-amd64), type Statfs_t struct, Mntfromname [1024]int8
|
||||
pkg syscall (freebsd-amd64), type Statfs_t struct, Mntonname [1024]int8
|
||||
pkg syscall (freebsd-amd64-cgo), const S_IRWXG = 56
|
||||
pkg syscall (freebsd-amd64-cgo), const S_IRWXG ideal-int
|
||||
pkg syscall (freebsd-amd64-cgo), const S_IRWXO = 7
|
||||
pkg syscall (freebsd-amd64-cgo), const S_IRWXO ideal-int
|
||||
pkg syscall (freebsd-amd64-cgo), func Fstatat(int, string, *Stat_t, int) error
|
||||
pkg syscall (freebsd-amd64-cgo), func Mknod(string, uint32, uint64) error
|
||||
pkg syscall (freebsd-amd64-cgo), type Dirent struct, Fileno uint64
|
||||
pkg syscall (freebsd-amd64-cgo), type Dirent struct, Namlen uint16
|
||||
pkg syscall (freebsd-amd64-cgo), type Dirent struct, Off int64
|
||||
pkg syscall (freebsd-amd64-cgo), type Dirent struct, Pad0 uint8
|
||||
pkg syscall (freebsd-amd64-cgo), type Dirent struct, Pad1 uint16
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Blksize int32
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Dev uint64
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Gen uint64
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ino uint64
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Nlink uint64
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Padding0 int16
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Padding1 int32
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Rdev uint64
|
||||
pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Spare [10]uint64
|
||||
pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntfromname [1024]int8
|
||||
pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntonname [1024]int8
|
||||
pkg syscall (freebsd-arm), const S_IRWXG = 56
|
||||
pkg syscall (freebsd-arm), const S_IRWXG ideal-int
|
||||
pkg syscall (freebsd-arm), const S_IRWXO = 7
|
||||
pkg syscall (freebsd-arm), const S_IRWXO ideal-int
|
||||
pkg syscall (freebsd-arm), func Fstatat(int, string, *Stat_t, int) error
|
||||
pkg syscall (freebsd-arm), func Mknod(string, uint32, uint64) error
|
||||
pkg syscall (freebsd-arm), type Dirent struct, Fileno uint64
|
||||
pkg syscall (freebsd-arm), type Dirent struct, Namlen uint16
|
||||
pkg syscall (freebsd-arm), type Dirent struct, Off int64
|
||||
pkg syscall (freebsd-arm), type Dirent struct, Pad0 uint8
|
||||
pkg syscall (freebsd-arm), type Dirent struct, Pad1 uint16
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Blksize int32
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Dev uint64
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Gen uint64
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Ino uint64
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Nlink uint64
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Padding0 int16
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Padding1 int32
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Rdev uint64
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Spare [10]uint64
|
||||
pkg syscall (freebsd-arm), type Statfs_t struct, Mntfromname [1024]int8
|
||||
pkg syscall (freebsd-arm), type Statfs_t struct, Mntonname [1024]int8
|
||||
pkg syscall (freebsd-arm-cgo), const S_IRWXG = 56
|
||||
pkg syscall (freebsd-arm-cgo), const S_IRWXG ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const S_IRWXO = 7
|
||||
pkg syscall (freebsd-arm-cgo), const S_IRWXO ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), func Fstatat(int, string, *Stat_t, int) error
|
||||
pkg syscall (freebsd-arm-cgo), func Mknod(string, uint32, uint64) error
|
||||
pkg syscall (freebsd-arm-cgo), type Dirent struct, Fileno uint64
|
||||
pkg syscall (freebsd-arm-cgo), type Dirent struct, Namlen uint16
|
||||
pkg syscall (freebsd-arm-cgo), type Dirent struct, Off int64
|
||||
pkg syscall (freebsd-arm-cgo), type Dirent struct, Pad0 uint8
|
||||
pkg syscall (freebsd-arm-cgo), type Dirent struct, Pad1 uint16
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Blksize int32
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Dev uint64
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Gen uint64
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ino uint64
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Nlink uint64
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Padding0 int16
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Padding1 int32
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Rdev uint64
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Spare [10]uint64
|
||||
pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntfromname [1024]int8
|
||||
pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntonname [1024]int8
|
||||
pkg syscall (openbsd-386), const S_IRWXG = 56
|
||||
pkg syscall (openbsd-386), const S_IRWXG ideal-int
|
||||
pkg syscall (openbsd-386), const S_IRWXO = 7
|
||||
pkg syscall (openbsd-386), const S_IRWXO ideal-int
|
||||
pkg syscall (openbsd-386-cgo), const S_IRWXG = 56
|
||||
pkg syscall (openbsd-386-cgo), const S_IRWXG ideal-int
|
||||
pkg syscall (openbsd-386-cgo), const S_IRWXO = 7
|
||||
pkg syscall (openbsd-386-cgo), const S_IRWXO ideal-int
|
||||
pkg syscall (openbsd-amd64), const S_IRWXG = 56
|
||||
pkg syscall (openbsd-amd64), const S_IRWXG ideal-int
|
||||
pkg syscall (openbsd-amd64), const S_IRWXO = 7
|
||||
pkg syscall (openbsd-amd64), const S_IRWXO ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const S_IRWXG = 56
|
||||
pkg syscall (openbsd-amd64-cgo), const S_IRWXG ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const S_IRWXO = 7
|
||||
pkg syscall (openbsd-amd64-cgo), const S_IRWXO ideal-int
|
||||
pkg syscall (windows-386), const UNIX_PATH_MAX = 108
|
||||
pkg syscall (windows-386), const UNIX_PATH_MAX ideal-int
|
||||
pkg syscall (windows-386), func Syscall18(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno)
|
||||
pkg syscall (windows-386), type RawSockaddrAny struct, Pad [100]int8
|
||||
pkg syscall (windows-386), type RawSockaddrUnix struct, Family uint16
|
||||
pkg syscall (windows-386), type RawSockaddrUnix struct, Path [108]int8
|
||||
pkg syscall (windows-amd64), const UNIX_PATH_MAX = 108
|
||||
pkg syscall (windows-amd64), const UNIX_PATH_MAX ideal-int
|
||||
pkg syscall (windows-amd64), func Syscall18(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno)
|
||||
pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [100]int8
|
||||
pkg syscall (windows-amd64), type RawSockaddrUnix struct, Family uint16
|
||||
pkg syscall (windows-amd64), type RawSockaddrUnix struct, Path [108]int8
|
||||
pkg syscall, type RawSockaddrUnix struct
|
||||
8032
api/go1.13.txt
8032
api/go1.13.txt
File diff suppressed because it is too large
Load Diff
197
api/go1.14.txt
197
api/go1.14.txt
@@ -1,197 +0,0 @@
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 52393
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 uint16
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 52392
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 uint16
|
||||
pkg crypto/tls, func CipherSuiteName(uint16) string
|
||||
pkg crypto/tls, func CipherSuites() []*CipherSuite
|
||||
pkg crypto/tls, func InsecureCipherSuites() []*CipherSuite
|
||||
pkg crypto/tls, method (*CertificateRequestInfo) SupportsCertificate(*Certificate) error
|
||||
pkg crypto/tls, method (*ClientHelloInfo) SupportsCertificate(*Certificate) error
|
||||
pkg crypto/tls, type Certificate struct, SupportedSignatureAlgorithms []SignatureScheme
|
||||
pkg crypto/tls, type CertificateRequestInfo struct, Version uint16
|
||||
pkg crypto/tls, type CipherSuite struct
|
||||
pkg crypto/tls, type CipherSuite struct, ID uint16
|
||||
pkg crypto/tls, type CipherSuite struct, Insecure bool
|
||||
pkg crypto/tls, type CipherSuite struct, Name string
|
||||
pkg crypto/tls, type CipherSuite struct, SupportedVersions []uint16
|
||||
pkg debug/dwarf, const AttrAddrBase = 115
|
||||
pkg debug/dwarf, const AttrAddrBase Attr
|
||||
pkg debug/dwarf, const AttrAlignment = 136
|
||||
pkg debug/dwarf, const AttrAlignment Attr
|
||||
pkg debug/dwarf, const AttrBinaryScale = 91
|
||||
pkg debug/dwarf, const AttrBinaryScale Attr
|
||||
pkg debug/dwarf, const AttrCallAllCalls = 122
|
||||
pkg debug/dwarf, const AttrCallAllCalls Attr
|
||||
pkg debug/dwarf, const AttrCallAllSourceCalls = 123
|
||||
pkg debug/dwarf, const AttrCallAllSourceCalls Attr
|
||||
pkg debug/dwarf, const AttrCallAllTailCalls = 124
|
||||
pkg debug/dwarf, const AttrCallAllTailCalls Attr
|
||||
pkg debug/dwarf, const AttrCallDataLocation = 133
|
||||
pkg debug/dwarf, const AttrCallDataLocation Attr
|
||||
pkg debug/dwarf, const AttrCallDataValue = 134
|
||||
pkg debug/dwarf, const AttrCallDataValue Attr
|
||||
pkg debug/dwarf, const AttrCallOrigin = 127
|
||||
pkg debug/dwarf, const AttrCallOrigin Attr
|
||||
pkg debug/dwarf, const AttrCallPC = 129
|
||||
pkg debug/dwarf, const AttrCallPC Attr
|
||||
pkg debug/dwarf, const AttrCallParameter = 128
|
||||
pkg debug/dwarf, const AttrCallParameter Attr
|
||||
pkg debug/dwarf, const AttrCallReturnPC = 125
|
||||
pkg debug/dwarf, const AttrCallReturnPC Attr
|
||||
pkg debug/dwarf, const AttrCallTailCall = 130
|
||||
pkg debug/dwarf, const AttrCallTailCall Attr
|
||||
pkg debug/dwarf, const AttrCallTarget = 131
|
||||
pkg debug/dwarf, const AttrCallTarget Attr
|
||||
pkg debug/dwarf, const AttrCallTargetClobbered = 132
|
||||
pkg debug/dwarf, const AttrCallTargetClobbered Attr
|
||||
pkg debug/dwarf, const AttrCallValue = 126
|
||||
pkg debug/dwarf, const AttrCallValue Attr
|
||||
pkg debug/dwarf, const AttrConstExpr = 108
|
||||
pkg debug/dwarf, const AttrConstExpr Attr
|
||||
pkg debug/dwarf, const AttrDataBitOffset = 107
|
||||
pkg debug/dwarf, const AttrDataBitOffset Attr
|
||||
pkg debug/dwarf, const AttrDecimalScale = 92
|
||||
pkg debug/dwarf, const AttrDecimalScale Attr
|
||||
pkg debug/dwarf, const AttrDecimalSign = 94
|
||||
pkg debug/dwarf, const AttrDecimalSign Attr
|
||||
pkg debug/dwarf, const AttrDefaulted = 139
|
||||
pkg debug/dwarf, const AttrDefaulted Attr
|
||||
pkg debug/dwarf, const AttrDeleted = 138
|
||||
pkg debug/dwarf, const AttrDeleted Attr
|
||||
pkg debug/dwarf, const AttrDigitCount = 95
|
||||
pkg debug/dwarf, const AttrDigitCount Attr
|
||||
pkg debug/dwarf, const AttrDwoName = 118
|
||||
pkg debug/dwarf, const AttrDwoName Attr
|
||||
pkg debug/dwarf, const AttrElemental = 102
|
||||
pkg debug/dwarf, const AttrElemental Attr
|
||||
pkg debug/dwarf, const AttrEndianity = 101
|
||||
pkg debug/dwarf, const AttrEndianity Attr
|
||||
pkg debug/dwarf, const AttrEnumClass = 109
|
||||
pkg debug/dwarf, const AttrEnumClass Attr
|
||||
pkg debug/dwarf, const AttrExplicit = 99
|
||||
pkg debug/dwarf, const AttrExplicit Attr
|
||||
pkg debug/dwarf, const AttrExportSymbols = 137
|
||||
pkg debug/dwarf, const AttrExportSymbols Attr
|
||||
pkg debug/dwarf, const AttrLinkageName = 110
|
||||
pkg debug/dwarf, const AttrLinkageName Attr
|
||||
pkg debug/dwarf, const AttrLoclistsBase = 140
|
||||
pkg debug/dwarf, const AttrLoclistsBase Attr
|
||||
pkg debug/dwarf, const AttrMacros = 121
|
||||
pkg debug/dwarf, const AttrMacros Attr
|
||||
pkg debug/dwarf, const AttrMainSubprogram = 106
|
||||
pkg debug/dwarf, const AttrMainSubprogram Attr
|
||||
pkg debug/dwarf, const AttrMutable = 97
|
||||
pkg debug/dwarf, const AttrMutable Attr
|
||||
pkg debug/dwarf, const AttrNoreturn = 135
|
||||
pkg debug/dwarf, const AttrNoreturn Attr
|
||||
pkg debug/dwarf, const AttrObjectPointer = 100
|
||||
pkg debug/dwarf, const AttrObjectPointer Attr
|
||||
pkg debug/dwarf, const AttrPictureString = 96
|
||||
pkg debug/dwarf, const AttrPictureString Attr
|
||||
pkg debug/dwarf, const AttrPure = 103
|
||||
pkg debug/dwarf, const AttrPure Attr
|
||||
pkg debug/dwarf, const AttrRank = 113
|
||||
pkg debug/dwarf, const AttrRank Attr
|
||||
pkg debug/dwarf, const AttrRecursive = 104
|
||||
pkg debug/dwarf, const AttrRecursive Attr
|
||||
pkg debug/dwarf, const AttrReference = 119
|
||||
pkg debug/dwarf, const AttrReference Attr
|
||||
pkg debug/dwarf, const AttrRnglistsBase = 116
|
||||
pkg debug/dwarf, const AttrRnglistsBase Attr
|
||||
pkg debug/dwarf, const AttrRvalueReference = 120
|
||||
pkg debug/dwarf, const AttrRvalueReference Attr
|
||||
pkg debug/dwarf, const AttrSignature = 105
|
||||
pkg debug/dwarf, const AttrSignature Attr
|
||||
pkg debug/dwarf, const AttrSmall = 93
|
||||
pkg debug/dwarf, const AttrSmall Attr
|
||||
pkg debug/dwarf, const AttrStrOffsetsBase = 114
|
||||
pkg debug/dwarf, const AttrStrOffsetsBase Attr
|
||||
pkg debug/dwarf, const AttrStringLengthBitSize = 111
|
||||
pkg debug/dwarf, const AttrStringLengthBitSize Attr
|
||||
pkg debug/dwarf, const AttrStringLengthByteSize = 112
|
||||
pkg debug/dwarf, const AttrStringLengthByteSize Attr
|
||||
pkg debug/dwarf, const AttrThreadsScaled = 98
|
||||
pkg debug/dwarf, const AttrThreadsScaled Attr
|
||||
pkg debug/dwarf, const ClassAddrPtr = 15
|
||||
pkg debug/dwarf, const ClassAddrPtr Class
|
||||
pkg debug/dwarf, const ClassLocList = 16
|
||||
pkg debug/dwarf, const ClassLocList Class
|
||||
pkg debug/dwarf, const ClassRngList = 17
|
||||
pkg debug/dwarf, const ClassRngList Class
|
||||
pkg debug/dwarf, const ClassRngListsPtr = 18
|
||||
pkg debug/dwarf, const ClassRngListsPtr Class
|
||||
pkg debug/dwarf, const ClassStrOffsetsPtr = 19
|
||||
pkg debug/dwarf, const ClassStrOffsetsPtr Class
|
||||
pkg debug/dwarf, const TagAtomicType = 71
|
||||
pkg debug/dwarf, const TagAtomicType Tag
|
||||
pkg debug/dwarf, const TagCallSite = 72
|
||||
pkg debug/dwarf, const TagCallSite Tag
|
||||
pkg debug/dwarf, const TagCallSiteParameter = 73
|
||||
pkg debug/dwarf, const TagCallSiteParameter Tag
|
||||
pkg debug/dwarf, const TagCoarrayType = 68
|
||||
pkg debug/dwarf, const TagCoarrayType Tag
|
||||
pkg debug/dwarf, const TagDynamicType = 70
|
||||
pkg debug/dwarf, const TagDynamicType Tag
|
||||
pkg debug/dwarf, const TagGenericSubrange = 69
|
||||
pkg debug/dwarf, const TagGenericSubrange Tag
|
||||
pkg debug/dwarf, const TagImmutableType = 75
|
||||
pkg debug/dwarf, const TagImmutableType Tag
|
||||
pkg debug/dwarf, const TagSkeletonUnit = 74
|
||||
pkg debug/dwarf, const TagSkeletonUnit Tag
|
||||
pkg debug/dwarf, method (*Data) AddSection(string, []uint8) error
|
||||
pkg debug/dwarf, method (*LineReader) Files() []*LineFile
|
||||
pkg debug/dwarf, method (*Reader) ByteOrder() binary.ByteOrder
|
||||
pkg encoding/asn1, const TagBMPString = 30
|
||||
pkg encoding/asn1, const TagBMPString ideal-int
|
||||
pkg encoding/json, method (*Decoder) InputOffset() int64
|
||||
pkg go/build, type Context struct, Dir string
|
||||
pkg go/doc, func NewFromFiles(*token.FileSet, []*ast.File, string, ...interface{}) (*Package, error)
|
||||
pkg go/doc, type Example struct, Suffix string
|
||||
pkg go/doc, type Func struct, Examples []*Example
|
||||
pkg go/doc, type Package struct, Examples []*Example
|
||||
pkg go/doc, type Type struct, Examples []*Example
|
||||
pkg hash/maphash, func MakeSeed() Seed
|
||||
pkg hash/maphash, method (*Hash) BlockSize() int
|
||||
pkg hash/maphash, method (*Hash) Reset()
|
||||
pkg hash/maphash, method (*Hash) Seed() Seed
|
||||
pkg hash/maphash, method (*Hash) SetSeed(Seed)
|
||||
pkg hash/maphash, method (*Hash) Size() int
|
||||
pkg hash/maphash, method (*Hash) Sum([]uint8) []uint8
|
||||
pkg hash/maphash, method (*Hash) Sum64() uint64
|
||||
pkg hash/maphash, method (*Hash) Write([]uint8) (int, error)
|
||||
pkg hash/maphash, method (*Hash) WriteByte(uint8) error
|
||||
pkg hash/maphash, method (*Hash) WriteString(string) (int, error)
|
||||
pkg hash/maphash, type Hash struct
|
||||
pkg hash/maphash, type Seed struct
|
||||
pkg log, const Lmsgprefix = 64
|
||||
pkg log, const Lmsgprefix ideal-int
|
||||
pkg math, func FMA(float64, float64, float64) float64
|
||||
pkg math/bits, func Rem(uint, uint, uint) uint
|
||||
pkg math/bits, func Rem32(uint32, uint32, uint32) uint32
|
||||
pkg math/bits, func Rem64(uint64, uint64, uint64) uint64
|
||||
pkg mime/multipart, method (*Reader) NextRawPart() (*Part, error)
|
||||
pkg net/http, method (Header) Values(string) []string
|
||||
pkg net/http, type Transport struct, DialTLSContext func(context.Context, string, string) (net.Conn, error)
|
||||
pkg net/http/httptest, type Server struct, EnableHTTP2 bool
|
||||
pkg net/textproto, method (MIMEHeader) Values(string) []string
|
||||
pkg strconv, method (*NumError) Unwrap() error
|
||||
pkg syscall (windows-386), const CTRL_CLOSE_EVENT = 2
|
||||
pkg syscall (windows-386), const CTRL_CLOSE_EVENT ideal-int
|
||||
pkg syscall (windows-386), const CTRL_LOGOFF_EVENT = 5
|
||||
pkg syscall (windows-386), const CTRL_LOGOFF_EVENT ideal-int
|
||||
pkg syscall (windows-386), const CTRL_SHUTDOWN_EVENT = 6
|
||||
pkg syscall (windows-386), const CTRL_SHUTDOWN_EVENT ideal-int
|
||||
pkg syscall (windows-amd64), const CTRL_CLOSE_EVENT = 2
|
||||
pkg syscall (windows-amd64), const CTRL_CLOSE_EVENT ideal-int
|
||||
pkg syscall (windows-amd64), const CTRL_LOGOFF_EVENT = 5
|
||||
pkg syscall (windows-amd64), const CTRL_LOGOFF_EVENT ideal-int
|
||||
pkg syscall (windows-amd64), const CTRL_SHUTDOWN_EVENT = 6
|
||||
pkg syscall (windows-amd64), const CTRL_SHUTDOWN_EVENT ideal-int
|
||||
pkg testing, method (*B) Cleanup(func())
|
||||
pkg testing, method (*T) Cleanup(func())
|
||||
pkg testing, type TB interface, Cleanup(func())
|
||||
pkg unicode, const Version = "12.0.0"
|
||||
pkg unicode, var Elymaic *RangeTable
|
||||
pkg unicode, var Nandinagari *RangeTable
|
||||
pkg unicode, var Nyiakeng_Puachue_Hmong *RangeTable
|
||||
pkg unicode, var Wancho *RangeTable
|
||||
130
api/go1.15.txt
130
api/go1.15.txt
@@ -1,130 +0,0 @@
|
||||
pkg bufio, var ErrBadReadCount error
|
||||
pkg crypto, method (Hash) String() string
|
||||
pkg crypto/ecdsa, func SignASN1(io.Reader, *PrivateKey, []uint8) ([]uint8, error)
|
||||
pkg crypto/ecdsa, func VerifyASN1(*PublicKey, []uint8, []uint8) bool
|
||||
pkg crypto/ecdsa, method (*PrivateKey) Equal(crypto.PrivateKey) bool
|
||||
pkg crypto/ecdsa, method (*PublicKey) Equal(crypto.PublicKey) bool
|
||||
pkg crypto/ed25519, method (PrivateKey) Equal(crypto.PrivateKey) bool
|
||||
pkg crypto/ed25519, method (PublicKey) Equal(crypto.PublicKey) bool
|
||||
pkg crypto/elliptic, func MarshalCompressed(Curve, *big.Int, *big.Int) []uint8
|
||||
pkg crypto/elliptic, func UnmarshalCompressed(Curve, []uint8) (*big.Int, *big.Int)
|
||||
pkg crypto/rsa, method (*PrivateKey) Equal(crypto.PrivateKey) bool
|
||||
pkg crypto/rsa, method (*PublicKey) Equal(crypto.PublicKey) bool
|
||||
pkg crypto/tls, method (*Dialer) Dial(string, string) (net.Conn, error)
|
||||
pkg crypto/tls, method (*Dialer) DialContext(context.Context, string, string) (net.Conn, error)
|
||||
pkg crypto/tls, method (ClientAuthType) String() string
|
||||
pkg crypto/tls, method (CurveID) String() string
|
||||
pkg crypto/tls, method (SignatureScheme) String() string
|
||||
pkg crypto/tls, type Config struct, VerifyConnection func(ConnectionState) error
|
||||
pkg crypto/tls, type Dialer struct
|
||||
pkg crypto/tls, type Dialer struct, Config *Config
|
||||
pkg crypto/tls, type Dialer struct, NetDialer *net.Dialer
|
||||
pkg crypto/x509, func CreateRevocationList(io.Reader, *RevocationList, *Certificate, crypto.Signer) ([]uint8, error)
|
||||
pkg crypto/x509, type RevocationList struct
|
||||
pkg crypto/x509, type RevocationList struct, ExtraExtensions []pkix.Extension
|
||||
pkg crypto/x509, type RevocationList struct, NextUpdate time.Time
|
||||
pkg crypto/x509, type RevocationList struct, Number *big.Int
|
||||
pkg crypto/x509, type RevocationList struct, RevokedCertificates []pkix.RevokedCertificate
|
||||
pkg crypto/x509, type RevocationList struct, SignatureAlgorithm SignatureAlgorithm
|
||||
pkg crypto/x509, type RevocationList struct, ThisUpdate time.Time
|
||||
pkg database/sql, method (*DB) SetConnMaxIdleTime(time.Duration)
|
||||
pkg database/sql, method (*Row) Err() error
|
||||
pkg database/sql, type DBStats struct, MaxIdleTimeClosed int64
|
||||
pkg database/sql/driver, type Validator interface { IsValid }
|
||||
pkg database/sql/driver, type Validator interface, IsValid() bool
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_APPCONTAINER = 4096
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_APPCONTAINER ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE = 64
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY = 128
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_GUARD_CF = 16384
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_GUARD_CF ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA = 32
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_BIND = 2048
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_BIND ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_ISOLATION = 512
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_ISOLATION ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_SEH = 1024
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_SEH ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NX_COMPAT = 256
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NX_COMPAT ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = 32768
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = 8192
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_WDM_DRIVER ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_32BIT_MACHINE = 256
|
||||
pkg debug/pe, const IMAGE_FILE_32BIT_MACHINE ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_AGGRESIVE_WS_TRIM = 16
|
||||
pkg debug/pe, const IMAGE_FILE_AGGRESIVE_WS_TRIM ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_BYTES_REVERSED_HI = 32768
|
||||
pkg debug/pe, const IMAGE_FILE_BYTES_REVERSED_HI ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_BYTES_REVERSED_LO = 128
|
||||
pkg debug/pe, const IMAGE_FILE_BYTES_REVERSED_LO ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_DEBUG_STRIPPED = 512
|
||||
pkg debug/pe, const IMAGE_FILE_DEBUG_STRIPPED ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_DLL = 8192
|
||||
pkg debug/pe, const IMAGE_FILE_DLL ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_EXECUTABLE_IMAGE = 2
|
||||
pkg debug/pe, const IMAGE_FILE_EXECUTABLE_IMAGE ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_LARGE_ADDRESS_AWARE = 32
|
||||
pkg debug/pe, const IMAGE_FILE_LARGE_ADDRESS_AWARE ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_LINE_NUMS_STRIPPED = 4
|
||||
pkg debug/pe, const IMAGE_FILE_LINE_NUMS_STRIPPED ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_LOCAL_SYMS_STRIPPED = 8
|
||||
pkg debug/pe, const IMAGE_FILE_LOCAL_SYMS_STRIPPED ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_NET_RUN_FROM_SWAP = 2048
|
||||
pkg debug/pe, const IMAGE_FILE_NET_RUN_FROM_SWAP ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_RELOCS_STRIPPED = 1
|
||||
pkg debug/pe, const IMAGE_FILE_RELOCS_STRIPPED ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 1024
|
||||
pkg debug/pe, const IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_SYSTEM = 4096
|
||||
pkg debug/pe, const IMAGE_FILE_SYSTEM ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_UP_SYSTEM_ONLY = 16384
|
||||
pkg debug/pe, const IMAGE_FILE_UP_SYSTEM_ONLY ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_APPLICATION = 10
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_APPLICATION ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_ROM = 13
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_ROM ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_NATIVE = 1
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_NATIVE ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_NATIVE_WINDOWS ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_OS2_CUI = 5
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_OS2_CUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_POSIX_CUI = 7
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_POSIX_CUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_UNKNOWN = 0
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_UNKNOWN ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_CE_GUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_CUI = 3
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_CUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_GUI = 2
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_GUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_XBOX = 14
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_XBOX ideal-int
|
||||
pkg math/big, method (*Int) FillBytes([]uint8) []uint8
|
||||
pkg net, method (*Resolver) LookupIP(context.Context, string, string) ([]IP, error)
|
||||
pkg net/url, method (*URL) EscapedFragment() string
|
||||
pkg net/url, method (*URL) Redacted() string
|
||||
pkg net/url, type URL struct, RawFragment string
|
||||
pkg os, method (*File) ReadFrom(io.Reader) (int64, error)
|
||||
pkg os, var ErrDeadlineExceeded error
|
||||
pkg regexp, method (*Regexp) SubexpIndex(string) int
|
||||
pkg strconv, func FormatComplex(complex128, uint8, int, int) string
|
||||
pkg strconv, func ParseComplex(string, int) (complex128, error)
|
||||
pkg sync, method (*Map) LoadAndDelete(interface{}) (interface{}, bool)
|
||||
pkg testing, method (*B) TempDir() string
|
||||
pkg testing, method (*T) Deadline() (time.Time, bool)
|
||||
pkg testing, method (*T) TempDir() string
|
||||
pkg testing, type TB interface, TempDir() string
|
||||
pkg time, method (*Ticker) Reset(Duration)
|
||||
261
api/go1.8.txt
261
api/go1.8.txt
@@ -1,261 +0,0 @@
|
||||
pkg compress/gzip, const HuffmanOnly = -2
|
||||
pkg compress/gzip, const HuffmanOnly ideal-int
|
||||
pkg compress/zlib, const HuffmanOnly = -2
|
||||
pkg compress/zlib, const HuffmanOnly ideal-int
|
||||
pkg crypto/tls, const ECDSAWithP256AndSHA256 = 1027
|
||||
pkg crypto/tls, const ECDSAWithP256AndSHA256 SignatureScheme
|
||||
pkg crypto/tls, const ECDSAWithP384AndSHA384 = 1283
|
||||
pkg crypto/tls, const ECDSAWithP384AndSHA384 SignatureScheme
|
||||
pkg crypto/tls, const ECDSAWithP521AndSHA512 = 1539
|
||||
pkg crypto/tls, const ECDSAWithP521AndSHA512 SignatureScheme
|
||||
pkg crypto/tls, const PKCS1WithSHA1 = 513
|
||||
pkg crypto/tls, const PKCS1WithSHA1 SignatureScheme
|
||||
pkg crypto/tls, const PKCS1WithSHA256 = 1025
|
||||
pkg crypto/tls, const PKCS1WithSHA256 SignatureScheme
|
||||
pkg crypto/tls, const PKCS1WithSHA384 = 1281
|
||||
pkg crypto/tls, const PKCS1WithSHA384 SignatureScheme
|
||||
pkg crypto/tls, const PKCS1WithSHA512 = 1537
|
||||
pkg crypto/tls, const PKCS1WithSHA512 SignatureScheme
|
||||
pkg crypto/tls, const PSSWithSHA256 = 2052
|
||||
pkg crypto/tls, const PSSWithSHA256 SignatureScheme
|
||||
pkg crypto/tls, const PSSWithSHA384 = 2053
|
||||
pkg crypto/tls, const PSSWithSHA384 SignatureScheme
|
||||
pkg crypto/tls, const PSSWithSHA512 = 2054
|
||||
pkg crypto/tls, const PSSWithSHA512 SignatureScheme
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 49187
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 uint16
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 = 52393
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 uint16
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 49191
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 uint16
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 = 52392
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 uint16
|
||||
pkg crypto/tls, const TLS_RSA_WITH_AES_128_CBC_SHA256 = 60
|
||||
pkg crypto/tls, const TLS_RSA_WITH_AES_128_CBC_SHA256 uint16
|
||||
pkg crypto/tls, const X25519 = 29
|
||||
pkg crypto/tls, const X25519 CurveID
|
||||
pkg crypto/tls, method (*Config) Clone() *Config
|
||||
pkg crypto/tls, method (*Conn) CloseWrite() error
|
||||
pkg crypto/tls, type CertificateRequestInfo struct
|
||||
pkg crypto/tls, type CertificateRequestInfo struct, AcceptableCAs [][]uint8
|
||||
pkg crypto/tls, type CertificateRequestInfo struct, SignatureSchemes []SignatureScheme
|
||||
pkg crypto/tls, type ClientHelloInfo struct, Conn net.Conn
|
||||
pkg crypto/tls, type ClientHelloInfo struct, SignatureSchemes []SignatureScheme
|
||||
pkg crypto/tls, type ClientHelloInfo struct, SupportedProtos []string
|
||||
pkg crypto/tls, type ClientHelloInfo struct, SupportedVersions []uint16
|
||||
pkg crypto/tls, type Config struct, GetClientCertificate func(*CertificateRequestInfo) (*Certificate, error)
|
||||
pkg crypto/tls, type Config struct, GetConfigForClient func(*ClientHelloInfo) (*Config, error)
|
||||
pkg crypto/tls, type Config struct, KeyLogWriter io.Writer
|
||||
pkg crypto/tls, type Config struct, VerifyPeerCertificate func([][]uint8, [][]*x509.Certificate) error
|
||||
pkg crypto/tls, type SignatureScheme uint16
|
||||
pkg crypto/x509, const NameMismatch = 5
|
||||
pkg crypto/x509, const NameMismatch InvalidReason
|
||||
pkg crypto/x509, const SHA256WithRSAPSS = 13
|
||||
pkg crypto/x509, const SHA256WithRSAPSS SignatureAlgorithm
|
||||
pkg crypto/x509, const SHA384WithRSAPSS = 14
|
||||
pkg crypto/x509, const SHA384WithRSAPSS SignatureAlgorithm
|
||||
pkg crypto/x509, const SHA512WithRSAPSS = 15
|
||||
pkg crypto/x509, const SHA512WithRSAPSS SignatureAlgorithm
|
||||
pkg crypto/x509, type UnknownAuthorityError struct, Cert *Certificate
|
||||
pkg database/sql, const LevelDefault = 0
|
||||
pkg database/sql, const LevelDefault IsolationLevel
|
||||
pkg database/sql, const LevelLinearizable = 7
|
||||
pkg database/sql, const LevelLinearizable IsolationLevel
|
||||
pkg database/sql, const LevelReadCommitted = 2
|
||||
pkg database/sql, const LevelReadCommitted IsolationLevel
|
||||
pkg database/sql, const LevelReadUncommitted = 1
|
||||
pkg database/sql, const LevelReadUncommitted IsolationLevel
|
||||
pkg database/sql, const LevelRepeatableRead = 4
|
||||
pkg database/sql, const LevelRepeatableRead IsolationLevel
|
||||
pkg database/sql, const LevelSerializable = 6
|
||||
pkg database/sql, const LevelSerializable IsolationLevel
|
||||
pkg database/sql, const LevelSnapshot = 5
|
||||
pkg database/sql, const LevelSnapshot IsolationLevel
|
||||
pkg database/sql, const LevelWriteCommitted = 3
|
||||
pkg database/sql, const LevelWriteCommitted IsolationLevel
|
||||
pkg database/sql/driver, type ConnBeginTx interface { BeginTx }
|
||||
pkg database/sql/driver, type ConnBeginTx interface, BeginTx(context.Context, TxOptions) (Tx, error)
|
||||
pkg database/sql/driver, type ConnPrepareContext interface { PrepareContext }
|
||||
pkg database/sql/driver, type ConnPrepareContext interface, PrepareContext(context.Context, string) (Stmt, error)
|
||||
pkg database/sql/driver, type ExecerContext interface { ExecContext }
|
||||
pkg database/sql/driver, type ExecerContext interface, ExecContext(context.Context, string, []NamedValue) (Result, error)
|
||||
pkg database/sql/driver, type IsolationLevel int
|
||||
pkg database/sql/driver, type NamedValue struct
|
||||
pkg database/sql/driver, type NamedValue struct, Name string
|
||||
pkg database/sql/driver, type NamedValue struct, Ordinal int
|
||||
pkg database/sql/driver, type NamedValue struct, Value Value
|
||||
pkg database/sql/driver, type Pinger interface { Ping }
|
||||
pkg database/sql/driver, type Pinger interface, Ping(context.Context) error
|
||||
pkg database/sql/driver, type QueryerContext interface { QueryContext }
|
||||
pkg database/sql/driver, type QueryerContext interface, QueryContext(context.Context, string, []NamedValue) (Rows, error)
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface { Close, ColumnTypeDatabaseTypeName, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface, ColumnTypeDatabaseTypeName(int) string
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface { Close, ColumnTypeLength, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface, ColumnTypeLength(int) (int64, bool)
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface { Close, ColumnTypeNullable, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface, ColumnTypeNullable(int) (bool, bool)
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface { Close, ColumnTypePrecisionScale, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface, ColumnTypePrecisionScale(int) (int64, int64, bool)
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface { Close, ColumnTypeScanType, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface, ColumnTypeScanType(int) reflect.Type
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsNextResultSet interface { Close, Columns, HasNextResultSet, Next, NextResultSet }
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, Close() error
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, HasNextResultSet() bool
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, NextResultSet() error
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, Next([]Value) error
|
||||
pkg database/sql/driver, type StmtExecContext interface { ExecContext }
|
||||
pkg database/sql/driver, type StmtExecContext interface, ExecContext(context.Context, []NamedValue) (Result, error)
|
||||
pkg database/sql/driver, type StmtQueryContext interface { QueryContext }
|
||||
pkg database/sql/driver, type StmtQueryContext interface, QueryContext(context.Context, []NamedValue) (Rows, error)
|
||||
pkg database/sql/driver, type TxOptions struct
|
||||
pkg database/sql/driver, type TxOptions struct, Isolation IsolationLevel
|
||||
pkg database/sql/driver, type TxOptions struct, ReadOnly bool
|
||||
pkg database/sql, func Named(string, interface{}) NamedArg
|
||||
pkg database/sql, method (*ColumnType) DatabaseTypeName() string
|
||||
pkg database/sql, method (*ColumnType) DecimalSize() (int64, int64, bool)
|
||||
pkg database/sql, method (*ColumnType) Length() (int64, bool)
|
||||
pkg database/sql, method (*ColumnType) Name() string
|
||||
pkg database/sql, method (*ColumnType) Nullable() (bool, bool)
|
||||
pkg database/sql, method (*ColumnType) ScanType() reflect.Type
|
||||
pkg database/sql, method (*DB) BeginTx(context.Context, *TxOptions) (*Tx, error)
|
||||
pkg database/sql, method (*DB) ExecContext(context.Context, string, ...interface{}) (Result, error)
|
||||
pkg database/sql, method (*DB) PingContext(context.Context) error
|
||||
pkg database/sql, method (*DB) PrepareContext(context.Context, string) (*Stmt, error)
|
||||
pkg database/sql, method (*DB) QueryContext(context.Context, string, ...interface{}) (*Rows, error)
|
||||
pkg database/sql, method (*DB) QueryRowContext(context.Context, string, ...interface{}) *Row
|
||||
pkg database/sql, method (*Rows) ColumnTypes() ([]*ColumnType, error)
|
||||
pkg database/sql, method (*Rows) NextResultSet() bool
|
||||
pkg database/sql, method (*Stmt) ExecContext(context.Context, ...interface{}) (Result, error)
|
||||
pkg database/sql, method (*Stmt) QueryContext(context.Context, ...interface{}) (*Rows, error)
|
||||
pkg database/sql, method (*Stmt) QueryRowContext(context.Context, ...interface{}) *Row
|
||||
pkg database/sql, method (*Tx) ExecContext(context.Context, string, ...interface{}) (Result, error)
|
||||
pkg database/sql, method (*Tx) PrepareContext(context.Context, string) (*Stmt, error)
|
||||
pkg database/sql, method (*Tx) QueryContext(context.Context, string, ...interface{}) (*Rows, error)
|
||||
pkg database/sql, method (*Tx) QueryRowContext(context.Context, string, ...interface{}) *Row
|
||||
pkg database/sql, method (*Tx) StmtContext(context.Context, *Stmt) *Stmt
|
||||
pkg database/sql, type ColumnType struct
|
||||
pkg database/sql, type IsolationLevel int
|
||||
pkg database/sql, type NamedArg struct
|
||||
pkg database/sql, type NamedArg struct, Name string
|
||||
pkg database/sql, type NamedArg struct, Value interface{}
|
||||
pkg database/sql, type TxOptions struct
|
||||
pkg database/sql, type TxOptions struct, Isolation IsolationLevel
|
||||
pkg database/sql, type TxOptions struct, ReadOnly bool
|
||||
pkg debug/pe, method (*COFFSymbol) FullName(StringTable) (string, error)
|
||||
pkg debug/pe, method (StringTable) String(uint32) (string, error)
|
||||
pkg debug/pe, type File struct, COFFSymbols []COFFSymbol
|
||||
pkg debug/pe, type File struct, StringTable StringTable
|
||||
pkg debug/pe, type Reloc struct
|
||||
pkg debug/pe, type Reloc struct, SymbolTableIndex uint32
|
||||
pkg debug/pe, type Reloc struct, Type uint16
|
||||
pkg debug/pe, type Reloc struct, VirtualAddress uint32
|
||||
pkg debug/pe, type Section struct, Relocs []Reloc
|
||||
pkg debug/pe, type StringTable []uint8
|
||||
pkg encoding/base64, method (Encoding) Strict() *Encoding
|
||||
pkg encoding/json, method (RawMessage) MarshalJSON() ([]uint8, error)
|
||||
pkg encoding/json, type UnmarshalTypeError struct, Field string
|
||||
pkg encoding/json, type UnmarshalTypeError struct, Struct string
|
||||
pkg expvar, func Handler() http.Handler
|
||||
pkg expvar, method (*Float) Value() float64
|
||||
pkg expvar, method (Func) Value() interface{}
|
||||
pkg expvar, method (*Int) Value() int64
|
||||
pkg expvar, method (*String) Value() string
|
||||
pkg go/doc, func IsPredeclared(string) bool
|
||||
pkg go/types, func Default(Type) Type
|
||||
pkg go/types, func IdenticalIgnoreTags(Type, Type) bool
|
||||
pkg math/big, method (*Float) Scan(fmt.ScanState, int32) error
|
||||
pkg math/big, method (*Int) Sqrt(*Int) *Int
|
||||
pkg math/rand, func Uint64() uint64
|
||||
pkg math/rand, method (*Rand) Uint64() uint64
|
||||
pkg math/rand, type Source64 interface, Int63() int64
|
||||
pkg math/rand, type Source64 interface { Int63, Seed, Uint64 }
|
||||
pkg math/rand, type Source64 interface, Seed(int64)
|
||||
pkg math/rand, type Source64 interface, Uint64() uint64
|
||||
pkg net/http, const TrailerPrefix ideal-string
|
||||
pkg net/http, const TrailerPrefix = "Trailer:"
|
||||
pkg net/http/httptrace, type ClientTrace struct, TLSHandshakeDone func(tls.ConnectionState, error)
|
||||
pkg net/http/httptrace, type ClientTrace struct, TLSHandshakeStart func()
|
||||
pkg net/http/httputil, type ReverseProxy struct, ModifyResponse func(*http.Response) error
|
||||
pkg net/http, method (*Server) Close() error
|
||||
pkg net/http, method (*Server) Shutdown(context.Context) error
|
||||
pkg net/http, type Pusher interface { Push }
|
||||
pkg net/http, type Pusher interface, Push(string, *PushOptions) error
|
||||
pkg net/http, type PushOptions struct
|
||||
pkg net/http, type PushOptions struct, Header Header
|
||||
pkg net/http, type PushOptions struct, Method string
|
||||
pkg net/http, type Request struct, GetBody func() (io.ReadCloser, error)
|
||||
pkg net/http, type Server struct, IdleTimeout time.Duration
|
||||
pkg net/http, type Server struct, ReadHeaderTimeout time.Duration
|
||||
pkg net/http, type Transport struct, ProxyConnectHeader Header
|
||||
pkg net/http, var ErrAbortHandler error
|
||||
pkg net/http, var ErrServerClosed error
|
||||
pkg net/http, var NoBody noBody
|
||||
pkg net/mail, func ParseDate(string) (time.Time, error)
|
||||
pkg net, method (*Buffers) Read([]uint8) (int, error)
|
||||
pkg net, method (*Buffers) WriteTo(io.Writer) (int64, error)
|
||||
pkg net, method (*Resolver) LookupAddr(context.Context, string) ([]string, error)
|
||||
pkg net, method (*Resolver) LookupCNAME(context.Context, string) (string, error)
|
||||
pkg net, method (*Resolver) LookupHost(context.Context, string) ([]string, error)
|
||||
pkg net, method (*Resolver) LookupIPAddr(context.Context, string) ([]IPAddr, error)
|
||||
pkg net, method (*Resolver) LookupMX(context.Context, string) ([]*MX, error)
|
||||
pkg net, method (*Resolver) LookupNS(context.Context, string) ([]*NS, error)
|
||||
pkg net, method (*Resolver) LookupPort(context.Context, string, string) (int, error)
|
||||
pkg net, method (*Resolver) LookupSRV(context.Context, string, string, string) (string, []*SRV, error)
|
||||
pkg net, method (*Resolver) LookupTXT(context.Context, string) ([]string, error)
|
||||
pkg net, method (*UnixListener) SetUnlinkOnClose(bool)
|
||||
pkg net, type Buffers [][]uint8
|
||||
pkg net, type Dialer struct, Resolver *Resolver
|
||||
pkg net, type Resolver struct
|
||||
pkg net, type Resolver struct, PreferGo bool
|
||||
pkg net/url, func PathEscape(string) string
|
||||
pkg net/url, func PathUnescape(string) (string, error)
|
||||
pkg net/url, method (*URL) Hostname() string
|
||||
pkg net/url, method (*URL) MarshalBinary() ([]uint8, error)
|
||||
pkg net/url, method (*URL) Port() string
|
||||
pkg net/url, method (*URL) UnmarshalBinary([]uint8) error
|
||||
pkg net, var DefaultResolver *Resolver
|
||||
pkg os, func Executable() (string, error)
|
||||
pkg os, var ErrClosed error
|
||||
pkg plugin, func Open(string) (*Plugin, error)
|
||||
pkg plugin, method (*Plugin) Lookup(string) (Symbol, error)
|
||||
pkg plugin, type Plugin struct
|
||||
pkg plugin, type Symbol interface {}
|
||||
pkg reflect, func Swapper(interface{}) func(int, int)
|
||||
pkg runtime, func MutexProfile([]BlockProfileRecord) (int, bool)
|
||||
pkg runtime, func SetMutexProfileFraction(int) int
|
||||
pkg runtime, type MemStats struct, NumForcedGC uint32
|
||||
pkg sort, func Slice(interface{}, func(int, int) bool)
|
||||
pkg sort, func SliceIsSorted(interface{}, func(int, int) bool) bool
|
||||
pkg sort, func SliceStable(interface{}, func(int, int) bool)
|
||||
pkg syscall (linux-arm-cgo), func TimevalToNsec(Timeval) int64
|
||||
pkg syscall (linux-arm), func TimevalToNsec(Timeval) int64
|
||||
pkg syscall (openbsd-386), const SYS_KILL = 122
|
||||
pkg syscall (openbsd-386-cgo), const SYS_KILL = 122
|
||||
pkg syscall (openbsd-amd64), const SYS_KILL = 122
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_KILL = 122
|
||||
pkg syscall (windows-386), const ERROR_DIR_NOT_EMPTY = 145
|
||||
pkg syscall (windows-386), const ERROR_DIR_NOT_EMPTY Errno
|
||||
pkg syscall (windows-amd64), const ERROR_DIR_NOT_EMPTY = 145
|
||||
pkg syscall (windows-amd64), const ERROR_DIR_NOT_EMPTY Errno
|
||||
pkg testing, func CoverMode() string
|
||||
pkg testing, func MainStart(testDeps, []InternalTest, []InternalBenchmark, []InternalExample) *M
|
||||
pkg testing, method (*B) Name() string
|
||||
pkg testing, method (*T) Name() string
|
||||
pkg testing, type TB interface, Name() string
|
||||
pkg time, func Until(Time) Duration
|
||||
169
api/go1.9.txt
169
api/go1.9.txt
@@ -1,169 +0,0 @@
|
||||
pkg crypto, const BLAKE2b_256 = 17
|
||||
pkg crypto, const BLAKE2b_256 Hash
|
||||
pkg crypto, const BLAKE2b_384 = 18
|
||||
pkg crypto, const BLAKE2b_384 Hash
|
||||
pkg crypto, const BLAKE2b_512 = 19
|
||||
pkg crypto, const BLAKE2b_512 Hash
|
||||
pkg crypto, const BLAKE2s_256 = 16
|
||||
pkg crypto, const BLAKE2s_256 Hash
|
||||
pkg crypto/x509, type Certificate struct, ExcludedDNSDomains []string
|
||||
pkg database/sql, method (*Conn) BeginTx(context.Context, *TxOptions) (*Tx, error)
|
||||
pkg database/sql, method (*Conn) Close() error
|
||||
pkg database/sql, method (*Conn) ExecContext(context.Context, string, ...interface{}) (Result, error)
|
||||
pkg database/sql, method (*Conn) PingContext(context.Context) error
|
||||
pkg database/sql, method (*Conn) PrepareContext(context.Context, string) (*Stmt, error)
|
||||
pkg database/sql, method (*Conn) QueryContext(context.Context, string, ...interface{}) (*Rows, error)
|
||||
pkg database/sql, method (*Conn) QueryRowContext(context.Context, string, ...interface{}) *Row
|
||||
pkg database/sql, method (*DB) Conn(context.Context) (*Conn, error)
|
||||
pkg database/sql, type Conn struct
|
||||
pkg database/sql, type Out struct
|
||||
pkg database/sql, type Out struct, Dest interface{}
|
||||
pkg database/sql, type Out struct, In bool
|
||||
pkg database/sql, var ErrConnDone error
|
||||
pkg database/sql/driver, type NamedValueChecker interface { CheckNamedValue }
|
||||
pkg database/sql/driver, type NamedValueChecker interface, CheckNamedValue(*NamedValue) error
|
||||
pkg database/sql/driver, var ErrRemoveArgument error
|
||||
pkg encoding/asn1, const TagNull = 5
|
||||
pkg encoding/asn1, const TagNull ideal-int
|
||||
pkg encoding/asn1, var NullBytes []uint8
|
||||
pkg encoding/asn1, var NullRawValue RawValue
|
||||
pkg encoding/base32, const NoPadding = -1
|
||||
pkg encoding/base32, const NoPadding int32
|
||||
pkg encoding/base32, const StdPadding = 61
|
||||
pkg encoding/base32, const StdPadding int32
|
||||
pkg encoding/base32, method (Encoding) WithPadding(int32) *Encoding
|
||||
pkg encoding/csv, type Reader struct, ReuseRecord bool
|
||||
pkg encoding/json, func Valid([]uint8) bool
|
||||
pkg go/ast, type TypeSpec struct, Assign token.Pos
|
||||
pkg go/types, func SizesFor(string, string) Sizes
|
||||
pkg go/types, method (*TypeName) IsAlias() bool
|
||||
pkg hash/fnv, func New128() hash.Hash
|
||||
pkg hash/fnv, func New128a() hash.Hash
|
||||
pkg html/template, const ErrPredefinedEscaper = 11
|
||||
pkg html/template, const ErrPredefinedEscaper ErrorCode
|
||||
pkg image/png, type Encoder struct, BufferPool EncoderBufferPool
|
||||
pkg image/png, type EncoderBuffer struct
|
||||
pkg image/png, type EncoderBufferPool interface { Get, Put }
|
||||
pkg image/png, type EncoderBufferPool interface, Get() *EncoderBuffer
|
||||
pkg image/png, type EncoderBufferPool interface, Put(*EncoderBuffer)
|
||||
pkg math/big, method (*Int) IsInt64() bool
|
||||
pkg math/big, method (*Int) IsUint64() bool
|
||||
pkg math/big, type Word uint
|
||||
pkg math/bits, const UintSize = 64
|
||||
pkg math/bits, const UintSize ideal-int
|
||||
pkg math/bits, func LeadingZeros(uint) int
|
||||
pkg math/bits, func LeadingZeros16(uint16) int
|
||||
pkg math/bits, func LeadingZeros32(uint32) int
|
||||
pkg math/bits, func LeadingZeros64(uint64) int
|
||||
pkg math/bits, func LeadingZeros8(uint8) int
|
||||
pkg math/bits, func Len(uint) int
|
||||
pkg math/bits, func Len16(uint16) int
|
||||
pkg math/bits, func Len32(uint32) int
|
||||
pkg math/bits, func Len64(uint64) int
|
||||
pkg math/bits, func Len8(uint8) int
|
||||
pkg math/bits, func OnesCount(uint) int
|
||||
pkg math/bits, func OnesCount16(uint16) int
|
||||
pkg math/bits, func OnesCount32(uint32) int
|
||||
pkg math/bits, func OnesCount64(uint64) int
|
||||
pkg math/bits, func OnesCount8(uint8) int
|
||||
pkg math/bits, func Reverse(uint) uint
|
||||
pkg math/bits, func Reverse16(uint16) uint16
|
||||
pkg math/bits, func Reverse32(uint32) uint32
|
||||
pkg math/bits, func Reverse64(uint64) uint64
|
||||
pkg math/bits, func Reverse8(uint8) uint8
|
||||
pkg math/bits, func ReverseBytes(uint) uint
|
||||
pkg math/bits, func ReverseBytes16(uint16) uint16
|
||||
pkg math/bits, func ReverseBytes32(uint32) uint32
|
||||
pkg math/bits, func ReverseBytes64(uint64) uint64
|
||||
pkg math/bits, func RotateLeft(uint, int) uint
|
||||
pkg math/bits, func RotateLeft16(uint16, int) uint16
|
||||
pkg math/bits, func RotateLeft32(uint32, int) uint32
|
||||
pkg math/bits, func RotateLeft64(uint64, int) uint64
|
||||
pkg math/bits, func RotateLeft8(uint8, int) uint8
|
||||
pkg math/bits, func TrailingZeros(uint) int
|
||||
pkg math/bits, func TrailingZeros16(uint16) int
|
||||
pkg math/bits, func TrailingZeros32(uint32) int
|
||||
pkg math/bits, func TrailingZeros64(uint64) int
|
||||
pkg math/bits, func TrailingZeros8(uint8) int
|
||||
pkg mime, var ErrInvalidMediaParameter error
|
||||
pkg mime/multipart, type FileHeader struct, Size int64
|
||||
pkg mime/multipart, var ErrMessageTooLarge error
|
||||
pkg net, method (*IPConn) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, method (*TCPConn) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, method (*UDPConn) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, method (*UnixConn) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, type Resolver struct, Dial func(context.Context, string, string) (Conn, error)
|
||||
pkg net, type Resolver struct, StrictErrors bool
|
||||
pkg net/http, func ServeTLS(net.Listener, Handler, string, string) error
|
||||
pkg net/http, method (*Server) RegisterOnShutdown(func())
|
||||
pkg net/http, method (*Server) ServeTLS(net.Listener, string, string) error
|
||||
pkg net/http/fcgi, func ProcessEnv(*http.Request) map[string]string
|
||||
pkg net/http/httptest, method (*Server) Certificate() *x509.Certificate
|
||||
pkg net/http/httptest, method (*Server) Client() *http.Client
|
||||
pkg reflect, func MakeMapWithSize(Type, int) Value
|
||||
pkg runtime/pprof, func Do(context.Context, LabelSet, func(context.Context))
|
||||
pkg runtime/pprof, func ForLabels(context.Context, func(string, string) bool)
|
||||
pkg runtime/pprof, func Label(context.Context, string) (string, bool)
|
||||
pkg runtime/pprof, func Labels(...string) LabelSet
|
||||
pkg runtime/pprof, func SetGoroutineLabels(context.Context)
|
||||
pkg runtime/pprof, func WithLabels(context.Context, LabelSet) context.Context
|
||||
pkg runtime/pprof, type LabelSet struct
|
||||
pkg sync, method (*Map) Delete(interface{})
|
||||
pkg sync, method (*Map) Load(interface{}) (interface{}, bool)
|
||||
pkg sync, method (*Map) LoadOrStore(interface{}, interface{}) (interface{}, bool)
|
||||
pkg sync, method (*Map) Range(func(interface{}, interface{}) bool)
|
||||
pkg sync, method (*Map) Store(interface{}, interface{})
|
||||
pkg sync, type Map struct
|
||||
pkg syscall (darwin-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (darwin-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (darwin-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (darwin-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-386-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-386), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-amd64-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-amd64), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-arm-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-arm-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-arm), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-arm), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-386-cgo), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-386), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-amd64-cgo), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-amd64), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-arm-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-arm-cgo), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-arm), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-arm), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (netbsd-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-arm-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-arm), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (openbsd-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (openbsd-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (openbsd-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (openbsd-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (windows-386), const WSAECONNABORTED = 10053
|
||||
pkg syscall (windows-386), const WSAECONNABORTED Errno
|
||||
pkg syscall (windows-amd64), const WSAECONNABORTED = 10053
|
||||
pkg syscall (windows-amd64), const WSAECONNABORTED Errno
|
||||
pkg syscall, type Conn interface { SyscallConn }
|
||||
pkg syscall, type Conn interface, SyscallConn() (RawConn, error)
|
||||
pkg syscall, type RawConn interface { Control, Read, Write }
|
||||
pkg syscall, type RawConn interface, Control(func(uintptr)) error
|
||||
pkg syscall, type RawConn interface, Read(func(uintptr) bool) error
|
||||
pkg syscall, type RawConn interface, Write(func(uintptr) bool) error
|
||||
pkg testing, method (*B) Helper()
|
||||
pkg testing, method (*T) Helper()
|
||||
pkg testing, type TB interface, Helper()
|
||||
pkg time, method (Duration) Round(Duration) Duration
|
||||
pkg time, method (Duration) Truncate(Duration) Duration
|
||||
19
api/next.txt
19
api/next.txt
@@ -1,19 +0,0 @@
|
||||
pkg unicode, const Version = "13.0.0"
|
||||
pkg unicode, var Chorasmian *RangeTable
|
||||
pkg unicode, var Dives_Akuru *RangeTable
|
||||
pkg unicode, var Khitan_Small_Script *RangeTable
|
||||
pkg unicode, var Yezidi *RangeTable
|
||||
pkg text/template/parse, const NodeComment = 20
|
||||
pkg text/template/parse, const NodeComment NodeType
|
||||
pkg text/template/parse, const ParseComments = 1
|
||||
pkg text/template/parse, const ParseComments Mode
|
||||
pkg text/template/parse, method (*CommentNode) Copy() Node
|
||||
pkg text/template/parse, method (*CommentNode) String() string
|
||||
pkg text/template/parse, method (CommentNode) Position() Pos
|
||||
pkg text/template/parse, method (CommentNode) Type() NodeType
|
||||
pkg text/template/parse, type CommentNode struct
|
||||
pkg text/template/parse, type CommentNode struct, Text string
|
||||
pkg text/template/parse, type CommentNode struct, embedded NodeType
|
||||
pkg text/template/parse, type CommentNode struct, embedded Pos
|
||||
pkg text/template/parse, type Mode uint
|
||||
pkg text/template/parse, type Tree struct, Mode Mode
|
||||
|
||||
@@ -74,7 +74,7 @@ important, the use of the tool itself.</p>
|
||||
<p>The <code>go</code> command requires that code adheres to a few key,
|
||||
well-established conventions.</p>
|
||||
|
||||
<p>First, the import path is derived in a known way from the URL of the
|
||||
<p>First, the import path is derived in an known way from the URL of the
|
||||
source code. For Bitbucket, GitHub, Google Code, and Launchpad, the
|
||||
root directory of the repository is identified by the repository's
|
||||
main URL, without the <code>http://</code> prefix. Subdirectories are named by
|
||||
@@ -97,14 +97,13 @@ a tool like the go command to look at an unfamiliar import path and
|
||||
deduce where to obtain the source code.</p>
|
||||
|
||||
<p>Second, the place to store sources in the local file system is derived
|
||||
in a known way from the import path, specifically
|
||||
<code>$GOPATH/src/<import-path></code>.
|
||||
If unset, <code>$GOPATH</code> defaults to a subdirectory
|
||||
named <code>go</code> in the user's home directory.
|
||||
in a known way from the import path. Specifically, the first choice
|
||||
is <code>$GOPATH/src/<import-path></code>. If <code>$GOPATH</code> is
|
||||
unset, the go command will fall back to storing source code alongside the
|
||||
standard Go packages, in <code>$GOROOT/src/<import-path></code>.
|
||||
If <code>$GOPATH</code> is set to a list of paths, the go command tries
|
||||
<code><dir>/src/<import-path></code> for each of the directories in
|
||||
that list.
|
||||
</p>
|
||||
that list.</p>
|
||||
|
||||
<p>Each of those trees contains, by convention, a top-level directory named
|
||||
"<code>bin</code>", for holding compiled executables, and a top-level directory
|
||||
@@ -134,30 +133,45 @@ be able to adapt to changing build environments and conditions. For
|
||||
example, if we allowed extra configuration such as compiler flags or
|
||||
command line recipes, then that configuration would need to be updated
|
||||
each time the build tools changed; it would also be inherently tied
|
||||
to the use of a specific toolchain.</p>
|
||||
to the use of a specific tool chain.</p>
|
||||
|
||||
<h2>Getting started with the go command</h2>
|
||||
|
||||
<p>Finally, a quick tour of how to use the go command.
|
||||
As mentioned above, the default <code>$GOPATH</code> on Unix is <code>$HOME/go</code>.
|
||||
We'll store our programs there.
|
||||
To use a different location, you can set <code>$GOPATH</code>;
|
||||
see <a href="/doc/code.html">How to Write Go Code</a> for details.
|
||||
<p>Finally, a quick tour of how to use the go command, to supplement
|
||||
the information in <a href="/doc/code.html">How to Write Go Code</a>,
|
||||
which you might want to read first. Assuming you want
|
||||
to keep your source code separate from the Go distribution source
|
||||
tree, the first step is to set <code>$GOPATH</code>, the one piece of global
|
||||
configuration that the go command needs. The <code>$GOPATH</code> can be a
|
||||
list of directories, but by far the most common usage should be to set it to a
|
||||
single directory. In particular, you do not need a separate entry in
|
||||
<code>$GOPATH</code> for each of your projects. One <code>$GOPATH</code> can
|
||||
support many projects.</p>
|
||||
|
||||
<p>We first add some source code. Suppose we want to use
|
||||
<p>Here’s an example. Let’s say we decide to keep our Go code in the directory
|
||||
<code>$HOME/mygo</code>. We need to create that directory and set
|
||||
<code>$GOPATH</code> accordingly.</p>
|
||||
|
||||
<pre>
|
||||
$ mkdir $HOME/mygo
|
||||
$ export GOPATH=$HOME/mygo
|
||||
$
|
||||
</pre>
|
||||
|
||||
<p>Into this directory, we now add some source code. Suppose we want to use
|
||||
the indexing library from the codesearch project along with a left-leaning
|
||||
red-black tree. We can install both with the "<code>go get</code>"
|
||||
subcommand:</p>
|
||||
|
||||
<pre>
|
||||
$ go get github.com/google/codesearch/index
|
||||
$ go get code.google.com/p/codesearch/index
|
||||
$ go get github.com/petar/GoLLRB/llrb
|
||||
$
|
||||
</pre>
|
||||
|
||||
<p>Both of these projects are now downloaded and installed into <code>$HOME/go</code>,
|
||||
which contains the two directories
|
||||
<code>src/github.com/google/codesearch/index/</code> and
|
||||
<p>Both of these projects are now downloaded and installed into our
|
||||
<code>$GOPATH</code> directory. The one tree now contains the two directories
|
||||
<code>src/code.google.com/p/codesearch/index/</code> and
|
||||
<code>src/github.com/petar/GoLLRB/llrb/</code>, along with the compiled
|
||||
packages (in <code>pkg/</code>) for those libraries and their dependencies.</p>
|
||||
|
||||
@@ -170,14 +184,13 @@ the pattern "<code>./...</code>" means start in the current directory
|
||||
("<code>...</code>"):</p>
|
||||
|
||||
<pre>
|
||||
$ cd $HOME/go/src
|
||||
$ go list ./...
|
||||
github.com/google/codesearch/cmd/cgrep
|
||||
github.com/google/codesearch/cmd/cindex
|
||||
github.com/google/codesearch/cmd/csearch
|
||||
github.com/google/codesearch/index
|
||||
github.com/google/codesearch/regexp
|
||||
github.com/google/codesearch/sparse
|
||||
code.google.com/p/codesearch/cmd/cgrep
|
||||
code.google.com/p/codesearch/cmd/cindex
|
||||
code.google.com/p/codesearch/cmd/csearch
|
||||
code.google.com/p/codesearch/index
|
||||
code.google.com/p/codesearch/regexp
|
||||
code.google.com/p/codesearch/sparse
|
||||
github.com/petar/GoLLRB/example
|
||||
github.com/petar/GoLLRB/llrb
|
||||
$
|
||||
@@ -187,12 +200,12 @@ $
|
||||
|
||||
<pre>
|
||||
$ go test ./...
|
||||
? github.com/google/codesearch/cmd/cgrep [no test files]
|
||||
? github.com/google/codesearch/cmd/cindex [no test files]
|
||||
? github.com/google/codesearch/cmd/csearch [no test files]
|
||||
ok github.com/google/codesearch/index 0.203s
|
||||
ok github.com/google/codesearch/regexp 0.017s
|
||||
? github.com/google/codesearch/sparse [no test files]
|
||||
? code.google.com/p/codesearch/cmd/cgrep [no test files]
|
||||
? code.google.com/p/codesearch/cmd/cindex [no test files]
|
||||
? code.google.com/p/codesearch/cmd/csearch [no test files]
|
||||
ok code.google.com/p/codesearch/index 0.239s
|
||||
ok code.google.com/p/codesearch/regexp 0.021s
|
||||
? code.google.com/p/codesearch/sparse [no test files]
|
||||
? github.com/petar/GoLLRB/example [no test files]
|
||||
ok github.com/petar/GoLLRB/llrb 0.231s
|
||||
$
|
||||
@@ -202,18 +215,18 @@ $
|
||||
current directory:</p>
|
||||
|
||||
<pre>
|
||||
$ cd github.com/google/codesearch/regexp
|
||||
$ cd $GOPATH/src/code.google.com/p/codesearch/regexp
|
||||
$ go list
|
||||
github.com/google/codesearch/regexp
|
||||
code.google.com/p/codesearch/regexp
|
||||
$ go test -v
|
||||
=== RUN TestNstateEnc
|
||||
--- PASS: TestNstateEnc (0.00s)
|
||||
=== RUN TestMatch
|
||||
--- PASS: TestMatch (0.00s)
|
||||
=== RUN TestGrep
|
||||
--- PASS: TestGrep (0.00s)
|
||||
=== RUN TestNstateEnc
|
||||
--- PASS: TestNstateEnc (0.00 seconds)
|
||||
=== RUN TestMatch
|
||||
--- PASS: TestMatch (0.01 seconds)
|
||||
=== RUN TestGrep
|
||||
--- PASS: TestGrep (0.00 seconds)
|
||||
PASS
|
||||
ok github.com/google/codesearch/regexp 0.018s
|
||||
ok code.google.com/p/codesearch/regexp 0.021s
|
||||
$ go install
|
||||
$
|
||||
</pre>
|
||||
@@ -231,6 +244,9 @@ pick such a long name, but that ability would require additional configuration
|
||||
and complexity in the tool. Typing an extra directory name or two is a small
|
||||
price to pay for the increased simplicity and power.</p>
|
||||
|
||||
<p>As the example shows, it’s fine to work with packages from many different
|
||||
projects at once within a single <code>$GOPATH</code> root directory.</p>
|
||||
|
||||
<h2>Limitations</h2>
|
||||
|
||||
<p>As mentioned above, the go command is not a general-purpose build
|
||||
@@ -239,7 +255,8 @@ In particular, it does not have any facility for generating Go
|
||||
source files <em>during</em> a build, although it does provide
|
||||
<a href="/cmd/go/#hdr-Generate_Go_files_by_processing_source"><code>go</code>
|
||||
<code>generate</code></a>,
|
||||
which can automate the creation of Go files <em>before</em> the build.
|
||||
which can automate the creation of Go files <em>before</em>
|
||||
the build, such as by running <code>yacc</code>.
|
||||
For more advanced build setups, you may need to write a
|
||||
makefile (or a configuration file for the build tool of your choice)
|
||||
to run whatever tool creates the Go files and then check those generated source files
|
||||
|
||||
@@ -133,11 +133,6 @@ cost of increased memory usage.
|
||||
<code>halt_on_error</code> (default <code>0</code>): Controls whether the program
|
||||
exits after reporting first data race.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>atexit_sleep_ms</code> (default <code>1000</code>): Amount of milliseconds
|
||||
to sleep in the main goroutine before exiting.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
@@ -379,46 +374,11 @@ func (w *Watchdog) Start() {
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3 id="Unsynchronized_send_and_close_operations">Unsynchronized send and close operations</h3>
|
||||
|
||||
<p>
|
||||
As this example demonstrates, unsynchronized send and close operations
|
||||
on the same channel can also be a race condition:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
c := make(chan struct{}) // or buffered channel
|
||||
|
||||
// The race detector cannot derive the happens before relation
|
||||
// for the following send and close operations. These two operations
|
||||
// are unsynchronized and happen concurrently.
|
||||
go func() { c <- struct{}{} }()
|
||||
close(c)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
According to the Go memory model, a send on a channel happens before
|
||||
the corresponding receive from that channel completes. To synchronize
|
||||
send and close operations, use a receive operation that guarantees
|
||||
the send is done before the close:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
c := make(chan struct{}) // or buffered channel
|
||||
|
||||
go func() { c <- struct{}{} }()
|
||||
<-c
|
||||
close(c)
|
||||
</pre>
|
||||
|
||||
<h2 id="Supported_Systems">Supported Systems</h2>
|
||||
|
||||
<p>
|
||||
The race detector runs on
|
||||
<code>linux/amd64</code>, <code>linux/ppc64le</code>,
|
||||
<code>linux/arm64</code>, <code>freebsd/amd64</code>,
|
||||
<code>netbsd/amd64</code>, <code>darwin/amd64</code>,
|
||||
and <code>windows/amd64</code>.
|
||||
The race detector runs on <code>darwin/amd64</code>, <code>freebsd/amd64</code>,
|
||||
<code>linux/amd64</code>, and <code>windows/amd64</code>.
|
||||
</p>
|
||||
|
||||
<h2 id="Runtime_Overheads">Runtime Overhead</h2>
|
||||
@@ -427,14 +387,3 @@ close(c)
|
||||
The cost of race detection varies by program, but for a typical program, memory
|
||||
usage may increase by 5-10x and execution time by 2-20x.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The race detector currently allocates an extra 8 bytes per <code>defer</code>
|
||||
and <code>recover</code> statement. Those extra allocations <a
|
||||
href="https://golang.org/issue/26813">are not recovered until the goroutine
|
||||
exits</a>. This means that if you have a long-running goroutine that is
|
||||
periodically issuing <code>defer</code> and <code>recover</code> calls,
|
||||
the program memory usage may grow without bound. These memory allocations
|
||||
will not show up in the output of <code>runtime.ReadMemStats</code> or
|
||||
<code>runtime/pprof</code>.
|
||||
</p>
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"regexp"
|
||||
)
|
||||
@@ -92,7 +89,7 @@ func getTitle(w http.ResponseWriter, r *http.Request) (string, error) {
|
||||
m := validPath.FindStringSubmatch(r.URL.Path)
|
||||
if m == nil {
|
||||
http.NotFound(w, r)
|
||||
return "", errors.New("invalid Page Title")
|
||||
return "", errors.New("Invalid Page Title")
|
||||
}
|
||||
return m[2], nil // The title is the second subexpression.
|
||||
}
|
||||
@@ -101,5 +98,5 @@ func main() {
|
||||
http.HandleFunc("/view/", viewHandler)
|
||||
http.HandleFunc("/edit/", editHandler)
|
||||
http.HandleFunc("/save/", saveHandler)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -52,5 +49,5 @@ func viewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
func main() {
|
||||
http.HandleFunc("/view/", viewHandler)
|
||||
http.HandleFunc("/edit/", editHandler)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"regexp"
|
||||
)
|
||||
@@ -90,5 +87,5 @@ func main() {
|
||||
http.HandleFunc("/view/", makeHandler(viewHandler))
|
||||
http.HandleFunc("/edit/", makeHandler(editHandler))
|
||||
http.HandleFunc("/save/", makeHandler(saveHandler))
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -64,5 +61,5 @@ func main() {
|
||||
http.HandleFunc("/view/", viewHandler)
|
||||
http.HandleFunc("/edit/", editHandler)
|
||||
http.HandleFunc("/save/", saveHandler)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
36
doc/articles/wiki/final-test.patch
Normal file
36
doc/articles/wiki/final-test.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
*** final.go 2015-06-14 23:59:22.000000000 +0200
|
||||
--- final-test.go 2015-06-15 00:15:41.000000000 +0200
|
||||
***************
|
||||
*** 7,12 ****
|
||||
--- 7,14 ----
|
||||
import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
+ "log"
|
||||
+ "net"
|
||||
"net/http"
|
||||
"regexp"
|
||||
)
|
||||
***************
|
||||
*** 85,89 ****
|
||||
http.HandleFunc("/edit/", makeHandler(editHandler))
|
||||
http.HandleFunc("/save/", makeHandler(saveHandler))
|
||||
|
||||
! http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
--- 87,101 ----
|
||||
http.HandleFunc("/edit/", makeHandler(editHandler))
|
||||
http.HandleFunc("/save/", makeHandler(saveHandler))
|
||||
|
||||
! l, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
! if err != nil {
|
||||
! log.Fatal(err)
|
||||
! }
|
||||
! err = ioutil.WriteFile("final-test-port.txt", []byte(l.Addr().String()), 0644)
|
||||
! if err != nil {
|
||||
! log.Fatal(err)
|
||||
! }
|
||||
! s := &http.Server{}
|
||||
! s.Serve(l)
|
||||
! return
|
||||
}
|
||||
@@ -2,14 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"regexp"
|
||||
)
|
||||
@@ -88,5 +85,5 @@ func main() {
|
||||
http.HandleFunc("/edit/", makeHandler(editHandler))
|
||||
http.HandleFunc("/save/", makeHandler(saveHandler))
|
||||
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func serve() error {
|
||||
l, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println(l.Addr().String())
|
||||
s := &http.Server{}
|
||||
return s.Serve(l)
|
||||
}
|
||||
63
doc/articles/wiki/get.go
Normal file
63
doc/articles/wiki/get.go
Normal file
@@ -0,0 +1,63 @@
|
||||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
post = flag.String("post", "", "urlencoded form data to POST")
|
||||
addr = flag.Bool("addr", false, "find open address and print to stdout")
|
||||
wait = flag.Duration("wait_for_port", 0, "if non-zero, the amount of time to wait for the address to become available")
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
if *addr {
|
||||
l, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer l.Close()
|
||||
fmt.Print(l.Addr())
|
||||
return
|
||||
}
|
||||
url := flag.Arg(0)
|
||||
if url == "" {
|
||||
log.Fatal("no url supplied")
|
||||
}
|
||||
var r *http.Response
|
||||
var err error
|
||||
loopUntil := time.Now().Add(*wait)
|
||||
for {
|
||||
if *post != "" {
|
||||
b := strings.NewReader(*post)
|
||||
r, err = http.Post(url, "application/x-www-form-urlencoded", b)
|
||||
} else {
|
||||
r, err = http.Get(url)
|
||||
}
|
||||
if err == nil || *wait == 0 || time.Now().After(loopUntil) {
|
||||
break
|
||||
}
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer r.Body.Close()
|
||||
_, err = io.Copy(os.Stdout, r.Body)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
module doc/articles/wiki
|
||||
|
||||
go 1.14
|
||||
@@ -1,10 +1,7 @@
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -14,5 +11,5 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", handler)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ You can compile and run the program like this:
|
||||
<pre>
|
||||
$ go build wiki.go
|
||||
$ ./wiki
|
||||
This is a sample Page.
|
||||
This is a sample page.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -213,12 +213,6 @@ worry about its second parameter, <code>nil</code>, for now.)
|
||||
This function will block until the program is terminated.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>ListenAndServe</code> always returns an error, since it only returns when an
|
||||
unexpected error occurs.
|
||||
In order to log that error we wrap the function call with <code>log.Fatal</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The function <code>handler</code> is of the type <code>http.HandlerFunc</code>.
|
||||
It takes an <code>http.ResponseWriter</code> and an <code>http.Request</code> as
|
||||
@@ -257,7 +251,6 @@ To use the <code>net/http</code> package, it must be imported:
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
<b>"net/http"</b>
|
||||
)
|
||||
</pre>
|
||||
@@ -269,12 +262,6 @@ view a wiki page. It will handle URLs prefixed with "/view/".
|
||||
|
||||
{{code "doc/articles/wiki/part2.go" `/^func viewHandler/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
Again, note the use of <code>_</code> to ignore the <code>error</code>
|
||||
return value from <code>loadPage</code>. This is done here for simplicity
|
||||
and generally considered bad practice. We will attend to this later.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
First, this function extracts the page title from <code>r.URL.Path</code>,
|
||||
the path component of the request URL.
|
||||
@@ -289,6 +276,12 @@ The function then loads the page data, formats the page with a string of simple
|
||||
HTML, and writes it to <code>w</code>, the <code>http.ResponseWriter</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Again, note the use of <code>_</code> to ignore the <code>error</code>
|
||||
return value from <code>loadPage</code>. This is done here for simplicity
|
||||
and generally considered bad practice. We will attend to this later.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To use this handler, we rewrite our <code>main</code> function to
|
||||
initialize <code>http</code> using the <code>viewHandler</code> to handle
|
||||
@@ -582,7 +575,7 @@ this, we can write a function to validate the title with a regular expression.
|
||||
|
||||
<p>
|
||||
First, add <code>"regexp"</code> to the <code>import</code> list.
|
||||
Then we can create a global variable to store our validation
|
||||
Then we can create a global variable to store our validation
|
||||
expression:
|
||||
</p>
|
||||
|
||||
@@ -675,7 +668,7 @@ The closure returned by <code>makeHandler</code> is a function that takes
|
||||
an <code>http.ResponseWriter</code> and <code>http.Request</code> (in other
|
||||
words, an <code>http.HandlerFunc</code>).
|
||||
The closure extracts the <code>title</code> from the request path, and
|
||||
validates it with the <code>validPath</code> regexp. If the
|
||||
validates it with the <code>TitleValidator</code> regexp. If the
|
||||
<code>title</code> is invalid, an error will be written to the
|
||||
<code>ResponseWriter</code> using the <code>http.NotFound</code> function.
|
||||
If the <code>title</code> is valid, the enclosed handler function
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -55,5 +52,5 @@ func editHandler(w http.ResponseWriter, r *http.Request) {
|
||||
func main() {
|
||||
http.HandleFunc("/view/", viewHandler)
|
||||
http.HandleFunc("/edit/", editHandler)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -40,5 +37,5 @@ func viewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/view/", viewHandler)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -72,5 +69,5 @@ func main() {
|
||||
http.HandleFunc("/view/", viewHandler)
|
||||
http.HandleFunc("/edit/", editHandler)
|
||||
http.HandleFunc("/save/", saveHandler)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -56,5 +53,5 @@ func main() {
|
||||
http.HandleFunc("/view/", viewHandler)
|
||||
http.HandleFunc("/edit/", editHandler)
|
||||
//http.HandleFunc("/save/", saveHandler)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
58
doc/articles/wiki/test.bash
Executable file
58
doc/articles/wiki/test.bash
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2010 The Go Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
set -e
|
||||
|
||||
if ! which patch > /dev/null; then
|
||||
echo "Skipping test; patch command not found."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
wiki_pid=
|
||||
cleanup() {
|
||||
kill $wiki_pid
|
||||
rm -f test_*.out Test.txt final-test.go final-test.bin final-test-port.txt a.out get.bin
|
||||
}
|
||||
trap cleanup 0 INT
|
||||
|
||||
rm -f get.bin final-test.bin a.out
|
||||
|
||||
# If called with -all, check that all code snippets compile.
|
||||
if [ "$1" == "-all" ]; then
|
||||
for fn in *.go; do
|
||||
go build -o a.out $fn
|
||||
done
|
||||
fi
|
||||
|
||||
go build -o get.bin get.go
|
||||
cp final.go final-test.go
|
||||
patch final-test.go final-test.patch > /dev/null
|
||||
go build -o final-test.bin final-test.go
|
||||
./final-test.bin &
|
||||
wiki_pid=$!
|
||||
|
||||
l=0
|
||||
while [ ! -f ./final-test-port.txt ]
|
||||
do
|
||||
l=$(($l+1))
|
||||
if [ "$l" -gt 5 ]
|
||||
then
|
||||
echo "port not available within 5 seconds"
|
||||
exit 1
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
addr=$(cat final-test-port.txt)
|
||||
./get.bin http://$addr/edit/Test > test_edit.out
|
||||
diff -u test_edit.out test_edit.good
|
||||
./get.bin -post=body=some%20content http://$addr/save/Test > test_save.out
|
||||
diff -u test_save.out test_view.good # should be the same as viewing
|
||||
diff -u Test.txt test_Test.txt.good
|
||||
./get.bin http://$addr/view/Test > test_view.out
|
||||
diff -u test_view.out test_view.good
|
||||
|
||||
echo PASS
|
||||
@@ -1,165 +0,0 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSnippetsCompile(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping slow builds in short mode")
|
||||
}
|
||||
|
||||
goFiles, err := filepath.Glob("*.go")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
for _, f := range goFiles {
|
||||
if strings.HasSuffix(f, "_test.go") {
|
||||
continue
|
||||
}
|
||||
f := f
|
||||
t.Run(f, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
cmd := exec.Command("go", "build", "-o", os.DevNull, f)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Errorf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, out)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestWikiServer(t *testing.T) {
|
||||
must := func(err error) {
|
||||
if err != nil {
|
||||
t.Helper()
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
dir, err := ioutil.TempDir("", t.Name())
|
||||
must(err)
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
// We're testing a walkthrough example of how to write a server.
|
||||
//
|
||||
// That server hard-codes a port number to make the walkthrough simpler, but
|
||||
// we can't assume that the hard-coded port is available on an arbitrary
|
||||
// builder. So we'll patch out the hard-coded port, and replace it with a
|
||||
// function that writes the server's address to stdout
|
||||
// so that we can read it and know where to send the test requests.
|
||||
|
||||
finalGo, err := ioutil.ReadFile("final.go")
|
||||
must(err)
|
||||
const patchOld = `log.Fatal(http.ListenAndServe(":8080", nil))`
|
||||
patched := bytes.ReplaceAll(finalGo, []byte(patchOld), []byte(`log.Fatal(serve())`))
|
||||
if bytes.Equal(patched, finalGo) {
|
||||
t.Fatalf("Can't patch final.go: %q not found.", patchOld)
|
||||
}
|
||||
must(ioutil.WriteFile(filepath.Join(dir, "final_patched.go"), patched, 0644))
|
||||
|
||||
// Build the server binary from the patched sources.
|
||||
// The 'go' command requires that they all be in the same directory.
|
||||
// final_test.go provides the implemtation for our serve function.
|
||||
must(copyFile(filepath.Join(dir, "final_srv.go"), "final_test.go"))
|
||||
cmd := exec.Command("go", "build",
|
||||
"-o", filepath.Join(dir, "final.exe"),
|
||||
filepath.Join(dir, "final_patched.go"),
|
||||
filepath.Join(dir, "final_srv.go"))
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, out)
|
||||
}
|
||||
|
||||
// Run the server in our temporary directory so that it can
|
||||
// write its content there. It also needs a couple of template files,
|
||||
// and looks for them in the same directory.
|
||||
must(copyFile(filepath.Join(dir, "edit.html"), "edit.html"))
|
||||
must(copyFile(filepath.Join(dir, "view.html"), "view.html"))
|
||||
cmd = exec.Command(filepath.Join(dir, "final.exe"))
|
||||
cmd.Dir = dir
|
||||
stderr := bytes.NewBuffer(nil)
|
||||
cmd.Stderr = stderr
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
must(err)
|
||||
must(cmd.Start())
|
||||
|
||||
defer func() {
|
||||
cmd.Process.Kill()
|
||||
err := cmd.Wait()
|
||||
if stderr.Len() > 0 {
|
||||
t.Logf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, stderr)
|
||||
}
|
||||
}()
|
||||
|
||||
var addr string
|
||||
if _, err := fmt.Fscanln(stdout, &addr); err != nil || addr == "" {
|
||||
t.Fatalf("Failed to read server address: %v", err)
|
||||
}
|
||||
|
||||
// The server is up and has told us its address.
|
||||
// Make sure that its HTTP API works as described in the article.
|
||||
|
||||
r, err := http.Get(fmt.Sprintf("http://%s/edit/Test", addr))
|
||||
must(err)
|
||||
responseMustMatchFile(t, r, "test_edit.good")
|
||||
|
||||
r, err = http.Post(fmt.Sprintf("http://%s/save/Test", addr),
|
||||
"application/x-www-form-urlencoded",
|
||||
strings.NewReader("body=some%20content"))
|
||||
must(err)
|
||||
responseMustMatchFile(t, r, "test_view.good")
|
||||
|
||||
gotTxt, err := ioutil.ReadFile(filepath.Join(dir, "Test.txt"))
|
||||
must(err)
|
||||
wantTxt, err := ioutil.ReadFile("test_Test.txt.good")
|
||||
must(err)
|
||||
if !bytes.Equal(wantTxt, gotTxt) {
|
||||
t.Fatalf("Test.txt differs from expected after posting to /save.\ngot:\n%s\nwant:\n%s", gotTxt, wantTxt)
|
||||
}
|
||||
|
||||
r, err = http.Get(fmt.Sprintf("http://%s/view/Test", addr))
|
||||
must(err)
|
||||
responseMustMatchFile(t, r, "test_view.good")
|
||||
}
|
||||
|
||||
func responseMustMatchFile(t *testing.T, r *http.Response, filename string) {
|
||||
t.Helper()
|
||||
|
||||
defer r.Body.Close()
|
||||
body, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
wantBody, err := ioutil.ReadFile(filename)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if !bytes.Equal(body, wantBody) {
|
||||
t.Fatalf("%v: body does not match %s.\ngot:\n%s\nwant:\n%s", r.Request.URL, filename, body, wantBody)
|
||||
}
|
||||
}
|
||||
|
||||
func copyFile(dst, src string) error {
|
||||
buf, err := ioutil.ReadFile(src)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ioutil.WriteFile(dst, buf, 0644)
|
||||
}
|
||||
272
doc/asm.html
272
doc/asm.html
@@ -29,7 +29,7 @@ Instead, the compiler operates on a kind of semi-abstract instruction set,
|
||||
and instruction selection occurs partly after code generation.
|
||||
The assembler works on the semi-abstract form, so
|
||||
when you see an instruction like <code>MOV</code>
|
||||
what the toolchain actually generates for that operation might
|
||||
what the tool chain actually generates for that operation might
|
||||
not be a move instruction at all, perhaps a clear or load.
|
||||
Or it might correspond exactly to the machine instruction with that name.
|
||||
In general, machine-specific operations tend to appear as themselves, while more general concepts like
|
||||
@@ -57,66 +57,59 @@ func main() {
|
||||
println(3)
|
||||
}
|
||||
$ GOOS=linux GOARCH=amd64 go tool compile -S x.go # or: go build -gcflags -S x.go
|
||||
"".main STEXT size=74 args=0x0 locals=0x10
|
||||
0x0000 00000 (x.go:3) TEXT "".main(SB), $16-0
|
||||
0x0000 00000 (x.go:3) MOVQ (TLS), CX
|
||||
0x0009 00009 (x.go:3) CMPQ SP, 16(CX)
|
||||
0x000d 00013 (x.go:3) JLS 67
|
||||
0x000f 00015 (x.go:3) SUBQ $16, SP
|
||||
0x0013 00019 (x.go:3) MOVQ BP, 8(SP)
|
||||
0x0018 00024 (x.go:3) LEAQ 8(SP), BP
|
||||
0x001d 00029 (x.go:3) FUNCDATA $0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
|
||||
0x001d 00029 (x.go:3) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
|
||||
0x001d 00029 (x.go:3) FUNCDATA $2, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
|
||||
0x001d 00029 (x.go:4) PCDATA $0, $0
|
||||
0x001d 00029 (x.go:4) PCDATA $1, $0
|
||||
0x001d 00029 (x.go:4) CALL runtime.printlock(SB)
|
||||
0x0022 00034 (x.go:4) MOVQ $3, (SP)
|
||||
0x002a 00042 (x.go:4) CALL runtime.printint(SB)
|
||||
0x002f 00047 (x.go:4) CALL runtime.printnl(SB)
|
||||
0x0034 00052 (x.go:4) CALL runtime.printunlock(SB)
|
||||
0x0039 00057 (x.go:5) MOVQ 8(SP), BP
|
||||
0x003e 00062 (x.go:5) ADDQ $16, SP
|
||||
0x0042 00066 (x.go:5) RET
|
||||
0x0043 00067 (x.go:5) NOP
|
||||
0x0043 00067 (x.go:3) PCDATA $1, $-1
|
||||
0x0043 00067 (x.go:3) PCDATA $0, $-1
|
||||
0x0043 00067 (x.go:3) CALL runtime.morestack_noctxt(SB)
|
||||
0x0048 00072 (x.go:3) JMP 0
|
||||
|
||||
--- prog list "main" ---
|
||||
0000 (x.go:3) TEXT main+0(SB),$8-0
|
||||
0001 (x.go:3) FUNCDATA $0,gcargs·0+0(SB)
|
||||
0002 (x.go:3) FUNCDATA $1,gclocals·0+0(SB)
|
||||
0003 (x.go:4) MOVQ $3,(SP)
|
||||
0004 (x.go:4) PCDATA $0,$8
|
||||
0005 (x.go:4) CALL ,runtime.printint+0(SB)
|
||||
0006 (x.go:4) PCDATA $0,$-1
|
||||
0007 (x.go:4) PCDATA $0,$0
|
||||
0008 (x.go:4) CALL ,runtime.printnl+0(SB)
|
||||
0009 (x.go:4) PCDATA $0,$-1
|
||||
0010 (x.go:5) RET ,
|
||||
...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The <code>FUNCDATA</code> and <code>PCDATA</code> directives contain information
|
||||
for use by the garbage collector; they are introduced by the compiler.
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<!-- Commenting out because the feature is gone but it's popular and may come back.
|
||||
|
||||
<p>
|
||||
To see what gets put in the binary after linking, use <code>go tool objdump</code>:
|
||||
To see what gets put in the binary after linking, add the <code>-a</code> flag to the linker:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go build -o x.exe x.go
|
||||
$ go tool objdump -s main.main x.exe
|
||||
TEXT main.main(SB) /tmp/x.go
|
||||
x.go:3 0x10501c0 65488b0c2530000000 MOVQ GS:0x30, CX
|
||||
x.go:3 0x10501c9 483b6110 CMPQ 0x10(CX), SP
|
||||
x.go:3 0x10501cd 7634 JBE 0x1050203
|
||||
x.go:3 0x10501cf 4883ec10 SUBQ $0x10, SP
|
||||
x.go:3 0x10501d3 48896c2408 MOVQ BP, 0x8(SP)
|
||||
x.go:3 0x10501d8 488d6c2408 LEAQ 0x8(SP), BP
|
||||
x.go:4 0x10501dd e86e45fdff CALL runtime.printlock(SB)
|
||||
x.go:4 0x10501e2 48c7042403000000 MOVQ $0x3, 0(SP)
|
||||
x.go:4 0x10501ea e8e14cfdff CALL runtime.printint(SB)
|
||||
x.go:4 0x10501ef e8ec47fdff CALL runtime.printnl(SB)
|
||||
x.go:4 0x10501f4 e8d745fdff CALL runtime.printunlock(SB)
|
||||
x.go:5 0x10501f9 488b6c2408 MOVQ 0x8(SP), BP
|
||||
x.go:5 0x10501fe 4883c410 ADDQ $0x10, SP
|
||||
x.go:5 0x1050202 c3 RET
|
||||
x.go:3 0x1050203 e83882ffff CALL runtime.morestack_noctxt(SB)
|
||||
x.go:3 0x1050208 ebb6 JMP main.main(SB)
|
||||
$ go tool 6l -a x.6 # or: go build -ldflags -a x.go
|
||||
codeblk [0x2000,0x1d059) at offset 0x1000
|
||||
002000 main.main | (3) TEXT main.main+0(SB),$8
|
||||
002000 65488b0c25a0080000 | (3) MOVQ 2208(GS),CX
|
||||
002009 483b21 | (3) CMPQ SP,(CX)
|
||||
00200c 7707 | (3) JHI ,2015
|
||||
00200e e83da20100 | (3) CALL ,1c250+runtime.morestack00
|
||||
002013 ebeb | (3) JMP ,2000
|
||||
002015 4883ec08 | (3) SUBQ $8,SP
|
||||
002019 | (3) FUNCDATA $0,main.gcargs·0+0(SB)
|
||||
002019 | (3) FUNCDATA $1,main.gclocals·0+0(SB)
|
||||
002019 48c7042403000000 | (4) MOVQ $3,(SP)
|
||||
002021 | (4) PCDATA $0,$8
|
||||
002021 e8aad20000 | (4) CALL ,f2d0+runtime.printint
|
||||
002026 | (4) PCDATA $0,$-1
|
||||
002026 | (4) PCDATA $0,$0
|
||||
002026 e865d40000 | (4) CALL ,f490+runtime.printnl
|
||||
00202b | (4) PCDATA $0,$-1
|
||||
00202b 4883c408 | (5) ADDQ $8,SP
|
||||
00202f c3 | (5) RET ,
|
||||
...
|
||||
</pre>
|
||||
|
||||
-->
|
||||
|
||||
<h3 id="constants">Constants</h3>
|
||||
|
||||
<p>
|
||||
@@ -146,7 +139,7 @@ The exact set depends on the architecture.
|
||||
<p>
|
||||
There are four predeclared symbols that refer to pseudo-registers.
|
||||
These are not real registers, but rather virtual registers maintained by
|
||||
the toolchain, such as a frame pointer.
|
||||
the tool chain, such as a frame pointer.
|
||||
The set of pseudo-registers is the same for all architectures:
|
||||
</p>
|
||||
|
||||
@@ -273,7 +266,7 @@ that assembly programming is a fraught endeavor.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In Go object files and binaries, the full name of a symbol is the
|
||||
In Go object files and binaries, the full name of a symbol is the
|
||||
package path followed by a period and the symbol name:
|
||||
<code>fmt.Printf</code> or <code>math/rand.Int</code>.
|
||||
Because the assembler's parser treats period and slash as punctuation,
|
||||
@@ -437,31 +430,6 @@ This is a wrapper function and should not count as disabling <code>recover</code
|
||||
(For <code>TEXT</code> items.)
|
||||
This function is a closure so it uses its incoming context register.
|
||||
</li>
|
||||
<li>
|
||||
<code>LOCAL</code> = 128
|
||||
<br>
|
||||
This symbol is local to the dynamic shared object.
|
||||
</li>
|
||||
<li>
|
||||
<code>TLSBSS</code> = 256
|
||||
<br>
|
||||
(For <code>DATA</code> and <code>GLOBL</code> items.)
|
||||
Put this data in thread local storage.
|
||||
</li>
|
||||
<li>
|
||||
<code>NOFRAME</code> = 512
|
||||
<br>
|
||||
(For <code>TEXT</code> items.)
|
||||
Do not insert instructions to allocate a stack frame and save/restore the return
|
||||
address, even if this is not a leaf function.
|
||||
Only valid on functions that declare a frame size of 0.
|
||||
</li>
|
||||
<li>
|
||||
<code>TOPFRAME</code> = 2048
|
||||
<br>
|
||||
(For <code>TEXT</code> items.)
|
||||
Function is the top of the call stack. Traceback should stop at this function.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="runtime">Runtime Coordination</h3>
|
||||
@@ -517,7 +485,7 @@ even for assembly functions not called directly from Go.
|
||||
At the start of the function, the arguments are assumed
|
||||
to be initialized but the results are assumed uninitialized.
|
||||
If the results will hold live pointers during a call instruction,
|
||||
the function should start by zeroing the results and then
|
||||
the function should start by zeroing the results and then
|
||||
executing the pseudo-instruction <code>GO_RESULTS_INITIALIZED</code>.
|
||||
This instruction records that the results are now initialized
|
||||
and should be scanned during stack movement and garbage collection.
|
||||
@@ -535,7 +503,7 @@ on the <code>TEXT</code> instruction.
|
||||
The pointer information can also be omitted if the
|
||||
function contains no call instructions.
|
||||
Otherwise, the local stack frame must not contain pointers,
|
||||
and the assembly must confirm this fact by executing the
|
||||
and the assembly must confirm this fact by executing the
|
||||
pseudo-instruction <code>NO_LOCAL_POINTERS</code>.
|
||||
Because stack resizing is implemented by moving the stack,
|
||||
the stack pointer may change during any function call:
|
||||
@@ -615,37 +583,27 @@ Here follow some descriptions of key Go-specific details for the supported archi
|
||||
<p>
|
||||
The runtime pointer to the <code>g</code> structure is maintained
|
||||
through the value of an otherwise unused (as far as Go is concerned) register in the MMU.
|
||||
An OS-dependent macro <code>get_tls</code> is defined for the assembler if the source is
|
||||
in the <code>runtime</code> package and includes a special header, <code>go_tls.h</code>:
|
||||
A OS-dependent macro <code>get_tls</code> is defined for the assembler if the source includes
|
||||
a special header, <code>go_asm.h</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
#include "go_tls.h"
|
||||
#include "go_asm.h"
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Within the runtime, the <code>get_tls</code> macro loads its argument register
|
||||
with a pointer to the <code>g</code> pointer, and the <code>g</code> struct
|
||||
contains the <code>m</code> pointer.
|
||||
There's another special header containing the offsets for each
|
||||
element of <code>g</code>, called <code>go_asm.h</code>.
|
||||
The sequence to load <code>g</code> and <code>m</code> using <code>CX</code> looks like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
#include "go_tls.h"
|
||||
#include "go_asm.h"
|
||||
...
|
||||
get_tls(CX)
|
||||
MOVL g(CX), AX // Move g into AX.
|
||||
MOVL g_m(AX), BX // Move g.m into BX.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Note: The code above works only in the <code>runtime</code> package, while <code>go_tls.h</code> also
|
||||
applies to <a href="#arm">arm</a>, <a href="#amd64">amd64</a> and amd64p32, and <code>go_asm.h</code> applies to all architectures.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Addressing modes:
|
||||
</p>
|
||||
@@ -687,13 +645,6 @@ MOVQ g(CX), AX // Move g into AX.
|
||||
MOVQ g_m(AX), BX // Move g.m into BX.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Register <code>BP</code> is callee-save.
|
||||
The assembler automatically inserts <code>BP</code> save/restore when frame size is larger than zero.
|
||||
Using <code>BP</code> as a general purpose register is allowed,
|
||||
however it can interfere with sampling-based profiling.
|
||||
</p>
|
||||
|
||||
<h3 id="arm">ARM</h3>
|
||||
|
||||
<p>
|
||||
@@ -787,14 +738,6 @@ The other codes are <code>-></code> (arithmetic right shift),
|
||||
The ARM64 port is in an experimental state.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>R18</code> is the "platform register", reserved on the Apple platform.
|
||||
To prevent accidental misuse, the register is named <code>R18_PLATFORM</code>.
|
||||
<code>R27</code> and <code>R28</code> are reserved by the compiler and linker.
|
||||
<code>R29</code> is the frame pointer.
|
||||
<code>R30</code> is the link register.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Instruction modifiers are appended to the instruction following a period.
|
||||
The only modifiers are <code>P</code> (postincrement) and <code>W</code>
|
||||
@@ -809,71 +752,32 @@ Addressing modes:
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>R0->16</code>
|
||||
<br>
|
||||
<code>R0>>16</code>
|
||||
<br>
|
||||
<code>R0<<16</code>
|
||||
<br>
|
||||
<code>R0@>16</code>:
|
||||
These are the same as on the 32-bit ARM.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>$(8<<12)</code>:
|
||||
Left shift the immediate value <code>8</code> by <code>12</code> bits.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>8(R0)</code>:
|
||||
Add the value of <code>R0</code> and <code>8</code>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>(R2)(R0)</code>:
|
||||
The location at <code>R0</code> plus <code>R2</code>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>R0.UXTB</code>
|
||||
<br>
|
||||
<code>R0.UXTB<<imm</code>:
|
||||
<code>UXTB</code>: extract an 8-bit value from the low-order bits of <code>R0</code> and zero-extend it to the size of <code>R0</code>.
|
||||
<code>R0.UXTB<<imm</code>: left shift the result of <code>R0.UXTB</code> by <code>imm</code> bits.
|
||||
The <code>imm</code> value can be 0, 1, 2, 3, or 4.
|
||||
The other extensions include <code>UXTH</code> (16-bit), <code>UXTW</code> (32-bit), and <code>UXTX</code> (64-bit).
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>R0.SXTB</code>
|
||||
<br>
|
||||
<code>R0.SXTB<<imm</code>:
|
||||
<code>SXTB</code>: extract an 8-bit value from the low-order bits of <code>R0</code> and sign-extend it to the size of <code>R0</code>.
|
||||
<code>R0.SXTB<<imm</code>: left shift the result of <code>R0.SXTB</code> by <code>imm</code> bits.
|
||||
The <code>imm</code> value can be 0, 1, 2, 3, or 4.
|
||||
The other extensions include <code>SXTH</code> (16-bit), <code>SXTW</code> (32-bit), and <code>SXTX</code> (64-bit).
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>(R5, R6)</code>: Register pair for <code>LDAXP</code>/<code>LDP</code>/<code>LDXP</code>/<code>STLXP</code>/<code>STP</code>/<code>STP</code>.
|
||||
<code>(R5, R6)</code>: Register pair for <code>LDP</code>/<code>STP</code>.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Reference: <a href="/pkg/cmd/internal/obj/arm64">Go ARM64 Assembly Instructions Reference Manual</a>
|
||||
</p>
|
||||
|
||||
<h3 id="ppc64">PPC64</h3>
|
||||
<h3 id="ppc64">64-bit PowerPC, a.k.a. ppc64</h3>
|
||||
|
||||
<p>
|
||||
This assembler is used by GOARCH values ppc64 and ppc64le.
|
||||
The 64-bit PowerPC port is in an experimental state.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Reference: <a href="/pkg/cmd/internal/obj/ppc64">Go PPC64 Assembly Instructions Reference Manual</a>
|
||||
Addressing modes:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>(R5)(R6*1)</code>: The location at <code>R5</code> plus <code>R6</code>. It is a scaled
|
||||
mode as on the x86, but the only scale allowed is <code>1</code>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>(R5+R6)</code>: Alias for (R5)(R6*1)
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3 id="s390x">IBM z/Architecture, a.k.a. s390x</h3>
|
||||
@@ -934,56 +838,6 @@ It is a scaled mode as on the x86, but the only scale allowed is <code>1</code>.
|
||||
|
||||
</ul>
|
||||
|
||||
<h3 id="mips">MIPS, MIPS64</h3>
|
||||
|
||||
<p>
|
||||
General purpose registers are named <code>R0</code> through <code>R31</code>,
|
||||
floating point registers are <code>F0</code> through <code>F31</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>R30</code> is reserved to point to <code>g</code>.
|
||||
<code>R23</code> is used as a temporary register.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In a <code>TEXT</code> directive, the frame size <code>$-4</code> for MIPS or
|
||||
<code>$-8</code> for MIPS64 instructs the linker not to save <code>LR</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>SP</code> refers to the virtual stack pointer.
|
||||
For the hardware register, use <code>R29</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Addressing modes:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>16(R1)</code>: The location at <code>R1</code> plus 16.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>(R1)</code>: Alias for <code>0(R1)</code>.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The value of <code>GOMIPS</code> environment variable (<code>hardfloat</code> or
|
||||
<code>softfloat</code>) is made available to assembly code by predefining either
|
||||
<code>GOMIPS_hardfloat</code> or <code>GOMIPS_softfloat</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The value of <code>GOMIPS64</code> environment variable (<code>hardfloat</code> or
|
||||
<code>softfloat</code>) is made available to assembly code by predefining either
|
||||
<code>GOMIPS64_hardfloat</code> or <code>GOMIPS64_softfloat</code>.
|
||||
</p>
|
||||
|
||||
<h3 id="unsupported_opcodes">Unsupported opcodes</h3>
|
||||
|
||||
<p>
|
||||
|
||||
19
doc/cmd.html
19
doc/cmd.html
@@ -18,9 +18,11 @@ underlying binary with arguments appropriate to package-level processing.
|
||||
|
||||
<p>
|
||||
The programs can also be run as stand-alone binaries, with unmodified arguments,
|
||||
using the go <code>tool</code> subcommand, such as <code>go tool cgo</code>.
|
||||
For most commands this is mainly useful for debugging.
|
||||
Some of the commands, such as <code>pprof</code>, are accessible only through
|
||||
using the go <code>tool</code> subcommand, such as <code>go tool vet</code>.
|
||||
This style of invocation allows, for instance, checking a single source file
|
||||
rather than an entire package: <code>go tool vet myprogram.go</code> as
|
||||
compared to <code>go vet mypackage</code>.
|
||||
Some of the commands, such as <code>yacc</code>, are accessible only through
|
||||
the go <code>tool</code> subcommand.
|
||||
</p>
|
||||
|
||||
@@ -49,6 +51,7 @@ The <code>go</code> program manages Go source code and runs the other
|
||||
commands listed here.
|
||||
See the command docs for usage
|
||||
details.
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -59,7 +62,7 @@ details.
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/cover/">cover</a></td>
|
||||
<td><a href="//godoc.org/golang.org/x/tools/cmd/cover/">cover</a></td>
|
||||
<td> </td>
|
||||
<td>Cover is a program for creating and analyzing the coverage profiles
|
||||
generated by <code>"go test -coverprofile"</code>.</td>
|
||||
@@ -73,7 +76,7 @@ and rewrites them to use newer ones.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/gofmt/">fmt</a></td>
|
||||
<td><a href="/cmd/go/">fmt</a></td>
|
||||
<td> </td>
|
||||
<td>Fmt formats Go packages, it is also available as an independent <a href="/cmd/gofmt/">
|
||||
gofmt</a> command with more general options.</td>
|
||||
@@ -92,6 +95,12 @@ gofmt</a> command with more general options.</td>
|
||||
calls whose arguments do not align with the format string.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/yacc/">yacc</a></td>
|
||||
<td> </td>
|
||||
<td>Yacc is a version of yacc that generates parsers implemented in Go.</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<p>
|
||||
|
||||
662
doc/code.html
Normal file
662
doc/code.html
Normal file
@@ -0,0 +1,662 @@
|
||||
<!--{
|
||||
"Title": "How to Write Go Code"
|
||||
}-->
|
||||
|
||||
<h2 id="Introduction">Introduction</h2>
|
||||
|
||||
<p>
|
||||
This document demonstrates the development of a simple Go package and
|
||||
introduces the <a href="/cmd/go/">go tool</a>, the standard way to fetch,
|
||||
build, and install Go packages and commands.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>go</code> tool requires you to organize your code in a specific
|
||||
way. Please read this document carefully.
|
||||
It explains the simplest way to get up and running with your Go installation.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A similar explanation is available as a
|
||||
<a href="//www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="Organization">Code organization</h2>
|
||||
|
||||
<h3 id="Overview">Overview</h3>
|
||||
|
||||
<ul>
|
||||
<li>Go programmers typically keep all their Go code in a single <i>workspace</i>.</li>
|
||||
<li>A workspace contains many version control <i>repositories</i>
|
||||
(managed by Git, for example).</li>
|
||||
<li>Each repository contains one or more <i>packages</i>.</li>
|
||||
<li>Each package consists of one or more Go source files in a single directory.</li>
|
||||
<li>The path to a package's directory determines its <i>import path</i>.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Note that this differs from other programming environments in which every
|
||||
project has a separate workspace and workspaces are closely tied to version
|
||||
control repositories.
|
||||
</p>
|
||||
|
||||
<h3 id="Workspaces">Workspaces</h3>
|
||||
|
||||
<p>
|
||||
A workspace is a directory hierarchy with three directories at its root:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><code>src</code> contains Go source files,
|
||||
<li><code>pkg</code> contains package objects, and
|
||||
<li><code>bin</code> contains executable commands.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The <code>go</code> tool builds source packages and installs the resulting
|
||||
binaries to the <code>pkg</code> and <code>bin</code> directories.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>src</code> subdirectory typically contains multiple version control
|
||||
repositories (such as for Git or Mercurial) that track the development of one
|
||||
or more source packages.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To give you an idea of how a workspace looks in practice, here's an example:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
bin/
|
||||
hello # command executable
|
||||
outyet # command executable
|
||||
pkg/
|
||||
linux_amd64/
|
||||
github.com/golang/example/
|
||||
stringutil.a # package object
|
||||
src/
|
||||
<a href="https://github.com/golang/example/">github.com/golang/example/</a>
|
||||
.git/ # Git repository metadata
|
||||
hello/
|
||||
hello.go # command source
|
||||
outyet/
|
||||
main.go # command source
|
||||
main_test.go # test source
|
||||
stringutil/
|
||||
reverse.go # package source
|
||||
reverse_test.go # test source
|
||||
<a href="https://golang.org/x/image/">golang.org/x/image/</a>
|
||||
.git/ # Git repository metadata
|
||||
bmp/
|
||||
reader.go # package source
|
||||
writer.go # package source
|
||||
... (many more repositories and packages omitted) ...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The tree above shows a workspace containing two repositories
|
||||
(<code>example</code> and <code>image</code>).
|
||||
The <code>example</code> repository contains two commands (<code>hello</code>
|
||||
and <code>outyet</code>) and one library (<code>stringutil</code>).
|
||||
The <code>image</code> repository contains the <code>bmp</code> package
|
||||
and <a href="https://godoc.org/golang.org/x/image">several others</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A typical workspace contains 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>
|
||||
Commands and libraries are built from different kinds of source packages.
|
||||
We will discuss the distinction <a href="#PackageNames">later</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="GOPATH">The <code>GOPATH</code> environment variable</h3>
|
||||
|
||||
<p>
|
||||
The <code>GOPATH</code> environment variable specifies the location of your
|
||||
workspace. It is likely the only environment variable you'll need to set
|
||||
when developing Go code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To get started, create a workspace directory and set <code>GOPATH</code>
|
||||
accordingly. Your workspace can be located wherever you like, but we'll use
|
||||
<code>$HOME/work</code> in this document. Note that this must <b>not</b> be the
|
||||
same path as your Go installation.
|
||||
(Another common setup is to set <code>GOPATH=$HOME</code>.)
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>mkdir $HOME/work</b>
|
||||
$ <b>export GOPATH=$HOME/work</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
For convenience, add the workspace's <code>bin</code> subdirectory
|
||||
to your <code>PATH</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>export PATH=$PATH:$GOPATH/bin</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
To learn more about setting up the <code>GOPATH</code> environment variable,
|
||||
please see
|
||||
<a href="/cmd/go/#hdr-GOPATH_environment_variable"><code>go help gopath</code></a>
|
||||
</p>
|
||||
|
||||
<h3 id="ImportPaths">Import paths</h3>
|
||||
|
||||
<p>
|
||||
An <i>import path</i> is a string that uniquely identifies a package.
|
||||
A package's import path corresponds to its location inside a workspace
|
||||
or in a remote repository (explained below).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The packages from the standard library are given short import paths such as
|
||||
<code>"fmt"</code> and <code>"net/http"</code>.
|
||||
For your own packages, you must choose a base path that is unlikely to
|
||||
collide with future additions to the standard library or other external
|
||||
libraries.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you keep your code in a source repository somewhere, then you should use the
|
||||
root of that source repository as your base path.
|
||||
For instance, if you have a <a href="https://github.com/">GitHub</a> account at
|
||||
<code>github.com/user</code>, that should be your base path.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that you don't need to publish your code to a remote repository before you
|
||||
can build it. It's just a good habit to organize your code as if you will
|
||||
publish it someday. In practice you can choose any arbitrary path name,
|
||||
as long as it is unique to the standard library and greater Go ecosystem.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
We'll use <code>github.com/user</code> as our base path. Create a directory
|
||||
inside your workspace in which to keep source code:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>mkdir -p $GOPATH/src/github.com/user</b>
|
||||
</pre>
|
||||
|
||||
|
||||
<h3 id="Command">Your first program</h3>
|
||||
|
||||
<p>
|
||||
To compile and run a simple program, first choose a package path (we'll use
|
||||
<code>github.com/user/hello</code>) and create a corresponding package directory
|
||||
inside your workspace:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>mkdir $GOPATH/src/github.com/user/hello</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Next, create a file named <code>hello.go</code> inside that directory,
|
||||
containing the following Go code.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("Hello, world.\n")
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Now you can build and install that program with the <code>go</code> tool:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go install github.com/user/hello</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Note that you can run this command from anywhere on your system. The
|
||||
<code>go</code> tool finds the source code by looking for the
|
||||
<code>github.com/user/hello</code> package inside the workspace specified by
|
||||
<code>GOPATH</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You can also omit the package path if you run <code>go install</code> from the
|
||||
package directory:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>cd $GOPATH/src/github.com/user/hello</b>
|
||||
$ <b>go install</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
This command builds the <code>hello</code> command, producing an executable
|
||||
binary. It then installs that binary to the workspace's <code>bin</code>
|
||||
directory as <code>hello</code> (or, under Windows, <code>hello.exe</code>).
|
||||
In our example, that will be <code>$GOPATH/bin/hello</code>, which is
|
||||
<code>$HOME/work/bin/hello</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>go</code> tool will only print output when an error occurs, so if
|
||||
these commands produce no output they have executed successfully.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You can now run the program by typing its full path at the command line:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>$GOPATH/bin/hello</b>
|
||||
Hello, world.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Or, as you have added <code>$GOPATH/bin</code> to your <code>PATH</code>,
|
||||
just type the binary name:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>hello</b>
|
||||
Hello, world.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If you're using a source control system, now would be a good time to initialize
|
||||
a repository, add the files, and commit your first change. Again, this step is
|
||||
optional: you do not need to use source control to write Go code.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>cd $GOPATH/src/github.com/user/hello</b>
|
||||
$ <b>git init</b>
|
||||
Initialized empty Git repository in /home/user/work/src/github.com/user/hello/.git/
|
||||
$ <b>git add hello.go</b>
|
||||
$ <b>git commit -m "initial commit"</b>
|
||||
[master (root-commit) 0b4507d] initial commit
|
||||
1 file changed, 1 insertion(+)
|
||||
create mode 100644 hello.go
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Pushing the code to a remote repository is left as an exercise for the reader.
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="Library">Your first library</h3>
|
||||
|
||||
<p>
|
||||
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
|
||||
<code>github.com/user/stringutil</code>) and create the package directory:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>mkdir $GOPATH/src/github.com/user/stringutil</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Next, create a file named <code>reverse.go</code> in that directory with the
|
||||
following contents.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// Package stringutil contains utility functions for working with strings.
|
||||
package stringutil
|
||||
|
||||
// Reverse returns its argument string reversed rune-wise left to right.
|
||||
func Reverse(s string) string {
|
||||
r := []rune(s)
|
||||
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
|
||||
r[i], r[j] = r[j], r[i]
|
||||
}
|
||||
return string(r)
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Now, test that the package compiles with <code>go build</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go build github.com/user/stringutil</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Or, if you are working in the package's source directory, just:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go build</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
This won't produce an output file. To do that, you must use <code>go
|
||||
install</code>, which places the package object inside the <code>pkg</code>
|
||||
directory of the workspace.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
After confirming that the <code>stringutil</code> package builds,
|
||||
modify your original <code>hello.go</code> (which is in
|
||||
<code>$GOPATH/src/github.com/user/hello</code>) to use it:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
<b>"github.com/user/stringutil"</b>
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Printf(stringutil.Reverse("!oG ,olleH"))
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
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> program
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go install github.com/user/hello</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
the <code>stringutil</code> package will be installed as well, automatically.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Running the new version of the program, you should see a new, reversed message:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>hello</b>
|
||||
Hello, Go!
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
After the steps above, your workspace should look like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
bin/
|
||||
hello # command executable
|
||||
pkg/
|
||||
linux_amd64/ # this will reflect your OS and architecture
|
||||
github.com/user/
|
||||
stringutil.a # package object
|
||||
src/
|
||||
github.com/user/
|
||||
hello/
|
||||
hello.go # command source
|
||||
stringutil/
|
||||
reverse.go # package source
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Note that <code>go install</code> placed the <code>stringutil.a</code> object
|
||||
in a directory inside <code>pkg/linux_amd64</code> that mirrors its source
|
||||
directory.
|
||||
This is so that future invocations of the <code>go</code> tool can find the
|
||||
package object and avoid recompiling the package unnecessarily.
|
||||
The <code>linux_amd64</code> part is there to aid in cross-compilation,
|
||||
and will reflect the operating system and architecture of your system.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go command executables are statically linked; the package objects need not
|
||||
be present to run Go programs.
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="PackageNames">Package names</h3>
|
||||
|
||||
<p>
|
||||
The first statement in a Go source file must be
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
package <i>name</i>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
where <code><i>name</i></code> is the package's default name for imports.
|
||||
(All files in a package must use the same <code><i>name</i></code>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go's convention is that the package name is the last element of the
|
||||
import path: the package imported as "<code>crypto/rot13</code>"
|
||||
should be named <code>rot13</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Executable commands must always use <code>package main</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There is no requirement that package names be unique
|
||||
across all packages linked into a single binary,
|
||||
only that the import paths (their full file names) be unique.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
See <a href="/doc/effective_go.html#names">Effective Go</a> to learn more about
|
||||
Go's naming conventions.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="Testing">Testing</h2>
|
||||
|
||||
<p>
|
||||
Go has a lightweight test framework composed of the <code>go test</code>
|
||||
command and the <code>testing</code> package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You write a test by creating a file with a name ending in <code>_test.go</code>
|
||||
that contains functions named <code>TestXXX</code> with signature
|
||||
<code>func (t *testing.T)</code>.
|
||||
The test framework runs each such function;
|
||||
if the function calls a failure function such as <code>t.Error</code> or
|
||||
<code>t.Fail</code>, the test is considered to have failed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Add a test to the <code>stringutil</code> package by creating the file
|
||||
<code>$GOPATH/src/github.com/user/stringutil/reverse_test.go</code> containing
|
||||
the following Go code.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
package stringutil
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestReverse(t *testing.T) {
|
||||
cases := []struct {
|
||||
in, want string
|
||||
}{
|
||||
{"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>
|
||||
|
||||
<p>
|
||||
Then run the test with <code>go test</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go test github.com/user/stringutil</b>
|
||||
ok github.com/user/stringutil 0.165s
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
As always, if you are running the <code>go</code> tool from the package
|
||||
directory, you can omit the package path:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go test</b>
|
||||
ok github.com/user/stringutil 0.165s
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Run <code><a href="/cmd/go/#hdr-Test_packages">go help test</a></code> and see the
|
||||
<a href="/pkg/testing/">testing package documentation</a> for more detail.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="remote">Remote packages</h2>
|
||||
|
||||
<p>
|
||||
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
|
||||
this property to automatically fetch packages from remote repositories.
|
||||
For instance, the examples described in this document are also kept in a
|
||||
Git repository hosted at GitHub
|
||||
<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,
|
||||
<code>go get</code> will fetch, build, and install it automatically:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go get github.com/golang/example/hello</b>
|
||||
$ <b>$GOPATH/bin/hello</b>
|
||||
Hello, Go examples!
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If the specified package is not present in a workspace, <code>go get</code>
|
||||
will place it inside the first workspace specified by <code>GOPATH</code>.
|
||||
(If the package does already exist, <code>go get</code> skips the remote
|
||||
fetch and behaves the same as <code>go install</code>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
After issuing the above <code>go get</code> command, the workspace directory
|
||||
tree should now look like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
bin/
|
||||
hello # command executable
|
||||
pkg/
|
||||
linux_amd64/
|
||||
github.com/golang/example/
|
||||
stringutil.a # package object
|
||||
github.com/user/
|
||||
stringutil.a # package object
|
||||
src/
|
||||
github.com/golang/example/
|
||||
.git/ # Git repository metadata
|
||||
hello/
|
||||
hello.go # command source
|
||||
stringutil/
|
||||
reverse.go # package source
|
||||
reverse_test.go # test source
|
||||
github.com/user/
|
||||
hello/
|
||||
hello.go # command source
|
||||
stringutil/
|
||||
reverse.go # package source
|
||||
reverse_test.go # test source
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The <code>hello</code> command hosted at GitHub depends on the
|
||||
<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 get</code> command is able to locate and install the dependent
|
||||
package, too.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
import "github.com/golang/example/stringutil"
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
This convention is the easiest way to make your Go packages available for
|
||||
others to use.
|
||||
The <a href="//golang.org/wiki/Projects">Go Wiki</a>
|
||||
and <a href="//godoc.org/">godoc.org</a>
|
||||
provide lists of external Go projects.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For more information on using remote repositories with the <code>go</code> tool, see
|
||||
<code><a href="/cmd/go/#hdr-Remote_import_paths">go help importpath</a></code>.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="next">What's next</h2>
|
||||
|
||||
<p>
|
||||
Subscribe to the
|
||||
<a href="//groups.google.com/group/golang-announce">golang-announce</a>
|
||||
mailing list to be notified when a new stable version of Go is released.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
See <a href="/doc/effective_go.html">Effective Go</a> for tips on writing
|
||||
clear, idiomatic Go code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Take <a href="//tour.golang.org/">A Tour of Go</a> to learn the language
|
||||
proper.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Visit the <a href="/doc/#articles">documentation page</a> for a set of in-depth
|
||||
articles about the Go language and its libraries and tools.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="help">Getting help</h2>
|
||||
|
||||
<p>
|
||||
For real-time help, ask the helpful gophers in <code>#go-nuts</code> on the
|
||||
<a href="http://freenode.net/">Freenode</a> IRC server.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The official mailing list for discussion of the Go language is
|
||||
<a href="//groups.google.com/group/golang-nuts">Go Nuts</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Report bugs using the
|
||||
<a href="//golang.org/issue">Go issue tracker</a>.
|
||||
</p>
|
||||
@@ -276,7 +276,7 @@ CodewalkViewer.prototype.changeSelectedComment = function(target) {
|
||||
}
|
||||
|
||||
// Force original file even if user hasn't changed comments since they may
|
||||
// have navigated away from it within the iframe without us knowing.
|
||||
// have nagivated away from it within the iframe without us knowing.
|
||||
this.navigateToCode(currentFile);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestMarkov tests the code dependency of markov.xml.
|
||||
func TestMarkov(t *testing.T) {
|
||||
cmd := exec.Command("go", "run", "markov.go")
|
||||
cmd.Stdin = strings.NewReader("foo")
|
||||
cmd.Stderr = bytes.NewBuffer(nil)
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, cmd.Stderr)
|
||||
}
|
||||
|
||||
if !bytes.Equal(out, []byte("foo\n")) {
|
||||
t.Fatalf(`%s with input "foo" did not output "foo":\n%s`, strings.Join(cmd.Args, " "), out)
|
||||
}
|
||||
}
|
||||
|
||||
// TestPig tests the code dependency of functions.xml.
|
||||
func TestPig(t *testing.T) {
|
||||
cmd := exec.Command("go", "run", "pig.go")
|
||||
cmd.Stderr = bytes.NewBuffer(nil)
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, cmd.Stderr)
|
||||
}
|
||||
|
||||
const want = "Wins, losses staying at k = 100: 210/990 (21.2%), 780/990 (78.8%)\n"
|
||||
if !bytes.Contains(out, []byte(want)) {
|
||||
t.Fatalf(`%s: unexpected output\ngot:\n%s\nwant output containing:\n%s`, strings.Join(cmd.Args, " "), out, want)
|
||||
}
|
||||
}
|
||||
|
||||
// TestURLPoll tests the code dependency of sharemem.xml.
|
||||
func TestURLPoll(t *testing.T) {
|
||||
cmd := exec.Command("go", "build", "-o", os.DevNull, "urlpoll.go")
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, out)
|
||||
}
|
||||
}
|
||||
21
doc/codewalk/run
Executable file
21
doc/codewalk/run
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2013 The Go Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
set -e
|
||||
|
||||
function fail {
|
||||
echo FAIL: doc/codewalk/$1
|
||||
exit 1
|
||||
}
|
||||
|
||||
# markov.xml
|
||||
echo foo | go run markov.go | grep foo > /dev/null || fail markov
|
||||
|
||||
# functions.xml
|
||||
go run pig.go | grep 'Wins, losses staying at k = 100: 210/990 (21.2%), 780/990 (78.8%)' > /dev/null || fail pig
|
||||
|
||||
# sharemem.xml: only build the example, as it uses the network
|
||||
go build urlpoll.go || fail urlpoll
|
||||
rm -f urlpoll
|
||||
273
doc/conduct.html
Normal file
273
doc/conduct.html
Normal file
@@ -0,0 +1,273 @@
|
||||
<!--{
|
||||
"Title": "Go Community Code of Conduct",
|
||||
"Path": "/conduct",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<style>
|
||||
ul {
|
||||
max-width: 800px;
|
||||
}
|
||||
ul ul {
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h2 id="about">About the Code of Conduct</h2>
|
||||
|
||||
<h3 id="why">Why have a Code of Conduct?</h3>
|
||||
|
||||
<p>
|
||||
Online communities include people from many different backgrounds.
|
||||
The Go contributors are committed to providing a friendly, safe and welcoming
|
||||
environment for all, regardless of age, disability, gender, nationality, race,
|
||||
religion, sexuality, or similar personal characteristic.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The first goal of the Code of Conduct is to specify a baseline standard
|
||||
of behavior so that people with different social values and communication
|
||||
styles can talk about Go effectively, productively, and respectfully.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The second goal is to provide a mechanism for resolving conflicts in the
|
||||
community when they arise.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The third goal of the Code of Conduct is to make our community welcoming to
|
||||
people from different backgrounds.
|
||||
Diversity is critical to the project; for Go to be successful, it needs
|
||||
contributors and users from all backgrounds.
|
||||
(See <a href="https://blog.golang.org/open-source">Go, Open Source, Community</a>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
With that said, a healthy community must allow for disagreement and debate.
|
||||
The Code of Conduct is not a mechanism for people to silence others with whom
|
||||
they disagree.
|
||||
</p>
|
||||
|
||||
<h3 id="spaces">Where does the Code of Conduct apply?</h3>
|
||||
|
||||
<p>
|
||||
If you participate in or contribute to the Go ecosystem in any way,
|
||||
you are encouraged to follow the Code of Conduct while doing so.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Explicit enforcement of the Code of Conduct applies to the
|
||||
official forums operated by the Go project (“Go spaces”):
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>The official <a href="https://github.com/golang/">GitHub projects</a>
|
||||
and <a href="https://go-review.googlesource.com/">code reviews</a>.
|
||||
<li>The <a href="https://groups.google.com/group/golang-nuts">golang-nuts</a> and
|
||||
<a href="https://groups.google.com/group/golang-dev">golang-dev</a> mailing lists.
|
||||
<li>The #go-nuts IRC channel on Freenode.
|
||||
<li>The <a href="https://reddit.com/r/golang">/r/golang subreddit</a>.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Other Go groups (such as conferences, meetups, and other unofficial forums) are
|
||||
encouraged to adopt this Code of Conduct. Those groups must provide their own
|
||||
moderators and/or working group (see below).
|
||||
</p>
|
||||
|
||||
<h2 id="values">Gopher values</h2>
|
||||
|
||||
<p>
|
||||
These are the values to which people in the Go community (“Gophers”) should aspire.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Be friendly and welcoming
|
||||
<li>Be patient
|
||||
<ul>
|
||||
<li>Remember that people have varying communication styles and that not
|
||||
everyone is using their native language.
|
||||
(Meaning and tone can be lost in translation.)
|
||||
</ul>
|
||||
<li>Be thoughtful
|
||||
<ul>
|
||||
<li>Productive communication requires effort.
|
||||
Think about how your words will be interpreted.
|
||||
<li>Remember that sometimes it is best to refrain entirely from commenting.
|
||||
</ul>
|
||||
<li>Be respectful
|
||||
<ul>
|
||||
<li>In particular, respect differences of opinion.
|
||||
</ul>
|
||||
<li>Be charitable
|
||||
<ul>
|
||||
<li>Interpret the arguments of others in good faith, do not seek to disagree.
|
||||
<li>When we do disagree, try to understand why.
|
||||
</ul>
|
||||
<li>Avoid destructive behavior:
|
||||
<ul>
|
||||
<li>Derailing: stay on topic; if you want to talk about something else,
|
||||
start a new conversation.
|
||||
<li>Unconstructive criticism: don't merely decry the current state of affairs;
|
||||
offer—or at least solicit—suggestions as to how things may be improved.
|
||||
<li>Snarking (pithy, unproductive, sniping comments)
|
||||
<li>Discussing potentially offensive or sensitive issues;
|
||||
this all too often leads to unnecessary conflict.
|
||||
<li>Microaggressions: brief and commonplace verbal, behavioral and
|
||||
environmental indignities that communicate hostile, derogatory or negative
|
||||
slights and insults to a person or group.
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
People are complicated.
|
||||
You should expect to be misunderstood and to misunderstand others;
|
||||
when this inevitably occurs, resist the urge to be defensive or assign blame.
|
||||
Try not to take offense where no offense was intended.
|
||||
Give people the benefit of the doubt.
|
||||
Even if the intent was to provoke, do not rise to it.
|
||||
It is the responsibility of <i>all parties</i> to de-escalate conflict when it arises.
|
||||
</p>
|
||||
|
||||
<h2 id="unwelcome_behavior">Unwelcome behavior</h2>
|
||||
|
||||
<p>
|
||||
These actions are explicitly forbidden in Go spaces:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Insulting, demeaning, hateful, or threatening remarks.
|
||||
<li>Discrimination based on age, disability, gender, nationality, race,
|
||||
religion, sexuality, or similar personal characteristic.
|
||||
<li>Bullying or systematic harassment.
|
||||
<li>Unwelcome sexual advances.
|
||||
<li>Incitement to any of these.
|
||||
</ul>
|
||||
|
||||
<h2 id="moderation">Moderation</h2>
|
||||
|
||||
<p>
|
||||
The Go spaces are not free speech venues; they are for discussion about Go.
|
||||
These spaces have moderators.
|
||||
The goal of the moderators is to facilitate civil discussion about Go.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When using the official Go spaces you should act in the spirit of the “Gopher
|
||||
values”.
|
||||
If you conduct yourself in a way that is explicitly forbidden by the CoC,
|
||||
you will be warned and asked to stop.
|
||||
If you do not stop, you will be removed from our community spaces temporarily.
|
||||
Repeated, willful breaches of the CoC will result in a permanent ban.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Moderators are held to a higher standard than other community members.
|
||||
If a moderator creates an inappropriate situation, they should expect less
|
||||
leeway than others, and should expect to be removed from their position if they
|
||||
cannot adhere to the CoC.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Complaints about moderator actions must be handled using the reporting process
|
||||
below.
|
||||
</p>
|
||||
|
||||
<h2 id="reporting">Reporting issues</h2>
|
||||
|
||||
<p>
|
||||
The Code of Conduct Working Group is a group of people that represent the Go
|
||||
community. They are responsible for handling conduct-related issues.
|
||||
Their purpose is to de-escalate conflicts and try to resolve issues to the
|
||||
satisfaction of all parties. They are:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Aditya Mukerjee <dev@chimeracoder.net>
|
||||
<li>Andrew Gerrand <adg@golang.org>
|
||||
<li>Dave Cheney <dave@cheney.net>
|
||||
<li>Jason Buberel <jbuberel@google.com>
|
||||
<li>Peggy Li <peggyli.224@gmail.com>
|
||||
<li>Sarah Adams <sadams.codes@gmail.com>
|
||||
<li>Steve Francia <steve.francia@gmail.com>
|
||||
<li>Verónica López <gveronicalg@gmail.com>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
If you encounter a conduct-related issue, you should report it to the
|
||||
Working Group using the process described below.
|
||||
<b>Do not</b> post about the issue publicly or try to rally sentiment against a
|
||||
particular individual or group.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Mail <a href="mailto:conduct@golang.org">conduct@golang.org</a> or
|
||||
<a href="https://golang.org/s/conduct-report">submit an anonymous report</a>.
|
||||
<ul>
|
||||
<li>Your message will reach the Working Group.
|
||||
<li>Reports are confidential within the Working Group.
|
||||
<li>Should you choose to remain anonymous then the Working Group cannot
|
||||
notify you of the outcome of your report.
|
||||
<li>You may contact a member of the group directly if you do not feel
|
||||
comfortable contacting the group as a whole. That member will then raise
|
||||
the issue with the Working Group as a whole, preserving the privacy of the
|
||||
reporter (if desired).
|
||||
<li>If your report concerns a member of the Working Group they will be recused
|
||||
from Working Group discussions of the report.
|
||||
<li>The Working Group will strive to handle reports with discretion and
|
||||
sensitivity, to protect the privacy of the involved parties,
|
||||
and to avoid conflicts of interest.
|
||||
</ul>
|
||||
<li>You should receive a response within 48 hours (likely sooner).
|
||||
(Should you choose to contact a single Working Group member,
|
||||
it may take longer to receive a response.)
|
||||
<li>The Working Group will meet to review the incident and determine what happened.
|
||||
<ul>
|
||||
<li>With the permission of person reporting the incident, the Working Group
|
||||
may reach out to other community members for more context.
|
||||
</ul>
|
||||
<li>The Working Group will reach a decision as to how to act. These may include:
|
||||
<ul>
|
||||
<li>Nothing.
|
||||
<li>A request for a private or public apology.
|
||||
<li>A private or public warning.
|
||||
<li>An imposed vacation (for instance, asking someone to abstain for a week
|
||||
from a mailing list or IRC).
|
||||
<li>A permanent or temporary ban from some or all Go spaces.
|
||||
</ul>
|
||||
<li>The Working Group will reach out to the original reporter to let them know
|
||||
the decision.
|
||||
<li>Appeals to the decision may be made to the Working Group,
|
||||
or to any of its members directly.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<b>Note that the goal of the Code of Conduct and the Working Group is to resolve
|
||||
conflicts in the most harmonious way possible.</b>
|
||||
We hope that in most cases issues may be resolved through polite discussion and
|
||||
mutual agreement.
|
||||
Bannings and other forceful measures are to be employed only as a last resort.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Changes to the Code of Conduct (including to the members of the Working Group)
|
||||
should be proposed using the
|
||||
<a href="https://golang.org/s/proposal-process">change proposal process</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="summary">Summary</h2>
|
||||
|
||||
<ul>
|
||||
<li>Treat everyone with respect and kindness.
|
||||
<li>Be thoughtful in how you communicate.
|
||||
<li>Don’t be destructive or inflammatory.
|
||||
<li>If you encounter an issue, please mail <a href="mailto:conduct@golang.org">conduct@golang.org</a>.
|
||||
</ul>
|
||||
|
||||
<h3 id="acknowledgements">Acknowledgements</h3>
|
||||
|
||||
<p>
|
||||
Parts of this document were derived from the Code of Conduct documents of the
|
||||
Django, FreeBSD, and Rust projects.
|
||||
</p>
|
||||
120
doc/contrib.html
Normal file
120
doc/contrib.html
Normal file
@@ -0,0 +1,120 @@
|
||||
<!--{
|
||||
"Title": "The Go Project",
|
||||
"Path": "/project/"
|
||||
}-->
|
||||
|
||||
<img class="gopher" src="/doc/gopher/project.png" />
|
||||
|
||||
<div id="manual-nav"></div>
|
||||
|
||||
<p>
|
||||
Go is an open source project developed by a team at
|
||||
<a href="//google.com/">Google</a> and many
|
||||
<a href="/CONTRIBUTORS">contributors</a> from the open source community.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go is distributed under a <a href="/LICENSE">BSD-style license</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="announce"><a href="//groups.google.com/group/golang-announce">Announcements Mailing List</a></h3>
|
||||
<p>
|
||||
A low traffic mailing list for important announcements, such as new releases.
|
||||
</p>
|
||||
<p>
|
||||
We encourage all Go users to subscribe to
|
||||
<a href="//groups.google.com/group/golang-announce">golang-announce</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="go1">Version history</h2>
|
||||
|
||||
<h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3>
|
||||
|
||||
<p>A <a href="/doc/devel/release.html">summary</a> of the changes between Go releases. Notes for the major releases:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="/doc/go1.7">Go 1.7</a> <small>(August 2016)</small></li>
|
||||
<li><a href="/doc/go1.6">Go 1.6</a> <small>(February 2016)</small></li>
|
||||
<li><a href="/doc/go1.5">Go 1.5</a> <small>(August 2015)</small></li>
|
||||
<li><a href="/doc/go1.4">Go 1.4</a> <small>(December 2014)</small></li>
|
||||
<li><a href="/doc/go1.3">Go 1.3</a> <small>(June 2014)</small></li>
|
||||
<li><a href="/doc/go1.2">Go 1.2</a> <small>(December 2013)</small></li>
|
||||
<li><a href="/doc/go1.1">Go 1.1</a> <small>(May 2013)</small></li>
|
||||
<li><a href="/doc/go1">Go 1</a> <small>(March 2012)</small></li>
|
||||
</ul>
|
||||
|
||||
<h3 id="go1compat"><a href="/doc/go1compat">Go 1 and the Future of Go Programs</a></h3>
|
||||
<p>
|
||||
What Go 1 defines and the backwards-compatibility guarantees one can expect as
|
||||
Go 1 matures.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="resources">Developer Resources</h2>
|
||||
|
||||
<h3 id="source"><a href="https://golang.org/change">Source Code</a></h3>
|
||||
<p>Check out the Go source code.</p>
|
||||
|
||||
<h3 id="golang-dev"><a href="https://groups.google.com/group/golang-dev">Developer</a> and
|
||||
<a href="https://groups.google.com/group/golang-codereviews">Code Review Mailing List</a></h3>
|
||||
<p>The <a href="https://groups.google.com/group/golang-dev">golang-dev</a>
|
||||
mailing list is for discussing code changes to the Go project.
|
||||
The <a href="https://groups.google.com/group/golang-codereviews">golang-codereviews</a>
|
||||
mailing list is for actual reviewing of the code changes (CLs).</p>
|
||||
|
||||
<p>For general discussion of Go programming, see <a
|
||||
href="https://groups.google.com/group/golang-nuts">golang-nuts</a>.</p>
|
||||
|
||||
<h3 id="golang-checkins"><a href="https://groups.google.com/group/golang-checkins">Checkins Mailing List</a></h3>
|
||||
<p>A mailing list that receives a message summarizing each checkin to the Go repository.</p>
|
||||
|
||||
<h3 id="build_status"><a href="//build.golang.org/">Build Status</a></h3>
|
||||
<p>View the status of Go builds across the supported operating
|
||||
systems and architectures.</p>
|
||||
|
||||
|
||||
<h2 id="howto">How you can help</h2>
|
||||
|
||||
<h3><a href="//golang.org/issue">Reporting issues</a></h3>
|
||||
|
||||
<p>
|
||||
If you spot bugs, mistakes, or inconsistencies in the Go project's code or
|
||||
documentation, please let us know by
|
||||
<a href="//golang.org/issue/new">filing a ticket</a>
|
||||
on our <a href="//golang.org/issue">issue tracker</a>.
|
||||
(Of course, you should check it's not an existing issue before creating
|
||||
a new one.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
We pride ourselves on being meticulous; no issue is too small.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Security-related issues should be reported to
|
||||
<a href="mailto:security@golang.org">security@golang.org</a>.<br>
|
||||
See the <a href="/security">security policy</a> for more details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Community-related issues should be reported to
|
||||
<a href="mailto:conduct@golang.org">conduct@golang.org</a>.<br>
|
||||
See the <a href="/conduct">Code of Conduct</a> for more details.
|
||||
</p>
|
||||
|
||||
<h3><a href="/doc/contribute.html">Contributing code</a></h3>
|
||||
|
||||
<p>
|
||||
Go is an open source project and we welcome contributions from the community.
|
||||
</p>
|
||||
<p>
|
||||
To get started, read these <a href="/doc/contribute.html">contribution
|
||||
guidelines</a> for information on design, testing, and our code review process.
|
||||
</p>
|
||||
<p>
|
||||
Check <a href="//golang.org/issue">the tracker</a> for
|
||||
open issues that interest you. Those labeled
|
||||
<a href="https://github.com/golang/go/issues?q=is%3Aopen+is%3Aissue+label%3Ahelpwanted">helpwanted</a>
|
||||
are particularly in need of outside help.
|
||||
</p>
|
||||
1734
doc/contribute.html
1734
doc/contribute.html
File diff suppressed because it is too large
Load Diff
@@ -3,84 +3,50 @@
|
||||
"Path": "/doc/gdb"
|
||||
}-->
|
||||
|
||||
<!--
|
||||
NOTE: In this document and others in this directory, the convention is to
|
||||
set fixed-width phrases with non-fixed-width spaces, as in
|
||||
<code>hello</code> <code>world</code>.
|
||||
Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
|
||||
<i>
|
||||
<p>
|
||||
The following instructions apply to the standard toolchain
|
||||
(the <code>gc</code> Go compiler and tools).
|
||||
Gccgo has native gdb support.
|
||||
</p>
|
||||
<p>
|
||||
Note that
|
||||
<a href="https://github.com/go-delve/delve">Delve</a> is a better
|
||||
alternative to GDB when debugging Go programs built with the standard
|
||||
toolchain. It understands the Go runtime, data structures, and
|
||||
expressions better than GDB. Delve currently supports Linux, OSX,
|
||||
and Windows on <code>amd64</code>.
|
||||
For the most up-to-date list of supported platforms, please see
|
||||
<a href="https://github.com/go-delve/delve/tree/master/Documentation/installation">
|
||||
the Delve documentation</a>.
|
||||
</p>
|
||||
</i>
|
||||
<p><i>
|
||||
This applies to the <code>gc</code> toolchain. Gccgo has native gdb support.
|
||||
Besides this overview you might want to consult the
|
||||
<a href="http://sourceware.org/gdb/current/onlinedocs/gdb/">GDB manual</a>.
|
||||
</i></p>
|
||||
|
||||
<p>
|
||||
GDB does not understand Go programs well.
|
||||
The stack management, threading, and runtime contain aspects that differ
|
||||
enough from the execution model GDB expects that they can confuse
|
||||
the debugger and cause incorrect results even when the program is
|
||||
compiled with gccgo.
|
||||
As a consequence, although GDB can be useful in some situations (e.g.,
|
||||
debugging Cgo code, or debugging the runtime itself), it is not
|
||||
a reliable debugger for Go programs, particularly heavily concurrent
|
||||
ones. Moreover, it is not a priority for the Go project to address
|
||||
these issues, which are difficult.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
the debugger, even when the program is compiled with gccgo.
|
||||
As a consequence, although GDB can be useful in some situations, it is
|
||||
not a reliable debugger for Go programs, particularly heavily concurrent ones.
|
||||
Moreover, it is not a priority for the Go project to address these issues, which
|
||||
are difficult.
|
||||
In short, the instructions below should be taken only as a guide to how
|
||||
to use GDB when it works, not as a guarantee of success.
|
||||
|
||||
Besides this overview you might want to consult the
|
||||
<a href="https://sourceware.org/gdb/current/onlinedocs/gdb/">GDB manual</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In time, a more Go-centric debugging architecture may be required.
|
||||
</p>
|
||||
|
||||
<h2 id="Introduction">Introduction</h2>
|
||||
|
||||
<p>
|
||||
When you compile and link your Go programs with the <code>gc</code> toolchain
|
||||
on Linux, macOS, FreeBSD or NetBSD, the resulting binaries contain DWARFv4
|
||||
debugging information that recent versions (≥7.5) of the GDB debugger can
|
||||
on Linux, Mac OS X, FreeBSD or NetBSD, the resulting binaries contain DWARFv3
|
||||
debugging information that recent versions (>7.1) of the GDB debugger can
|
||||
use to inspect a live process or a core dump.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Pass the <code>'-w'</code> flag to the linker to omit the debug information
|
||||
(for example, <code>go</code> <code>build</code> <code>-ldflags=-w</code> <code>prog.go</code>).
|
||||
(for example, <code>go build -ldflags "-w" prog.go</code>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The code generated by the <code>gc</code> compiler includes inlining of
|
||||
function invocations and registerization of variables. These optimizations
|
||||
can sometimes make debugging with <code>gdb</code> harder.
|
||||
If you find that you need to disable these optimizations,
|
||||
build your program using <code>go</code> <code>build</code> <code>-gcflags=all="-N -l"</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you want to use gdb to inspect a core dump, you can trigger a dump
|
||||
on a program crash, on systems that permit it, by setting
|
||||
<code>GOTRACEBACK=crash</code> in the environment (see the
|
||||
<a href="/pkg/runtime/#hdr-Environment_Variables"> runtime package
|
||||
documentation</a> for more info).
|
||||
can sometimes make debugging with <code>gdb</code> harder. To disable them
|
||||
when debugging, pass the flags <code>-gcflags "-N -l"</code> to the
|
||||
<a href="/cmd/go"><code>go</code></a> command used to build the code being
|
||||
debugged.
|
||||
</p>
|
||||
|
||||
<h3 id="Common_Operations">Common Operations</h3>
|
||||
@@ -119,7 +85,7 @@ Show the name, type and location of global variables:
|
||||
|
||||
<p>
|
||||
A recent extension mechanism to GDB allows it to load extension scripts for a
|
||||
given binary. The toolchain uses this to extend GDB with a handful of
|
||||
given binary. The tool chain uses this to extend GDB with a handful of
|
||||
commands to inspect internals of the runtime code (such as goroutines) and to
|
||||
pretty print the built-in map, slice and channel types.
|
||||
</p>
|
||||
@@ -149,9 +115,6 @@ Inspecting goroutines:
|
||||
(gdb) <b>help goroutine</b></pre>
|
||||
For example:
|
||||
<pre>(gdb) <b>goroutine 12 bt</b></pre>
|
||||
You can inspect all goroutines by passing <code>all</code> instead of a specific goroutine's ID.
|
||||
For example:
|
||||
<pre>(gdb) <b>goroutine all bt</b></pre>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -167,7 +130,7 @@ the DWARF code.
|
||||
|
||||
<p>
|
||||
If you're interested in what the debugging information looks like, run
|
||||
<code>objdump</code> <code>-W</code> <code>a.out</code> and browse through the <code>.debug_*</code>
|
||||
'<code>objdump -W 6.out</code>' and browse through the <code>.debug_*</code>
|
||||
sections.
|
||||
</p>
|
||||
|
||||
@@ -182,15 +145,7 @@ from it.</li>
|
||||
<code>"fmt.Print"</code> as an unstructured literal with a <code>"."</code>
|
||||
that needs to be quoted. It objects even more strongly to method names of
|
||||
the form <code>pkg.(*MyType).Meth</code>.
|
||||
<li>As of Go 1.11, debug information is compressed by default.
|
||||
Older versions of gdb, such as the one available by default on MacOS,
|
||||
do not understand the compression.
|
||||
You can generate uncompressed debug information by using <code>go
|
||||
build -ldflags=-compressdwarf=false</code>.
|
||||
(For convenience you can put the <code>-ldflags</code> option in
|
||||
the <a href="/cmd/go/#hdr-Environment_variables"><code>GOFLAGS</code>
|
||||
environment variable</a> so that you don't have to specify it each time.)
|
||||
</li>
|
||||
<li>All global variables are lumped into package <code>"main"</code>.</li>
|
||||
</ol>
|
||||
|
||||
<h2 id="Tutorial">Tutorial</h2>
|
||||
@@ -198,7 +153,7 @@ environment variable</a> so that you don't have to specify it each time.)
|
||||
<p>
|
||||
In this tutorial we will inspect the binary of the
|
||||
<a href="/pkg/regexp/">regexp</a> package's unit tests. To build the binary,
|
||||
change to <code>$GOROOT/src/regexp</code> and run <code>go</code> <code>test</code> <code>-c</code>.
|
||||
change to <code>$GOROOT/src/regexp</code> and run <code>go test -c</code>.
|
||||
This should produce an executable file named <code>regexp.test</code>.
|
||||
</p>
|
||||
|
||||
@@ -224,7 +179,7 @@ Loading Go Runtime support.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The message "Loading Go Runtime support" means that GDB loaded the
|
||||
The message <code>"Loading Go Runtime support"</code> means that GDB loaded the
|
||||
extension from <code>$GOROOT/src/runtime/runtime-gdb.py</code>.
|
||||
</p>
|
||||
|
||||
@@ -259,7 +214,7 @@ Use the <code>"l"</code> or <code>"list"</code> command to inspect source code.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
List a specific part of the source parameterizing <code>"list"</code> with a
|
||||
List a specific part of the source parametrizing <code>"list"</code> with a
|
||||
function name (it must be qualified with its package name).
|
||||
</p>
|
||||
|
||||
@@ -389,7 +344,7 @@ Stack level 0, frame at 0x7ffff7f9ff88:
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The command <code>info</code> <code>locals</code> lists all variables local to the function and their values, but is a bit
|
||||
The command <code>info locals</code> lists all variables local to the function and their values, but is a bit
|
||||
dangerous to use, since it will also try to print uninitialized variables. Uninitialized slices may cause gdb to try
|
||||
to print arbitrary large arrays.
|
||||
</p>
|
||||
@@ -422,9 +377,7 @@ $3 = struct hchan<*testing.T>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
That <code>struct</code> <code>hchan<*testing.T></code> is the
|
||||
runtime-internal representation of a channel. It is currently empty,
|
||||
or gdb would have pretty-printed its contents.
|
||||
That <code>struct hchan<*testing.T></code> is the runtime-internal representation of a channel. It is currently empty, or gdb would have pretty-printed it's contents.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
455
doc/devel/pre_go1.html
Normal file
455
doc/devel/pre_go1.html
Normal file
@@ -0,0 +1,455 @@
|
||||
<!--{
|
||||
"Title": "Pre-Go 1 Release History"
|
||||
}-->
|
||||
|
||||
<p>
|
||||
This page summarizes the changes between stable releases of Go prior to Go 1.
|
||||
See the <a href="release.html">Release History</a> page for notes on recent releases.
|
||||
</p>
|
||||
|
||||
<h2 id="r60">r60 (released 2011/09/07)</h2>
|
||||
|
||||
<p>
|
||||
The r60 release corresponds to
|
||||
<code><a href="weekly.html#2011-08-17">weekly.2011-08-17</a></code>.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-08-17">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="//code.google.com/p/go/source/list?r=release-branch.r60">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
An "else" block is now required to have braces except if the body of the "else"
|
||||
is another "if". Since gofmt always puts those braces in anyway,
|
||||
gofmt-formatted programs will not be affected.
|
||||
To fix other programs, run gofmt.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http/">Package http</a>'s URL parsing and query escaping code
|
||||
(such as <code>ParseURL</code> and <code>URLEscape</code>) has been moved to
|
||||
the new <a href="/pkg/url/">url package</a>, with several simplifications to
|
||||
the names. Client code can be updated automatically with gofix.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/image/">Package image</a> has had significant changes made to the
|
||||
<code>Pix</code> field of struct types such as
|
||||
<a href="/pkg/image/#RGBA">image.RGBA</a> and
|
||||
<a href="/pkg/image/#NRGBA">image.NRGBA</a>.
|
||||
The <a href="/pkg/image/#Image">image.Image</a> interface type has not changed,
|
||||
though, and you should not need to change your code if you don't explicitly
|
||||
refer to <code>Pix</code> fields. For example, if you decode a number of images
|
||||
using the <a href="/pkg/image/jpeg/">image/jpeg</a> package, compose them using
|
||||
<a href="/pkg/image/draw/">image/draw</a>, and then encode the result using
|
||||
<a href="/pkg/img/png">image/png</a>, then your code should still work as
|
||||
before.
|
||||
If your code <i>does</i> refer to <code>Pix</code> fields see the
|
||||
<a href="/doc/devel/weekly.html#2011-07-19">weekly.2011-07-19</a>
|
||||
snapshot notes for how to update your code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/template/">Package template</a> has been replaced with a new
|
||||
templating package (formerly <code>exp/template</code>). The original template
|
||||
package is still available as <a href="/pkg/old/template/">old/template</a>.
|
||||
The <code>old/template</code> package is deprecated and will be removed.
|
||||
The Go tree has been updated to use the new template package. We encourage
|
||||
users of the old template package to switch to the new one. Code that uses
|
||||
<code>template</code> or <code>exp/template</code> will need to change its
|
||||
import lines to <code>"old/template"</code> or <code>"template"</code>,
|
||||
respectively.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.cmd">Tools</h3>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/goinstall/">Goinstall</a> now uses a new tag selection scheme.
|
||||
When downloading or updating, goinstall looks for a tag or branch with the
|
||||
<code>"go."</code> prefix that corresponds to the local Go version. For Go
|
||||
<code>release.r58</code> it looks for <code>go.r58</code>. For
|
||||
<code>weekly.2011-06-03</code> it looks for <code>go.weekly.2011-06-03</code>.
|
||||
If the specific <code>go.X</code> tag or branch is not found, it chooses the
|
||||
closest earlier version. If an appropriate tag or branch is found, goinstall
|
||||
uses that version of the code. Otherwise it uses the default version selected
|
||||
by the version control system. Library authors are encouraged to use the
|
||||
appropriate tag or branch names in their repositories to make their libraries
|
||||
more accessible.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
r60.1 includes a
|
||||
<a href="//golang.org/change/1824581bf62d">linker
|
||||
fix</a>, a pair of
|
||||
<a href="//golang.org/change/9ef4429c2c64">goplay</a>
|
||||
<a href="//golang.org/change/d42ed8c3098e">fixes</a>,
|
||||
and a <code>json</code> package
|
||||
<a href="//golang.org/change/d5e97874fe84">fix</a> and
|
||||
a new
|
||||
<a href="//golang.org/change/4f0e6269213f">struct tag
|
||||
option</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
r60.2
|
||||
<a href="//golang.org/change/ff19536042ac">fixes</a>
|
||||
a memory leak involving maps.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
r60.3 fixes a
|
||||
<a href="//golang.org/change/01fa62f5e4e5">reflect bug</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="r59">r59 (released 2011/08/01)</h2>
|
||||
|
||||
<p>
|
||||
The r59 release corresponds to
|
||||
<code><a href="weekly.html#2011-07-07">weekly.2011-07-07</a></code>.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-07-07">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="//code.google.com/p/go/source/list?r=release-branch.r59">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r59.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
This release includes a language change that restricts the use of
|
||||
<code>goto</code>. In essence, a <code>goto</code> statement outside a block
|
||||
cannot jump to a label inside that block. Your code may require changes if it
|
||||
uses <code>goto</code>.
|
||||
See <a href="//golang.org/change/dc6d3cf9279d">this
|
||||
changeset</a> for how the new rule affected the Go tree.
|
||||
</p>
|
||||
|
||||
<h3 id="r59.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
As usual, <a href="/cmd/gofix/">gofix</a> will handle the bulk of the rewrites
|
||||
necessary for these changes to package APIs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http">Package http</a> has a new
|
||||
<a href="/pkg/http/#FileSystem">FileSystem</a> interface that provides access
|
||||
to files. The <a href="/pkg/http/#FileServer">FileServer</a> helper now takes a
|
||||
<code>FileSystem</code> argument instead of an explicit file system root. By
|
||||
implementing your own <code>FileSystem</code> you can use the
|
||||
<code>FileServer</code> to serve arbitrary data.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/os/">Package os</a>'s <code>ErrorString</code> type has been
|
||||
hidden. Most uses of <code>os.ErrorString</code> can be replaced with
|
||||
<a href="/pkg/os/#NewError">os.NewError</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/reflect/">Package reflect</a> supports a new struct tag scheme
|
||||
that enables sharing of struct tags between multiple packages.
|
||||
In this scheme, the tags must be of the form:
|
||||
</p>
|
||||
<pre>
|
||||
`key:"value" key2:"value2"`
|
||||
</pre>
|
||||
<p>
|
||||
The <a href="/pkg/reflect/#StructField">StructField</a> type's Tag field now
|
||||
has type <a href="/pkg/reflect/#StructTag">StructTag</a>, which has a
|
||||
<code>Get</code> method. Clients of <a href="/pkg/json">json</a> and
|
||||
<a href="/pkg/xml">xml</a> will need to be updated. Code that says
|
||||
</p>
|
||||
<pre>
|
||||
type T struct {
|
||||
X int "name"
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
should become
|
||||
</p>
|
||||
<pre>
|
||||
type T struct {
|
||||
X int `json:"name"` // or `xml:"name"`
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
Use <a href="/cmd/govet/">govet</a> to identify struct tags that need to be
|
||||
changed to use the new syntax.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/sort/">Package sort</a>'s <code>IntArray</code> type has been
|
||||
renamed to <a href="/pkg/sort/#IntSlice">IntSlice</a>, and similarly for
|
||||
<a href="/pkg/sort/#Float64Slice">Float64Slice</a> and
|
||||
<a href="/pkg/sort/#StringSlice">StringSlice</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/strings/">Package strings</a>'s <code>Split</code> function has
|
||||
itself been split into <a href="/pkg/strings/#Split">Split</a> and
|
||||
<a href="/pkg/strings/#SplitN">SplitN</a>.
|
||||
<code>SplitN</code> is the same as the old <code>Split</code>.
|
||||
The new <code>Split</code> is equivalent to <code>SplitN</code> with a final
|
||||
argument of -1.
|
||||
</p>
|
||||
|
||||
<a href="/pkg/image/draw/">Package image/draw</a>'s
|
||||
<a href="/pkg/image/draw/#Draw">Draw</a> function now takes an additional
|
||||
argument, a compositing operator.
|
||||
If in doubt, use <a href="/pkg/image/draw/#Op">draw.Over</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r59.cmd">Tools</h3>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/goinstall/">Goinstall</a> now installs packages and commands from
|
||||
arbitrary remote repositories (not just Google Code, Github, and so on).
|
||||
See the <a href="/cmd/goinstall/">goinstall documentation</a> for details.
|
||||
</p>
|
||||
|
||||
<h2 id="r58">r58 (released 2011/06/29)</h2>
|
||||
|
||||
<p>
|
||||
The r58 release corresponds to
|
||||
<code><a href="weekly.html#2011-06-09">weekly.2011-06-09</a></code>
|
||||
with additional bug fixes.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-06-09">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="//code.google.com/p/go/source/list?r=release-branch.r58">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r58.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
This release fixes a <a href="//golang.org/change/b720749486e1">use of uninitialized memory in programs that misuse <code>goto</code></a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r58.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
As usual, <a href="/cmd/gofix/">gofix</a> will handle the bulk of the rewrites
|
||||
necessary for these changes to package APIs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http/">Package http</a> drops the <code>finalURL</code> return
|
||||
value from the <a href="/pkg/http/#Client.Get">Client.Get</a> method. The value
|
||||
is now available via the new <code>Request</code> field on <a
|
||||
href="/pkg/http/#Response">http.Response</a>.
|
||||
Most instances of the type map[string][]string in have been
|
||||
replaced with the new <a href="/pkg/http/#Values">Values</a> type.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/exec/">Package exec</a> has been redesigned with a more
|
||||
convenient and succinct API.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/strconv/">Package strconv</a>'s <a href="/pkg/strconv/#Quote">Quote</a>
|
||||
function now escapes only those Unicode code points not classified as printable
|
||||
by <a href="/pkg/unicode/#IsPrint">unicode.IsPrint</a>.
|
||||
Previously Quote would escape all non-ASCII characters.
|
||||
This also affects the <a href="/pkg/fmt/">fmt</a> package's <code>"%q"</code>
|
||||
formatting directive. The previous quoting behavior is still available via
|
||||
strconv's new <a href="/pkg/strconv/#QuoteToASCII">QuoteToASCII</a> function.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/os/signal/">Package os/signal</a>'s
|
||||
<a href="/pkg/os/#Signal">Signal</a> and
|
||||
<a href="/pkg/os/#UnixSignal">UnixSignal</a> types have been moved to the
|
||||
<a href="/pkg/os/">os</a> package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/image/draw/">Package image/draw</a> is the new name for
|
||||
<code>exp/draw</code>. The GUI-related code from <code>exp/draw</code> is now
|
||||
located in the <a href="/pkg/exp/gui/">exp/gui</a> package.
|
||||
</p>
|
||||
|
||||
<h3 id="r58.cmd">Tools</h3>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/goinstall/">Goinstall</a> now observes the GOPATH environment
|
||||
variable to build and install your own code and external libraries outside of
|
||||
the Go tree (and avoid writing Makefiles).
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="r58.minor">Minor revisions</h3>
|
||||
|
||||
<p>r58.1 adds
|
||||
<a href="//golang.org/change/293c25943586">build</a> and
|
||||
<a href="//golang.org/change/bf17e96b6582">runtime</a>
|
||||
changes to make Go run on OS X 10.7 Lion.
|
||||
</p>
|
||||
|
||||
<h2 id="r57">r57 (released 2011/05/03)</h2>
|
||||
|
||||
<p>
|
||||
The r57 release corresponds to
|
||||
<code><a href="weekly.html#2011-04-27">weekly.2011-04-27</a></code>
|
||||
with additional bug fixes.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-04-27">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="//code.google.com/p/go/source/list?r=release-branch.r57">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<p>The new <a href="/cmd/gofix">gofix</a> tool finds Go programs that use old APIs and rewrites them to use
|
||||
newer ones. After you update to a new Go release, gofix helps make the
|
||||
necessary changes to your programs. Gofix will handle the http, os, and syscall
|
||||
package changes described below, and we will update the program to keep up with
|
||||
future changes to the libraries.
|
||||
Gofix can’t
|
||||
handle all situations perfectly, so read and test the changes it makes before
|
||||
committing them.
|
||||
See <a href="//blog.golang.org/2011/04/introducing-gofix.html">the gofix blog post</a> for more
|
||||
information.</p>
|
||||
|
||||
<h3 id="r57.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
<a href="/doc/go_spec.html#Receive_operator">Multiple assignment syntax</a> replaces the <code>closed</code> function.
|
||||
The syntax for channel
|
||||
receives allows an optional second assigned value, a boolean value
|
||||
indicating whether the channel is closed. This code:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
v := <-ch
|
||||
if closed(ch) {
|
||||
// channel is closed
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>should now be written as:</p>
|
||||
|
||||
<pre>
|
||||
v, ok := <-ch
|
||||
if !ok {
|
||||
// channel is closed
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p><a href="/doc/go_spec.html#Label_scopes">Unused labels are now illegal</a>, just as unused local variables are.</p>
|
||||
|
||||
<h3 id="r57.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/gob/">Package gob</a> will now encode and decode values of types that implement the
|
||||
<a href="/pkg/gob/#GobEncoder">GobEncoder</a> and
|
||||
<a href="/pkg/gob/#GobDecoder">GobDecoder</a> interfaces. This allows types with unexported
|
||||
fields to transmit self-consistent descriptions; examples include
|
||||
<a href="/pkg/big/#Int.GobDecode">big.Int</a> and <a href="/pkg/big/#Rat.GobDecode">big.Rat</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http/">Package http</a> has been redesigned.
|
||||
For clients, there are new
|
||||
<a href="/pkg/http/#Client">Client</a> and <a href="/pkg/http/#Transport">Transport</a>
|
||||
abstractions that give more control over HTTP details such as headers sent
|
||||
and redirections followed. These abstractions make it easy to implement
|
||||
custom clients that add functionality such as <a href="//code.google.com/p/goauth2/source/browse/oauth/oauth.go">OAuth2</a>.
|
||||
For servers, <a href="/pkg/http/#ResponseWriter">ResponseWriter</a>
|
||||
has dropped its non-essential methods.
|
||||
The Hijack and Flush methods are no longer required;
|
||||
code can test for them by checking whether a specific value implements
|
||||
<a href="/pkg/http/#Hijacker">Hijacker</a> or <a href="/pkg/http/#Flusher">Flusher</a>.
|
||||
The RemoteAddr and UsingTLS methods are replaced by <a href="/pkg/http/#Request">Request</a>'s
|
||||
RemoteAddr and TLS fields.
|
||||
The SetHeader method is replaced by a Header method;
|
||||
its result, of type <a href="/pkg/http/#Header">Header</a>,
|
||||
implements Set and other methods.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/net/">Package net</a>
|
||||
drops the <code>laddr</code> argument from <a href="/pkg/net/#Conn.Dial">Dial</a>
|
||||
and drops the <code>cname</code> return value
|
||||
from <a href="/pkg/net/#LookupHost">LookupHost</a>.
|
||||
The implementation now uses <a href="/cmd/cgo/">cgo</a> to implement
|
||||
network name lookups using the C library getaddrinfo(3)
|
||||
function when possible. This ensures that Go and C programs
|
||||
resolve names the same way and also avoids the OS X
|
||||
application-level firewall.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/os/">Package os</a>
|
||||
introduces simplified <a href="/pkg/os/#File.Open">Open</a>
|
||||
and <a href="/pkg/os/#File.Create">Create</a> functions.
|
||||
The original Open is now available as <a href="/pkg/os/#File.OpenFile">OpenFile</a>.
|
||||
The final three arguments to <a href="/pkg/os/#Process.StartProcess">StartProcess</a>
|
||||
have been replaced by a pointer to a <a href="/pkg/os/#ProcAttr">ProcAttr</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/reflect/">Package reflect</a> has been redesigned.
|
||||
<a href="/pkg/reflect/#Type">Type</a> is now an interface that implements
|
||||
all the possible type methods.
|
||||
Instead of a type switch on a Type <code>t</code>, switch on <code>t.Kind()</code>.
|
||||
<a href="/pkg/reflect/#Value">Value</a> is now a struct value that
|
||||
implements all the possible value methods.
|
||||
Instead of a type switch on a Value <code>v</code>, switch on <code>v.Kind()</code>.
|
||||
Typeof and NewValue are now called <a href="/pkg/reflect/#Type.TypeOf">TypeOf</a> and <a href="/pkg/reflect/#Value.ValueOf">ValueOf</a>
|
||||
To create a writable Value, use <code>New(t).Elem()</code> instead of <code>Zero(t)</code>.
|
||||
See <a href="//golang.org/change/843855f3c026">the change description</a>
|
||||
for the full details.
|
||||
The new API allows a more efficient implementation of Value
|
||||
that avoids many of the allocations required by the previous API.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Remember that gofix will handle the bulk of the rewrites
|
||||
necessary for these changes to package APIs.
|
||||
</p>
|
||||
|
||||
<h3 id="r57.cmd">Tools</h3>
|
||||
|
||||
<p><a href="/cmd/gofix/">Gofix</a>, a new command, is described above.</p>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/gotest/">Gotest</a> is now a Go program instead of a shell script.
|
||||
The new <code>-test.short</code> flag in combination with package testing's Short function
|
||||
allows you to write tests that can be run in normal or “short” mode;
|
||||
all.bash runs tests in short mode to reduce installation time.
|
||||
The Makefiles know about the flag: use <code>make testshort</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The run-time support now implements CPU and memory profiling.
|
||||
Gotest's new
|
||||
<a href="/cmd/gotest/"><code>-test.cpuprofile</code> and
|
||||
<code>-test.memprofile</code> flags</a> make it easy to
|
||||
profile tests.
|
||||
To add profiling to your web server, see the <a href="/pkg/http/pprof/">http/pprof</a>
|
||||
documentation.
|
||||
For other uses, see the <a href="/pkg/runtime/pprof/">runtime/pprof</a> documentation.
|
||||
</p>
|
||||
|
||||
<h3 id="r57.minor">Minor revisions</h3>
|
||||
|
||||
<p>r57.1 fixes a <a href="//golang.org/change/ff2bc62726e7145eb2ecc1e0f076998e4a8f86f0">nil pointer dereference in http.FormFile</a>.</p>
|
||||
<p>r57.2 fixes a <a href="//golang.org/change/063b0ff67d8277df03c956208abc068076818dae">use of uninitialized memory in programs that misuse <code>goto</code></a>.</p>
|
||||
|
||||
<h2 id="r56">r56 (released 2011/03/16)</h2>
|
||||
|
||||
<p>
|
||||
The r56 release was the first stable release and corresponds to
|
||||
<code><a href="weekly.html#2011-03-07">weekly.2011-03-07.1</a></code>.
|
||||
The numbering starts at 56 because before this release,
|
||||
what we now consider weekly snapshots were called releases.
|
||||
</p>
|
||||
273
doc/devel/release.html
Normal file
273
doc/devel/release.html
Normal file
@@ -0,0 +1,273 @@
|
||||
<!--{
|
||||
"Title": "Release History"
|
||||
}-->
|
||||
|
||||
<p>This page summarizes the changes between official stable releases of Go.
|
||||
The <a href="//golang.org/change">change log</a> has the full details.</p>
|
||||
|
||||
<p>To update to a specific release, use:</p>
|
||||
|
||||
<pre>
|
||||
git pull
|
||||
git checkout <i>release-branch</i>
|
||||
</pre>
|
||||
|
||||
<h2 id="policy">Release Policy</h2>
|
||||
|
||||
<p>
|
||||
Each major Go release obsoletes and ends support for the previous one.
|
||||
For example, if Go 1.5 has been released, then it is the current release
|
||||
and Go 1.4 and earlier are no longer supported.
|
||||
We fix critical problems in the current release as needed by issuing minor revisions
|
||||
(for example, Go 1.5.1, Go 1.5.2, and so on).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
As a special case, we issue minor revisions for critical security problems
|
||||
in both the current release and the previous release.
|
||||
For example, if Go 1.5 is the current release then we will issue minor revisions
|
||||
to fix critical security problems in both Go 1.4 and Go 1.5 as they arise.
|
||||
See the <a href="/security">security policy</a> for more details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.7">go1.7 (released 2016/08/15)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.7 is a major release of Go.
|
||||
Read the <a href="/doc/go1.7">Go 1.7 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.7.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.7.1 (released 2016/09/07) includes fixes to the compiler, runtime,
|
||||
documentation, and the <code>compress/flate</code>, <code>hash/crc32</code>,
|
||||
<code>io</code>, <code>net</code>, <code>net/http</code>,
|
||||
<code>path/filepath</code>, <code>reflect</code>, and <code>syscall</code>
|
||||
packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.1">Go
|
||||
1.7.1 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.7.2 (released 2016/10/17) includes fixes to the compiler, runtime,
|
||||
and the <code>crypto/cipher</code>, <code>crypto/tls</code>,
|
||||
<code>net/http</code>, and <code>strings</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.2">Go
|
||||
1.7.2 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.6">go1.6 (released 2016/02/17)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.6 is a major release of Go.
|
||||
Read the <a href="/doc/go1.6">Go 1.6 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.6.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.6.1 (released 2016/04/12) includes two security fixes.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.1">Go
|
||||
1.6.1 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.6.2 (released 2016/04/20) includes fixes to the compiler, runtime, tools,
|
||||
documentation, and the <code>mime/multipart</code>, <code>net/http</code>, and
|
||||
<code>sort</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.2">Go
|
||||
1.6.2 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.6.3 (released 2016/07/17) includes security fixes to the
|
||||
<code>net/http/cgi</code> package and <code>net/http</code> package when used in
|
||||
a CGI environment. This release also adds support for macOS Sierra.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.3">Go
|
||||
1.6.3 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.5">go1.5 (released 2015/08/19)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.5 is a major release of Go.
|
||||
Read the <a href="/doc/go1.5">Go 1.5 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.5.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.5.1 (released 2015/09/08) includes bug fixes to the compiler, assembler, and
|
||||
the <code>fmt</code>, <code>net/textproto</code>, <code>net/http</code>, and
|
||||
<code>runtime</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.5.1">Go
|
||||
1.5.1 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.5.2 (released 2015/12/02) includes bug fixes to the compiler, linker, and
|
||||
the <code>mime/multipart</code>, <code>net</code>, and <code>runtime</code>
|
||||
packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.5.2">Go
|
||||
1.5.2 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.5.3 (released 2016/01/13) includes a security fix to the <code>math/big</code> package
|
||||
affecting the <code>crypto/tls</code> package.
|
||||
See the <a href="https://golang.org/s/go153announce">release announcement</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.5.4 (released 2016/04/12) includes two security fixes.
|
||||
It contains the same fixes as Go 1.6.1 and was released at the same time.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.1">Go
|
||||
1.6.1 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.4">go1.4 (released 2014/12/10)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.4 is a major release of Go.
|
||||
Read the <a href="/doc/go1.4">Go 1.4 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.4.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.4.1 (released 2015/01/15) includes bug fixes to the linker and the <code>log</code>, <code>syscall</code>, and <code>runtime</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.1">Go 1.4.1 milestone on our issue tracker</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.4.2 (released 2015/02/17) includes bug fixes to the <code>go</code> command, the compiler and linker, and the <code>runtime</code>, <code>syscall</code>, <code>reflect</code>, and <code>math/big</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.2">Go 1.4.2 milestone on our issue tracker</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.4.3 (released 2015/09/22) includes security fixes to the <code>net/http</code> package and bug fixes to the <code>runtime</code> package.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.3">Go 1.4.3 milestone on our issue tracker</a> for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.3">go1.3 (released 2014/06/18)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.3 is a major release of Go.
|
||||
Read the <a href="/doc/go1.3">Go 1.3 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.3.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.3.1 (released 2014/08/13) includes bug fixes to the compiler and the <code>runtime</code>, <code>net</code>, and <code>crypto/rsa</code> packages.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.3.1">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.3.2 (released 2014/09/25) includes bug fixes to cgo and the crypto/tls packages.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.3.2">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.3.3 (released 2014/09/30) includes further bug fixes to cgo, the runtime package, and the nacl port.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.3.3">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.2">go1.2 (released 2013/12/01)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.2 is a major release of Go.
|
||||
Read the <a href="/doc/go1.2">Go 1.2 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.2.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.2.1 (released 2014/03/02) includes bug fixes to the <code>runtime</code>, <code>net</code>, and <code>database/sql</code> packages.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.2.1">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.2.2 (released 2014/05/05) includes a
|
||||
<a href="https://github.com/golang/go/commits/go1.2.2">security fix</a>
|
||||
that affects the tour binary included in the binary distributions (thanks to Guillaume T).
|
||||
</p>
|
||||
|
||||
<h2 id="go1.1">go1.1 (released 2013/05/13)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.1 is a major release of Go.
|
||||
Read the <a href="/doc/go1.1">Go 1.1 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.1.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.1.1 (released 2013/06/13) includes several compiler and runtime bug fixes.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.1.1">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.1.2 (released 2013/08/13) includes fixes to the <code>gc</code> compiler
|
||||
and <code>cgo</code>, and the <code>bufio</code>, <code>runtime</code>,
|
||||
<code>syscall</code>, and <code>time</code> packages.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.1.2">change history</a> for details.
|
||||
If you use package syscall's <code>Getrlimit</code> and <code>Setrlimit</code>
|
||||
functions under Linux on the ARM or 386 architectures, please note change
|
||||
<a href="//golang.org/cl/11803043">11803043</a>
|
||||
that fixes <a href="//golang.org/issue/5949">issue 5949</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="go1">go1 (released 2012/03/28)</h2>
|
||||
|
||||
<p>
|
||||
Go 1 is a major release of Go that will be stable in the long term.
|
||||
Read the <a href="/doc/go1.html">Go 1 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
It is intended that programs written for Go 1 will continue to compile and run
|
||||
correctly, unchanged, under future versions of Go 1.
|
||||
Read the <a href="/doc/go1compat.html">Go 1 compatibility document</a> for more
|
||||
about the future of Go 1.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The go1 release corresponds to
|
||||
<code><a href="weekly.html#2012-03-27">weekly.2012-03-27</a></code>.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.0.1 (released 2012/04/25) was issued to
|
||||
<a href="//golang.org/cl/6061043">fix</a> an
|
||||
<a href="//golang.org/issue/3545">escape analysis bug</a>
|
||||
that can lead to memory corruption.
|
||||
It also includes several minor code and documentation fixes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.0.2 (released 2012/06/13) was issued to fix two bugs in the implementation
|
||||
of maps using struct or array keys:
|
||||
<a href="//golang.org/issue/3695">issue 3695</a> and
|
||||
<a href="//golang.org/issue/3573">issue 3573</a>.
|
||||
It also includes many minor code and documentation fixes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.0.3 (released 2012/09/21) includes minor code and documentation fixes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
See the <a href="https://github.com/golang/go/commits/release-branch.go1">go1 release branch history</a> for the complete list of changes.
|
||||
</p>
|
||||
|
||||
<h2 id="pre.go1">Older releases</h2>
|
||||
|
||||
<p>
|
||||
See the <a href="pre_go1.html">Pre-Go 1 Release History</a> page for notes
|
||||
on earlier releases.
|
||||
</p>
|
||||
|
||||
6200
doc/devel/weekly.html
Normal file
6200
doc/devel/weekly.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,470 +0,0 @@
|
||||
<!--{
|
||||
"Title": "Diagnostics",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<!--
|
||||
NOTE: In this document and others in this directory, the convention is to
|
||||
set fixed-width phrases with non-fixed-width spaces, as in
|
||||
<code>hello</code> <code>world</code>.
|
||||
Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
|
||||
<p>
|
||||
The Go ecosystem provides a large suite of APIs and tools to
|
||||
diagnose logic and performance problems in Go programs. This page
|
||||
summarizes the available tools and helps Go users pick the right one
|
||||
for their specific problem.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Diagnostics solutions can be categorized into the following groups:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>Profiling</strong>: Profiling tools analyze the complexity and costs of a
|
||||
Go program such as its memory usage and frequently called
|
||||
functions to identify the expensive sections of a Go program.</li>
|
||||
<li><strong>Tracing</strong>: Tracing is a way to instrument code to analyze latency
|
||||
throughout the lifecycle of a call or user request. Traces provide an
|
||||
overview of how much latency each component contributes to the overall
|
||||
latency in a system. Traces can span multiple Go processes.</li>
|
||||
<li><strong>Debugging</strong>: Debugging allows us to pause a Go program and examine
|
||||
its execution. Program state and flow can be verified with debugging.</li>
|
||||
<li><strong>Runtime statistics and events</strong>: Collection and analysis of runtime stats and events
|
||||
provides a high-level overview of the health of Go programs. Spikes/dips of metrics
|
||||
helps us to identify changes in throughput, utilization, and performance.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Note: Some diagnostics tools may interfere with each other. For example, precise
|
||||
memory profiling skews CPU profiles and goroutine blocking profiling affects scheduler
|
||||
trace. Use tools in isolation to get more precise info.
|
||||
</p>
|
||||
|
||||
<h2 id="profiling">Profiling</h2>
|
||||
|
||||
<p>
|
||||
Profiling is useful for identifying expensive or frequently called sections
|
||||
of code. The Go runtime provides <a href="https://golang.org/pkg/runtime/pprof/">
|
||||
profiling data</a> in the format expected by the
|
||||
<a href="https://github.com/google/pprof/blob/master/doc/README.md">pprof visualization tool</a>.
|
||||
The profiling data can be collected during testing
|
||||
via <code>go</code> <code>test</code> or endpoints made available from the <a href="/pkg/net/http/pprof/">
|
||||
net/http/pprof</a> package. Users need to collect the profiling data and use pprof tools to filter
|
||||
and visualize the top code paths.
|
||||
</p>
|
||||
|
||||
<p>Predefined profiles provided by the <a href="/pkg/runtime/pprof">runtime/pprof</a> package:</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<strong>cpu</strong>: CPU profile determines where a program spends
|
||||
its time while actively consuming CPU cycles (as opposed to while sleeping or waiting for I/O).
|
||||
</li>
|
||||
<li>
|
||||
<strong>heap</strong>: Heap profile reports memory allocation samples;
|
||||
used to monitor current and historical memory usage, and to check for memory leaks.
|
||||
</li>
|
||||
<li>
|
||||
<strong>threadcreate</strong>: Thread creation profile reports the sections
|
||||
of the program that lead the creation of new OS threads.
|
||||
</li>
|
||||
<li>
|
||||
<strong>goroutine</strong>: Goroutine profile reports the stack traces of all current goroutines.
|
||||
</li>
|
||||
<li>
|
||||
<strong>block</strong>: Block profile shows where goroutines block waiting on synchronization
|
||||
primitives (including timer channels). Block profile is not enabled by default;
|
||||
use <code>runtime.SetBlockProfileRate</code> to enable it.
|
||||
</li>
|
||||
<li>
|
||||
<strong>mutex</strong>: Mutex profile reports the lock contentions. When you think your
|
||||
CPU is not fully utilized due to a mutex contention, use this profile. Mutex profile
|
||||
is not enabled by default, see <code>runtime.SetMutexProfileFraction</code> to enable it.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p><strong>What other profilers can I use to profile Go programs?</strong></p>
|
||||
|
||||
<p>
|
||||
On Linux, <a href="https://perf.wiki.kernel.org/index.php/Tutorial">perf tools</a>
|
||||
can be used for profiling Go programs. Perf can profile
|
||||
and unwind cgo/SWIG code and kernel, so it can be useful to get insights into
|
||||
native/kernel performance bottlenecks. On macOS,
|
||||
<a href="https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/">Instruments</a>
|
||||
suite can be used profile Go programs.
|
||||
</p>
|
||||
|
||||
<p><strong>Can I profile my production services?</strong></p>
|
||||
|
||||
<p>Yes. It is safe to profile programs in production, but enabling
|
||||
some profiles (e.g. the CPU profile) adds cost. You should expect to
|
||||
see performance downgrade. The performance penalty can be estimated
|
||||
by measuring the overhead of the profiler before turning it on in
|
||||
production.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You may want to periodically profile your production services.
|
||||
Especially in a system with many replicas of a single process, selecting
|
||||
a random replica periodically is a safe option.
|
||||
Select a production process, profile it for
|
||||
X seconds for every Y seconds and save the results for visualization and
|
||||
analysis; then repeat periodically. Results may be manually and/or automatically
|
||||
reviewed to find problems.
|
||||
Collection of profiles can interfere with each other,
|
||||
so it is recommended to collect only a single profile at a time.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>What are the best ways to visualize the profiling data?</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The Go tools provide text, graph, and <a href="http://valgrind.org/docs/manual/cl-manual.html">callgrind</a>
|
||||
visualization of the profile data using
|
||||
<code><a href="https://github.com/google/pprof/blob/master/doc/README.md">go tool pprof</a></code>.
|
||||
Read <a href="https://blog.golang.org/profiling-go-programs">Profiling Go programs</a>
|
||||
to see them in action.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/pprof-text.png">
|
||||
<br>
|
||||
<small>Listing of the most expensive calls as text.</small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/pprof-dot.png">
|
||||
<br>
|
||||
<small>Visualization of the most expensive calls as a graph.</small>
|
||||
</p>
|
||||
|
||||
<p>Weblist view displays the expensive parts of the source line by line in
|
||||
an HTML page. In the following example, 530ms is spent in the
|
||||
<code>runtime.concatstrings</code> and cost of each line is presented
|
||||
in the listing.</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/pprof-weblist.png">
|
||||
<br>
|
||||
<small>Visualization of the most expensive calls as weblist.</small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Another way to visualize profile data is a <a href="http://www.brendangregg.com/flamegraphs.html">flame graph</a>.
|
||||
Flame graphs allow you to move in a specific ancestry path, so you can zoom
|
||||
in/out of specific sections of code.
|
||||
The <a href="https://github.com/google/pprof">upstream pprof</a>
|
||||
has support for flame graphs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/flame.png">
|
||||
<br>
|
||||
<small>Flame graphs offers visualization to spot the most expensive code-paths.</small>
|
||||
</p>
|
||||
|
||||
<p><strong>Am I restricted to the built-in profiles?</strong></p>
|
||||
|
||||
<p>
|
||||
Additionally to what is provided by the runtime, Go users can create
|
||||
their custom profiles via <a href="/pkg/runtime/pprof/#Profile">pprof.Profile</a>
|
||||
and use the existing tools to examine them.
|
||||
</p>
|
||||
|
||||
<p><strong>Can I serve the profiler handlers (/debug/pprof/...) on a different path and port?</strong></p>
|
||||
|
||||
<p>
|
||||
Yes. The <code>net/http/pprof</code> package registers its handlers to the default
|
||||
mux by default, but you can also register them yourself by using the handlers
|
||||
exported from the package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For example, the following example will serve the pprof.Profile
|
||||
handler on :7777 at /custom_debug_path/profile:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
)
|
||||
|
||||
func main() {
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/custom_debug_path/profile", pprof.Profile)
|
||||
log.Fatal(http.ListenAndServe(":7777", mux))
|
||||
}
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<h2 id="tracing">Tracing</h2>
|
||||
|
||||
<p>
|
||||
Tracing is a way to instrument code to analyze latency throughout the
|
||||
lifecycle of a chain of calls. Go provides
|
||||
<a href="https://godoc.org/golang.org/x/net/trace">golang.org/x/net/trace</a>
|
||||
package as a minimal tracing backend per Go node and provides a minimal
|
||||
instrumentation library with a simple dashboard. Go also provides
|
||||
an execution tracer to trace the runtime events within an interval.
|
||||
</p>
|
||||
|
||||
<p>Tracing enables us to:</p>
|
||||
|
||||
<ul>
|
||||
<li>Instrument and analyze application latency in a Go process.</li>
|
||||
<li>Measure the cost of specific calls in a long chain of calls.</li>
|
||||
<li>Figure out the utilization and performance improvements.
|
||||
Bottlenecks are not always obvious without tracing data.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
In monolithic systems, it's relatively easy to collect diagnostic data
|
||||
from the building blocks of a program. All modules live within one
|
||||
process and share common resources to report logs, errors, and other
|
||||
diagnostic information. Once your system grows beyond a single process and
|
||||
starts to become distributed, it becomes harder to follow a call starting
|
||||
from the front-end web server to all of its back-ends until a response is
|
||||
returned back to the user. This is where distributed tracing plays a big
|
||||
role to instrument and analyze your production systems.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed tracing is a way to instrument code to analyze latency throughout
|
||||
the lifecycle of a user request. When a system is distributed and when
|
||||
conventional profiling and debugging tools don’t scale, you might want
|
||||
to use distributed tracing tools to analyze the performance of your user
|
||||
requests and RPCs.
|
||||
</p>
|
||||
|
||||
<p>Distributed tracing enables us to:</p>
|
||||
|
||||
<ul>
|
||||
<li>Instrument and profile application latency in a large system.</li>
|
||||
<li>Track all RPCs within the lifecycle of a user request and see integration issues
|
||||
that are only visible in production.</li>
|
||||
<li>Figure out performance improvements that can be applied to our systems.
|
||||
Many bottlenecks are not obvious before the collection of tracing data.</li>
|
||||
</ul>
|
||||
|
||||
<p>The Go ecosystem provides various distributed tracing libraries per tracing system
|
||||
and backend-agnostic ones.</p>
|
||||
|
||||
|
||||
<p><strong>Is there a way to automatically intercept each function call and create traces?</strong></p>
|
||||
|
||||
<p>
|
||||
Go doesn’t provide a way to automatically intercept every function call and create
|
||||
trace spans. You need to manually instrument your code to create, end, and annotate spans.
|
||||
</p>
|
||||
|
||||
<p><strong>How should I propagate trace headers in Go libraries?</strong></p>
|
||||
|
||||
<p>
|
||||
You can propagate trace identifiers and tags in the
|
||||
<a href="/pkg/context#Context"><code>context.Context</code></a>.
|
||||
There is no canonical trace key or common representation of trace headers
|
||||
in the industry yet. Each tracing provider is responsible for providing propagation
|
||||
utilities in their Go libraries.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>What other low-level events from the standard library or
|
||||
runtime can be included in a trace?</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The standard library and runtime are trying to expose several additional APIs
|
||||
to notify on low level internal events. For example,
|
||||
<a href="/pkg/net/http/httptrace#ClientTrace"><code>httptrace.ClientTrace</code></a>
|
||||
provides APIs to follow low-level events in the life cycle of an outgoing request.
|
||||
There is an ongoing effort to retrieve low-level runtime events from
|
||||
the runtime execution tracer and allow users to define and record their user events.
|
||||
</p>
|
||||
|
||||
<h2 id="debugging">Debugging</h2>
|
||||
|
||||
<p>
|
||||
Debugging is the process of identifying why a program misbehaves.
|
||||
Debuggers allow us to understand a program’s execution flow and current state.
|
||||
There are several styles of debugging; this section will only focus on attaching
|
||||
a debugger to a program and core dump debugging.
|
||||
</p>
|
||||
|
||||
<p>Go users mostly use the following debuggers:</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/derekparker/delve">Delve</a>:
|
||||
Delve is a debugger for the Go programming language. It has
|
||||
support for Go’s runtime concepts and built-in types. Delve is
|
||||
trying to be a fully featured reliable debugger for Go programs.
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://golang.org/doc/gdb">GDB</a>:
|
||||
Go provides GDB support via the standard Go compiler and Gccgo.
|
||||
The stack management, threading, and runtime contain aspects that differ
|
||||
enough from the execution model GDB expects that they can confuse the
|
||||
debugger, even when the program is compiled with gccgo. Even though
|
||||
GDB can be used to debug Go programs, it is not ideal and may
|
||||
create confusion.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p><strong>How well do debuggers work with Go programs?</strong></p>
|
||||
|
||||
<p>
|
||||
The <code>gc</code> compiler performs optimizations such as
|
||||
function inlining and variable registerization. These optimizations
|
||||
sometimes make debugging with debuggers harder. There is an ongoing
|
||||
effort to improve the quality of the DWARF information generated for
|
||||
optimized binaries. Until those improvements are available, we recommend
|
||||
disabling optimizations when building the code being debugged. The following
|
||||
command builds a package with no compiler optimizations:
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
$ go build -gcflags=all="-N -l"
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
As part of the improvement effort, Go 1.10 introduced a new compiler
|
||||
flag <code>-dwarflocationlists</code>. The flag causes the compiler to
|
||||
add location lists that helps debuggers work with optimized binaries.
|
||||
The following command builds a package with optimizations but with
|
||||
the DWARF location lists:
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
$ go build -gcflags="-dwarflocationlists=true"
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<p><strong>What’s the recommended debugger user interface?</strong></p>
|
||||
|
||||
<p>
|
||||
Even though both delve and gdb provides CLIs, most editor integrations
|
||||
and IDEs provides debugging-specific user interfaces.
|
||||
</p>
|
||||
|
||||
<p><strong>Is it possible to do postmortem debugging with Go programs?</strong></p>
|
||||
|
||||
<p>
|
||||
A core dump file is a file that contains the memory dump of a running
|
||||
process and its process status. It is primarily used for post-mortem
|
||||
debugging of a program and to understand its state
|
||||
while it is still running. These two cases make debugging of core
|
||||
dumps a good diagnostic aid to postmortem and analyze production
|
||||
services. It is possible to obtain core files from Go programs and
|
||||
use delve or gdb to debug, see the
|
||||
<a href="https://golang.org/wiki/CoreDumpDebugging">core dump debugging</a>
|
||||
page for a step-by-step guide.
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime statistics and events</h2>
|
||||
|
||||
<p>
|
||||
The runtime provides stats and reporting of internal events for
|
||||
users to diagnose performance and utilization problems at the
|
||||
runtime level.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Users can monitor these stats to better understand the overall
|
||||
health and performance of Go programs.
|
||||
Some frequently monitored stats and states:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><code><a href="/pkg/runtime/#ReadMemStats">runtime.ReadMemStats</a></code>
|
||||
reports the metrics related to heap
|
||||
allocation and garbage collection. Memory stats are useful for
|
||||
monitoring how much memory resources a process is consuming,
|
||||
whether the process can utilize memory well, and to catch
|
||||
memory leaks.</li>
|
||||
<li><code><a href="/pkg/runtime/debug/#ReadGCStats">debug.ReadGCStats</a></code>
|
||||
reads statistics about garbage collection.
|
||||
It is useful to see how much of the resources are spent on GC pauses.
|
||||
It also reports a timeline of garbage collector pauses and pause time percentiles.</li>
|
||||
<li><code><a href="/pkg/runtime/debug/#Stack">debug.Stack</a></code>
|
||||
returns the current stack trace. Stack trace
|
||||
is useful to see how many goroutines are currently running,
|
||||
what they are doing, and whether they are blocked or not.</li>
|
||||
<li><code><a href="/pkg/runtime/debug/#WriteHeapDump">debug.WriteHeapDump</a></code>
|
||||
suspends the execution of all goroutines
|
||||
and allows you to dump the heap to a file. A heap dump is a
|
||||
snapshot of a Go process' memory at a given time. It contains all
|
||||
allocated objects as well as goroutines, finalizers, and more.</li>
|
||||
<li><code><a href="/pkg/runtime#NumGoroutine">runtime.NumGoroutine</a></code>
|
||||
returns the number of current goroutines.
|
||||
The value can be monitored to see whether enough goroutines are
|
||||
utilized, or to detect goroutine leaks.</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="execution-tracer">Execution tracer</h3>
|
||||
|
||||
<p>Go comes with a runtime execution tracer to capture a wide range
|
||||
of runtime events. Scheduling, syscall, garbage collections,
|
||||
heap size, and other events are collected by runtime and available
|
||||
for visualization by the go tool trace. Execution tracer is a tool
|
||||
to detect latency and utilization problems. You can examine how well
|
||||
the CPU is utilized, and when networking or syscalls are a cause of
|
||||
preemption for the goroutines.</p>
|
||||
|
||||
<p>Tracer is useful to:</p>
|
||||
<ul>
|
||||
<li>Understand how your goroutines execute.</li>
|
||||
<li>Understand some of the core runtime events such as GC runs.</li>
|
||||
<li>Identify poorly parallelized execution.</li>
|
||||
</ul>
|
||||
|
||||
<p>However, it is not great for identifying hot spots such as
|
||||
analyzing the cause of excessive memory or CPU usage.
|
||||
Use profiling tools instead first to address them.</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/tracer-lock.png">
|
||||
</p>
|
||||
|
||||
<p>Above, the go tool trace visualization shows the execution started
|
||||
fine, and then it became serialized. It suggests that there might
|
||||
be lock contention for a shared resource that creates a bottleneck.</p>
|
||||
|
||||
<p>See <a href="https://golang.org/cmd/trace/"><code>go</code> <code>tool</code> <code>trace</code></a>
|
||||
to collect and analyze runtime traces.
|
||||
</p>
|
||||
|
||||
<h3 id="godebug">GODEBUG</h3>
|
||||
|
||||
<p>Runtime also emits events and information if
|
||||
<a href="https://golang.org/pkg/runtime/#hdr-Environment_Variables">GODEBUG</a>
|
||||
environmental variable is set accordingly.</p>
|
||||
|
||||
<ul>
|
||||
<li>GODEBUG=gctrace=1 prints garbage collector events at
|
||||
each collection, summarizing the amount of memory collected
|
||||
and the length of the pause.</li>
|
||||
<li>GODEBUG=schedtrace=X prints scheduling events every X milliseconds.</li>
|
||||
</ul>
|
||||
|
||||
<p>The GODEBUG environmental variable can be used to disable use of
|
||||
instruction set extensions in the standard library and runtime.</p>
|
||||
|
||||
<ul>
|
||||
<li>GODEBUG=cpu.all=off disables the use of all optional
|
||||
instruction set extensions.</li>
|
||||
<li>GODEBUG=cpu.<em>extension</em>=off disables use of instructions from the
|
||||
specified instruction set extension.<br>
|
||||
<em>extension</em> is the lower case name for the instruction set extension
|
||||
such as <em>sse41</em> or <em>avx</em>.</li>
|
||||
</ul>
|
||||
199
doc/docs.html
Normal file
199
doc/docs.html
Normal file
@@ -0,0 +1,199 @@
|
||||
<!--{
|
||||
"Title": "Documentation",
|
||||
"Path": "/doc/"
|
||||
}-->
|
||||
|
||||
<p>
|
||||
The Go programming language is an open source project to make programmers more
|
||||
productive.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go is expressive, concise, clean, and efficient. Its concurrency
|
||||
mechanisms make it easy to write programs that get the most out of multicore
|
||||
and networked machines, while its novel type system enables flexible and
|
||||
modular program construction. Go compiles quickly to machine code yet has the
|
||||
convenience of garbage collection and the power of run-time reflection. It's a
|
||||
fast, statically typed, compiled language that feels like a dynamically typed,
|
||||
interpreted language.
|
||||
</p>
|
||||
|
||||
<div id="manual-nav"></div>
|
||||
|
||||
<h2>Installing Go</h2>
|
||||
|
||||
<h3><a href="/doc/install">Getting Started</a></h3>
|
||||
<p>
|
||||
Instructions for downloading and installing the Go compilers, tools, and
|
||||
libraries.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="learning">Learning Go</h2>
|
||||
|
||||
<img class="gopher" src="/doc/gopher/doc.png"/>
|
||||
|
||||
<h3 id="go_tour"><a href="//tour.golang.org/">A Tour of Go</a></h3>
|
||||
<p>
|
||||
An interactive introduction to Go in three sections.
|
||||
The first section covers basic syntax and data structures; the second discusses
|
||||
methods and interfaces; and the third introduces Go's concurrency primitives.
|
||||
Each section concludes with a few exercises so you can practice what you've
|
||||
learned. You can <a href="//tour.golang.org/">take the tour online</a> or
|
||||
<a href="//code.google.com/p/go-tour/">install it locally</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="code"><a href="code.html">How to write Go code</a></h3>
|
||||
<p>
|
||||
Also available as a
|
||||
<a href="//www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>, this doc
|
||||
explains how to use the <a href="/cmd/go/">go command</a> to fetch, build, and
|
||||
install packages, commands, and run tests.
|
||||
</p>
|
||||
|
||||
<h3 id="effective_go"><a href="effective_go.html">Effective Go</a></h3>
|
||||
<p>
|
||||
A document that gives tips for writing clear, idiomatic Go code.
|
||||
A must read for any new Go programmer. It augments the tour and
|
||||
the language specification, both of which should be read first.
|
||||
</p>
|
||||
|
||||
<h3 id="faq"><a href="/doc/faq">Frequently Asked Questions (FAQ)</a></h3>
|
||||
<p>
|
||||
Answers to common questions about Go.
|
||||
</p>
|
||||
|
||||
<h3 id="wiki"><a href="/wiki">The Go Wiki</a></h3>
|
||||
<p>A wiki maintained by the Go community.</p>
|
||||
|
||||
<h4 id="learn_more">More</h4>
|
||||
<p>
|
||||
See the <a href="/wiki/Learn">Learn</a> page at the <a href="/wiki">Wiki</a>
|
||||
for more Go learning resources.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="references">References</h2>
|
||||
|
||||
<h3 id="pkg"><a href="/pkg/">Package Documentation</a></h3>
|
||||
<p>
|
||||
The documentation for the Go standard library.
|
||||
</p>
|
||||
|
||||
<h3 id="cmd"><a href="/doc/cmd">Command Documentation</a></h3>
|
||||
<p>
|
||||
The documentation for the Go tools.
|
||||
</p>
|
||||
|
||||
<h3 id="spec"><a href="/ref/spec">Language Specification</a></h3>
|
||||
<p>
|
||||
The official Go Language specification.
|
||||
</p>
|
||||
|
||||
<h3 id="go_mem"><a href="/ref/mem">The Go Memory Model</a></h3>
|
||||
<p>
|
||||
A document that specifies the conditions under which reads of a variable in
|
||||
one goroutine can be guaranteed to observe values produced by writes to the
|
||||
same variable in a different goroutine.
|
||||
</p>
|
||||
|
||||
<h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3>
|
||||
<p>A summary of the changes between Go releases.</p>
|
||||
|
||||
|
||||
<h2 id="articles">Articles</h2>
|
||||
|
||||
<h3 id="blog"><a href="//blog.golang.org/">The Go Blog</a></h3>
|
||||
<p>The official blog of the Go project, featuring news and in-depth articles by
|
||||
the Go team and guests.</p>
|
||||
|
||||
<h4>Codewalks</h4>
|
||||
<p>
|
||||
Guided tours of Go programs.
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="/doc/codewalk/functions">First-Class Functions in Go</a></li>
|
||||
<li><a href="/doc/codewalk/markov">Generating arbitrary text: a Markov chain algorithm</a></li>
|
||||
<li><a href="/doc/codewalk/sharemem">Share Memory by Communicating</a></li>
|
||||
<li><a href="/doc/articles/wiki/">Writing Web Applications</a> - building a simple web application.</li>
|
||||
</ul>
|
||||
|
||||
<h4>Language</h4>
|
||||
<ul>
|
||||
<li><a href="/blog/json-rpc-tale-of-interfaces">JSON-RPC: a tale of interfaces</a></li>
|
||||
<li><a href="/blog/gos-declaration-syntax">Go's Declaration Syntax</a></li>
|
||||
<li><a href="/blog/defer-panic-and-recover">Defer, Panic, and Recover</a></li>
|
||||
<li><a href="/blog/go-concurrency-patterns-timing-out-and">Go Concurrency Patterns: Timing out, moving on</a></li>
|
||||
<li><a href="/blog/go-slices-usage-and-internals">Go Slices: usage and internals</a></li>
|
||||
<li><a href="/blog/gif-decoder-exercise-in-go-interfaces">A GIF decoder: an exercise in Go interfaces</a></li>
|
||||
<li><a href="/blog/error-handling-and-go">Error Handling and Go</a></li>
|
||||
<li><a href="/blog/organizing-go-code">Organizing Go code</a></li>
|
||||
</ul>
|
||||
|
||||
<h4>Packages</h4>
|
||||
<ul>
|
||||
<li><a href="/blog/json-and-go">JSON and Go</a> - using the <a href="/pkg/encoding/json/">json</a> package.</li>
|
||||
<li><a href="/blog/gobs-of-data">Gobs of data</a> - the design and use of the <a href="/pkg/encoding/gob/">gob</a> package.</li>
|
||||
<li><a href="/blog/laws-of-reflection">The Laws of Reflection</a> - the fundamentals of the <a href="/pkg/reflect/">reflect</a> package.</li>
|
||||
<li><a href="/blog/go-image-package">The Go image package</a> - the fundamentals of the <a href="/pkg/image/">image</a> package.</li>
|
||||
<li><a href="/blog/go-imagedraw-package">The Go image/draw package</a> - the fundamentals of the <a href="/pkg/image/draw/">image/draw</a> package.</li>
|
||||
</ul>
|
||||
|
||||
<h4>Tools</h4>
|
||||
<ul>
|
||||
<li><a href="/doc/articles/go_command.html">About the Go command</a> - why we wrote it, what it is, what it's not, and how to use it.</li>
|
||||
<li><a href="/blog/c-go-cgo">C? Go? Cgo!</a> - linking against C code with <a href="/cmd/cgo/">cgo</a>.</li>
|
||||
<li><a href="/doc/gdb">Debugging Go Code with GDB</a></li>
|
||||
<li><a href="/blog/godoc-documenting-go-code">Godoc: documenting Go code</a> - writing good documentation for <a href="/cmd/godoc/">godoc</a>.</li>
|
||||
<li><a href="/blog/profiling-go-programs">Profiling Go Programs</a></li>
|
||||
<li><a href="/doc/articles/race_detector.html">Data Race Detector</a> - a manual for the data race detector.</li>
|
||||
<li><a href="/blog/race-detector">Introducing the Go Race Detector</a> - an introduction to the race detector.</li>
|
||||
<li><a href="/doc/asm">A Quick Guide to Go's Assembler</a> - an introduction to the assembler used by Go.</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="articles_more">More</h4>
|
||||
<p>
|
||||
See the <a href="/wiki/Articles">Articles page</a> at the
|
||||
<a href="/wiki">Wiki</a> for more Go articles.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="talks">Talks</h2>
|
||||
|
||||
<img class="gopher" src="/doc/gopher/talks.png"/>
|
||||
|
||||
<h3 id="video_tour_of_go"><a href="http://research.swtch.com/gotour">A Video Tour of Go</a></h3>
|
||||
<p>
|
||||
Three things that make Go fast, fun, and productive:
|
||||
interfaces, reflection, and concurrency. Builds a toy web crawler to
|
||||
demonstrate these.
|
||||
</p>
|
||||
|
||||
<h3 id="go_code_that_grows"><a href="//vimeo.com/53221560">Code that grows with grace</a></h3>
|
||||
<p>
|
||||
One of Go's key design goals is code adaptability; that it should be easy to take a simple design and build upon it in a clean and natural way. In this talk Andrew Gerrand describes a simple "chat roulette" server that matches pairs of incoming TCP connections, and then use Go's concurrency mechanisms, interfaces, and standard library to extend it with a web interface and other features. While the function of the program changes dramatically, Go's flexibility preserves the original design as it grows.
|
||||
</p>
|
||||
|
||||
<h3 id="go_concurrency_patterns"><a href="//www.youtube.com/watch?v=f6kdp27TYZs">Go Concurrency Patterns</a></h3>
|
||||
<p>
|
||||
Concurrency is the key to designing high performance network services. Go's concurrency primitives (goroutines and channels) provide a simple and efficient means of expressing concurrent execution. In this talk we see how tricky concurrency problems can be solved gracefully with simple Go code.
|
||||
</p>
|
||||
|
||||
<h3 id="advanced_go_concurrency_patterns"><a href="//www.youtube.com/watch?v=QDDwwePbDtw">Advanced Go Concurrency Patterns</a></h3>
|
||||
<p>
|
||||
This talk expands on the <i>Go Concurrency Patterns</i> talk to dive deeper into Go's concurrency primitives.
|
||||
</p>
|
||||
|
||||
<h4 id="talks_more">More</h4>
|
||||
<p>
|
||||
See the <a href="/talks">Go Talks site</a> and <a href="/wiki/GoTalks">wiki page</a> for more Go talks.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="nonenglish">Non-English Documentation</h2>
|
||||
|
||||
<p>
|
||||
See the <a href="/wiki/NonEnglish">NonEnglish</a> page
|
||||
at the <a href="/wiki">Wiki</a> for localized
|
||||
documentation.
|
||||
</p>
|
||||
@@ -1,35 +0,0 @@
|
||||
<!--{
|
||||
"Title": "Editor plugins and IDEs",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
|
||||
<p>
|
||||
This document lists commonly used editor plugins and IDEs from the Go ecosystem
|
||||
that make Go development more productive and seamless.
|
||||
A comprehensive list of editor support and IDEs for Go development is available at
|
||||
<a href="https://golang.org/wiki/IDEsAndTextEditorPlugins">the wiki</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="options">Options</h2>
|
||||
<p>
|
||||
The Go ecosystem provides a variety of editor plugins and IDEs to enhance your day-to-day
|
||||
editing, navigation, testing, and debugging experience.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://github.com/fatih/vim-go">vim</a>: vim-go plugin provides Go programming language support</li>
|
||||
<li><a href="https://marketplace.visualstudio.com/items?itemName=golang.go">Visual Studio Code</a>:
|
||||
Go extension provides support for the Go programming language</li>
|
||||
<li><a href="https://www.jetbrains.com/go">GoLand</a>: GoLand is distributed either as a standalone IDE
|
||||
or as a plugin for IntelliJ IDEA Ultimate</li>
|
||||
<li><a href="https://atom.io/packages/go-plus">Atom</a>: Go-Plus is an Atom package that provides enhanced Go support</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Note that these are only a few top solutions; a more comprehensive
|
||||
community-maintained list of
|
||||
<a href="https://github.com/golang/go/wiki/IDEsAndTextEditorPlugins">IDEs and text editor plugins</a>
|
||||
is available at the Wiki.
|
||||
</p>
|
||||
@@ -245,17 +245,15 @@ func Compile(str string) (*Regexp, error) {
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If every doc comment begins with the name of the item it describes,
|
||||
you can use the <a href="/cmd/go/#hdr-Show_documentation_for_package_or_symbol">doc</a>
|
||||
subcommand of the <a href="/cmd/go/">go</a> tool
|
||||
and run the output through <code>grep</code>.
|
||||
If the name always begins the comment, the output of <code>godoc</code>
|
||||
can usefully be run through <code>grep</code>.
|
||||
Imagine you couldn't remember the name "Compile" but were looking for
|
||||
the parsing function for regular expressions, so you ran
|
||||
the command,
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go doc -all regexp | grep -i parse
|
||||
$ godoc regexp | grep parse
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -266,10 +264,10 @@ which recalls the word you're looking for.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go doc -all regexp | grep -i parse
|
||||
$ godoc regexp | grep parse
|
||||
Compile parses a regular expression and returns, if successful, a Regexp
|
||||
MustCompile is like Compile but panics if the expression cannot be parsed.
|
||||
parsed. It simplifies safe initialization of global variables holding
|
||||
cannot be parsed. It simplifies safe initialization of global variables
|
||||
$
|
||||
</pre>
|
||||
|
||||
@@ -624,7 +622,7 @@ if it has already been declared, provided:
|
||||
<li>this declaration is in the same scope as the existing declaration of <code>v</code>
|
||||
(if <code>v</code> is already declared in an outer scope, the declaration will create a new variable §),</li>
|
||||
<li>the corresponding value in the initialization is assignable to <code>v</code>, and</li>
|
||||
<li>there is at least one other variable that is created by the declaration.</li>
|
||||
<li>there is at least one other variable in the declaration that is being declared anew.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
@@ -1404,11 +1402,11 @@ the moment, the following snippet would also read the first 32 bytes of the buff
|
||||
var err error
|
||||
for i := 0; i < 32; i++ {
|
||||
nbytes, e := f.Read(buf[i:i+1]) // Read one byte.
|
||||
n += nbytes
|
||||
if nbytes == 0 || e != nil {
|
||||
err = e
|
||||
break
|
||||
}
|
||||
n += nbytes
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
@@ -1433,7 +1431,9 @@ func Append(slice, data []byte) []byte {
|
||||
slice = newSlice
|
||||
}
|
||||
slice = slice[0:l+len(data)]
|
||||
copy(slice[l:], data)
|
||||
for i, c := range data {
|
||||
slice[l+i] = c
|
||||
}
|
||||
return slice
|
||||
}
|
||||
</pre>
|
||||
@@ -1521,7 +1521,7 @@ for i := range picture {
|
||||
<p>
|
||||
Maps are a convenient and powerful built-in data structure that associate
|
||||
values of one type (the <em>key</em>) with values of another type
|
||||
(the <em>element</em> or <em>value</em>).
|
||||
(the <em>element</em> or <em>value</em>)
|
||||
The key can be of any type for which the equality operator is defined,
|
||||
such as integers,
|
||||
floating point and complex numbers,
|
||||
@@ -1580,7 +1580,7 @@ if attended[person] { // will be false if person is not in the map
|
||||
<p>
|
||||
Sometimes you need to distinguish a missing entry from
|
||||
a zero value. Is there an entry for <code>"UTC"</code>
|
||||
or is that 0 because it's not in the map at all?
|
||||
or is that the empty string because it's not in the map at all?
|
||||
You can discriminate with a form of multiple assignment.
|
||||
</p>
|
||||
<pre>
|
||||
@@ -1680,15 +1680,13 @@ maps. Here is a print statement for the time zone map defined in the previous s
|
||||
fmt.Printf("%v\n", timeZone) // or just fmt.Println(timeZone)
|
||||
</pre>
|
||||
<p>
|
||||
which gives output:
|
||||
which gives output
|
||||
</p>
|
||||
<pre>
|
||||
map[CST:-21600 EST:-18000 MST:-25200 PST:-28800 UTC:0]
|
||||
map[CST:-21600 PST:-28800 EST:-18000 UTC:0 MST:-25200]
|
||||
</pre>
|
||||
<p>
|
||||
For maps, <code>Printf</code> and friends sort the output lexicographically by key.
|
||||
</p>
|
||||
<p>
|
||||
For maps the keys may be output in any order, of course.
|
||||
When printing a struct, the modified format <code>%+v</code> annotates the
|
||||
fields of the structure with their names, and for any value the alternate
|
||||
format <code>%#v</code> prints the value in full Go syntax.
|
||||
@@ -1712,7 +1710,7 @@ prints
|
||||
&{7 -2.35 abc def}
|
||||
&{a:7 b:-2.35 c:abc def}
|
||||
&main.T{a:7, b:-2.35, c:"abc\tdef"}
|
||||
map[string]int{"CST":-21600, "EST":-18000, "MST":-25200, "PST":-28800, "UTC":0}
|
||||
map[string] int{"CST":-21600, "PST":-28800, "EST":-18000, "UTC":0, "MST":-25200}
|
||||
</pre>
|
||||
<p>
|
||||
(Note the ampersands.)
|
||||
@@ -1735,7 +1733,7 @@ fmt.Printf("%T\n", timeZone)
|
||||
prints
|
||||
</p>
|
||||
<pre>
|
||||
map[string]int
|
||||
map[string] int
|
||||
</pre>
|
||||
<p>
|
||||
If you want to control the default format for a custom type, all that's required is to define
|
||||
@@ -1835,7 +1833,7 @@ for a min function that chooses the least of a list of integers:
|
||||
</p>
|
||||
<pre>
|
||||
func Min(a ...int) int {
|
||||
min := int(^uint(0) >> 1) // largest int
|
||||
min := int(^uint(0) >> 1) // largest int
|
||||
for _, i := range a {
|
||||
if i < min {
|
||||
min = i
|
||||
@@ -2108,14 +2106,12 @@ In this contrived example <code>Sequence</code> satisfies both.
|
||||
|
||||
<p>
|
||||
The <code>String</code> method of <code>Sequence</code> is recreating the
|
||||
work that <code>Sprint</code> already does for slices.
|
||||
(It also has complexity O(N²), which is poor.) We can share the
|
||||
effort (and also speed it up) if we convert the <code>Sequence</code> to a plain
|
||||
work that <code>Sprint</code> already does for slices. We can share the
|
||||
effort if we convert the <code>Sequence</code> to a plain
|
||||
<code>[]int</code> before calling <code>Sprint</code>.
|
||||
</p>
|
||||
<pre>
|
||||
func (s Sequence) String() string {
|
||||
s = s.Copy()
|
||||
sort.Sort(s)
|
||||
return fmt.Sprint([]int(s))
|
||||
}
|
||||
@@ -2142,7 +2138,6 @@ type Sequence []int
|
||||
|
||||
// Method for printing - sorts the elements before printing
|
||||
func (s Sequence) String() string {
|
||||
s = s.Copy()
|
||||
sort.IntSlice(s).Sort()
|
||||
return fmt.Sprint([]int(s))
|
||||
}
|
||||
@@ -2282,8 +2277,8 @@ The <code>crypto/cipher</code> interfaces look like this:
|
||||
<pre>
|
||||
type Block interface {
|
||||
BlockSize() int
|
||||
Encrypt(dst, src []byte)
|
||||
Decrypt(dst, src []byte)
|
||||
Encrypt(src, dst []byte)
|
||||
Decrypt(src, dst []byte)
|
||||
}
|
||||
|
||||
type Stream interface {
|
||||
@@ -2336,9 +2331,10 @@ of the request from the client.
|
||||
</p>
|
||||
<p>
|
||||
For brevity, let's ignore POSTs and assume HTTP requests are always
|
||||
GETs; that simplification does not affect the way the handlers are set up.
|
||||
Here's a trivial implementation of a handler to count the number of times
|
||||
the page is visited.
|
||||
GETs; that simplification does not affect the way the handlers are
|
||||
set up. Here's a trivial but complete implementation of a handler to
|
||||
count the number of times the
|
||||
page is visited.
|
||||
</p>
|
||||
<pre>
|
||||
// Simple counter server.
|
||||
@@ -2354,11 +2350,6 @@ func (ctr *Counter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
<p>
|
||||
(Keeping with our theme, note how <code>Fprintf</code> can print to an
|
||||
<code>http.ResponseWriter</code>.)
|
||||
In a real server, access to <code>ctr.n</code> would need protection from
|
||||
concurrent access.
|
||||
See the <code>sync</code> and <code>atomic</code> packages for suggestions.
|
||||
</p>
|
||||
<p>
|
||||
For reference, here's how to attach such a server to a node on the URL tree.
|
||||
</p>
|
||||
<pre>
|
||||
@@ -2418,7 +2409,7 @@ The <code>http</code> package contains this code:
|
||||
// Handler object that calls f.
|
||||
type HandlerFunc func(ResponseWriter, *Request)
|
||||
|
||||
// ServeHTTP calls f(w, req).
|
||||
// ServeHTTP calls f(c, req).
|
||||
func (f HandlerFunc) ServeHTTP(w ResponseWriter, req *Request) {
|
||||
f(w, req)
|
||||
}
|
||||
@@ -2456,7 +2447,7 @@ the handler installed at that page has value <code>ArgServer</code>
|
||||
and type <code>HandlerFunc</code>.
|
||||
The HTTP server will invoke the method <code>ServeHTTP</code>
|
||||
of that type, with <code>ArgServer</code> as the receiver, which will in turn call
|
||||
<code>ArgServer</code> (via the invocation <code>f(w, req)</code>
|
||||
<code>ArgServer</code> (via the invocation <code>f(c, req)</code>
|
||||
inside <code>HandlerFunc.ServeHTTP</code>).
|
||||
The arguments will then be displayed.
|
||||
</p>
|
||||
@@ -2699,7 +2690,8 @@ type ReadWriter interface {
|
||||
<p>
|
||||
This says just what it looks like: A <code>ReadWriter</code> can do
|
||||
what a <code>Reader</code> does <em>and</em> what a <code>Writer</code>
|
||||
does; it is a union of the embedded interfaces.
|
||||
does; it is a union of the embedded interfaces (which must be disjoint
|
||||
sets of methods).
|
||||
Only interfaces can be embedded within interfaces.
|
||||
</p>
|
||||
<p>
|
||||
@@ -2772,7 +2764,7 @@ type Job struct {
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
The <code>Job</code> type now has the <code>Print</code>, <code>Printf</code>, <code>Println</code>
|
||||
The <code>Job</code> type now has the <code>Log</code>, <code>Logf</code>
|
||||
and other
|
||||
methods of <code>*log.Logger</code>. We could have given the <code>Logger</code>
|
||||
a field name, of course, but it's not necessary to do so. And now, once
|
||||
@@ -2780,7 +2772,7 @@ initialized, we can
|
||||
log to the <code>Job</code>:
|
||||
</p>
|
||||
<pre>
|
||||
job.Println("starting now...")
|
||||
job.Log("starting now...")
|
||||
</pre>
|
||||
<p>
|
||||
The <code>Logger</code> is a regular field of the <code>Job</code> struct,
|
||||
@@ -2800,15 +2792,15 @@ job := &Job{command, log.New(os.Stderr, "Job: ", log.Ldate)}
|
||||
<p>
|
||||
If we need to refer to an embedded field directly, the type name of the field,
|
||||
ignoring the package qualifier, serves as a field name, as it did
|
||||
in the <code>Read</code> method of our <code>ReadWriter</code> struct.
|
||||
in the <code>Read</code> method of our <code>ReaderWriter</code> struct.
|
||||
Here, if we needed to access the
|
||||
<code>*log.Logger</code> of a <code>Job</code> variable <code>job</code>,
|
||||
we would write <code>job.Logger</code>,
|
||||
which would be useful if we wanted to refine the methods of <code>Logger</code>.
|
||||
</p>
|
||||
<pre>
|
||||
func (job *Job) Printf(format string, args ...interface{}) {
|
||||
job.Logger.Printf("%q: %s", job.Command, fmt.Sprintf(format, args...))
|
||||
func (job *Job) Logf(format string, args ...interface{}) {
|
||||
job.Logger.Logf("%q: %s", job.Command, fmt.Sprintf(format, args...))
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
@@ -3598,7 +3590,8 @@ That's left as an exercise for the reader.
|
||||
<p>
|
||||
Let's finish with a complete Go program, a web server.
|
||||
This one is actually a kind of web re-server.
|
||||
Google provides a service at <code>chart.apis.google.com</code>
|
||||
Google provides a service at
|
||||
<a href="http://chart.apis.google.com">http://chart.apis.google.com</a>
|
||||
that does automatic formatting of data into charts and graphs.
|
||||
It's hard to use interactively, though,
|
||||
because you need to put the data into the URL as a query.
|
||||
|
||||
@@ -12,7 +12,7 @@ information on building gccgo for yourself,
|
||||
see <a href="/doc/gccgo_install.html">Setting up and using gccgo</a>.
|
||||
For more of the gritty details on the process of doing development
|
||||
with the gccgo frontend,
|
||||
see <a href="https://go.googlesource.com/gofrontend/+/master/HACKING">the
|
||||
see <a href="https://code.google.com/p/gofrontend/source/browse/HACKING">the
|
||||
file HACKING</a> in the gofrontend repository.
|
||||
</p>
|
||||
|
||||
@@ -22,7 +22,7 @@ file HACKING</a> in the gofrontend repository.
|
||||
You must follow the <a href="/doc/contribute.html#copyright">Go copyright
|
||||
rules</a> for all changes to the gccgo frontend and the associated
|
||||
libgo library. Code that is part of GCC rather than gccgo must follow
|
||||
the general <a href="https://gcc.gnu.org/contribute.html">GCC
|
||||
the general <a href="http://gcc.gnu.org/contribute.html">GCC
|
||||
contribution rules</a>.
|
||||
</p>
|
||||
|
||||
@@ -30,9 +30,9 @@ contribution rules</a>.
|
||||
|
||||
<p>
|
||||
The master sources for the gccgo frontend may be found at
|
||||
<a href="https://go.googlesource.com/gofrontend">https://go.googlesource.com/gofrontend</a>.
|
||||
<a href="http://go.googlesource.com/gofrontend">http://go.googlesource.com/gofrontend</a>.
|
||||
They are mirrored
|
||||
at <a href="https://github.com/golang/gofrontend">https://github.com/golang/gofrontend</a>.
|
||||
at <a href="http://github.com/golang/gofrontend">http://github.com/golang/gofrontend</a>.
|
||||
The master sources are not buildable by themselves, but only in
|
||||
conjunction with GCC (in the future, other compilers may be
|
||||
supported). Changes made to the gccgo frontend are also applied to
|
||||
@@ -105,7 +105,7 @@ or <code>gcc/testsuite/go.dg</code> directories in the GCC repository.
|
||||
<p>
|
||||
Changes to the Go frontend should follow the same process as for the
|
||||
main Go repository, only for the <code>gofrontend</code> project and
|
||||
the <code>gofrontend-dev@googlegroups.com</code> mailing list
|
||||
the <code>gofrontend-dev@googlegroups.com</code> mailing list
|
||||
rather than the <code>go</code> project and the
|
||||
<code>golang-dev@googlegroups.com</code> mailing list. Those changes
|
||||
will then be merged into the GCC sources.
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
<p>
|
||||
This document explains how to use gccgo, a compiler for
|
||||
the Go language. The gccgo compiler is a new frontend
|
||||
for GCC, the widely used GNU compiler. Although the
|
||||
the Go language. The gccgo compiler is a new frontend
|
||||
for GCC, the widely used GNU compiler. Although the
|
||||
frontend itself is under a BSD-style license, gccgo is
|
||||
normally used as part of GCC and is then covered by
|
||||
the <a href="https://www.gnu.org/licenses/gpl.html">GNU General Public
|
||||
the <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public
|
||||
License</a> (the license covers gccgo itself as part of GCC; it
|
||||
does not cover code generated by gccgo).
|
||||
</p>
|
||||
@@ -24,10 +24,10 @@ compiler.
|
||||
|
||||
<p>
|
||||
The simplest way to install gccgo is to install a GCC binary release
|
||||
built to include Go support. GCC binary releases are available from
|
||||
<a href="https://gcc.gnu.org/install/binaries.html">various
|
||||
built to include Go support. GCC binary releases are available from
|
||||
<a href="http://gcc.gnu.org/install/binaries.html">various
|
||||
websites</a> and are typically included as part of GNU/Linux
|
||||
distributions. We expect that most people who build these binaries
|
||||
distributions. We expect that most people who build these binaries
|
||||
will include Go support.
|
||||
</p>
|
||||
|
||||
@@ -38,7 +38,7 @@ The GCC 4.7.1 release and all later 4.7 releases include a complete
|
||||
|
||||
<p>
|
||||
Due to timing, the GCC 4.8.0 and 4.8.1 releases are close to but not
|
||||
identical to Go 1.1. The GCC 4.8.2 release includes a complete Go
|
||||
identical to Go 1.1. The GCC 4.8.2 release includes a complete Go
|
||||
1.1.2 implementation.
|
||||
</p>
|
||||
|
||||
@@ -48,51 +48,29 @@ The GCC 4.9 releases include a complete Go 1.2 implementation.
|
||||
|
||||
<p>
|
||||
The GCC 5 releases include a complete implementation of the Go 1.4
|
||||
user libraries. The Go 1.4 runtime is not fully merged, but that
|
||||
user libraries. The Go 1.4 runtime is not fully merged, but that
|
||||
should not be visible to Go programs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GCC 6 releases include a complete implementation of the Go 1.6.1
|
||||
user libraries. The Go 1.6 runtime is not fully merged, but that
|
||||
should not be visible to Go programs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GCC 7 releases include a complete implementation of the Go 1.8.1
|
||||
user libraries. As with earlier releases, the Go 1.8 runtime is not
|
||||
fully merged, but that should not be visible to Go programs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GCC 8 releases include a complete implementation of the Go 1.10.1
|
||||
release. The Go 1.10 runtime has now been fully merged into the GCC
|
||||
development sources, and concurrent garbage collection is fully
|
||||
supported.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GCC 9 releases include a complete implementation of the Go 1.12.2
|
||||
release.
|
||||
</p>
|
||||
|
||||
<h2 id="Source_code">Source code</h2>
|
||||
|
||||
<p>
|
||||
If you cannot use a release, or prefer to build gccgo for yourself, the
|
||||
gccgo source code is accessible via Git. The GCC web site has
|
||||
<a href="https://gcc.gnu.org/git.html">instructions for getting the GCC
|
||||
source code</a>. The gccgo source code is included. As a convenience, a
|
||||
stable version of the Go support is available in the
|
||||
<code>devel/gccgo</code> branch of the main GCC code repository:
|
||||
<code>git://gcc.gnu.org/git/gcc.git</code>.
|
||||
If you cannot use a release, or prefer to build gccgo for
|
||||
yourself,
|
||||
the gccgo source code is accessible via Subversion. The
|
||||
GCC web site
|
||||
has <a href="http://gcc.gnu.org/svn.html">instructions for getting the
|
||||
GCC source code</a>. The gccgo source code is included. As a
|
||||
convenience, a stable version of the Go support is available in
|
||||
a branch of the main GCC code
|
||||
repository: <code>svn://gcc.gnu.org/svn/gcc/branches/gccgo</code>.
|
||||
This branch is periodically updated with stable Go compiler sources.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that although <code>gcc.gnu.org</code> is the most convenient way
|
||||
to get the source code for the Go frontend, it is not where the master
|
||||
sources live. If you want to contribute changes to the Go frontend
|
||||
sources live. If you want to contribute changes to the Go frontend
|
||||
compiler, see <a href="/doc/gccgo_contribute.html">Contributing to
|
||||
gccgo</a>.
|
||||
</p>
|
||||
@@ -102,16 +80,16 @@ gccgo</a>.
|
||||
|
||||
<p>
|
||||
Building gccgo is just like building GCC
|
||||
with one or two additional options. See
|
||||
the <a href="https://gcc.gnu.org/install/">instructions on the gcc web
|
||||
site</a>. When you run <code>configure</code>, add the
|
||||
with one or two additional options. See
|
||||
the <a href="http://gcc.gnu.org/install/">instructions on the gcc web
|
||||
site</a>. When you run <code>configure</code>, add the
|
||||
option <code>--enable-languages=c,c++,go</code> (along with other
|
||||
languages you may want to build). If you are targeting a 32-bit x86,
|
||||
languages you may want to build). If you are targeting a 32-bit x86,
|
||||
then you will want to build gccgo to default to
|
||||
supporting locked compare and exchange instructions; do this by also
|
||||
using the <code>configure</code> option <code>--with-arch=i586</code>
|
||||
(or a newer architecture, depending on where you need your programs to
|
||||
run). If you are targeting a 64-bit x86, but sometimes want to use
|
||||
run). If you are targeting a 64-bit x86, but sometimes want to use
|
||||
the <code>-m32</code> option, then use the <code>configure</code>
|
||||
option <code>--with-arch-32=i586</code>.
|
||||
</p>
|
||||
@@ -120,27 +98,30 @@ option <code>--with-arch-32=i586</code>.
|
||||
|
||||
<p>
|
||||
On x86 GNU/Linux systems the gccgo compiler is able to
|
||||
use a small discontiguous stack for goroutines. This permits programs
|
||||
use a small discontiguous stack for goroutines. This permits programs
|
||||
to run many more goroutines, since each goroutine can use a relatively
|
||||
small stack. Doing this requires using the gold linker version 2.22
|
||||
or later. You can either install GNU binutils 2.22 or later, or you
|
||||
small stack. Doing this requires using the gold linker version 2.22
|
||||
or later. You can either install GNU binutils 2.22 or later, or you
|
||||
can build gold yourself.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To build gold yourself, build the GNU binutils,
|
||||
using <code>--enable-gold=default</code> when you run
|
||||
the <code>configure</code> script. Before building, you must install
|
||||
the flex and bison packages. A typical sequence would look like
|
||||
the <code>configure</code> script. Before building, you must install
|
||||
the flex and bison packages. A typical sequence would look like
|
||||
this (you can replace <code>/opt/gold</code> with any directory to
|
||||
which you have write access):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
git clone git://sourceware.org/git/binutils-gdb.git
|
||||
cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login
|
||||
[password is "anoncvs"]
|
||||
[The next command will create a directory named src, not binutils]
|
||||
cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
|
||||
mkdir binutils-objdir
|
||||
cd binutils-objdir
|
||||
../binutils-gdb/configure --enable-gold=default --prefix=/opt/gold
|
||||
../src/configure --enable-gold=default --prefix=/opt/gold
|
||||
make
|
||||
make install
|
||||
</pre>
|
||||
@@ -155,8 +136,8 @@ option <code>--with-ld=<var>GOLD_BINARY</var></code>.
|
||||
<p>
|
||||
A number of prerequisites are required to build GCC, as
|
||||
described on
|
||||
the <a href="https://gcc.gnu.org/install/prerequisites.html">gcc web
|
||||
site</a>. It is important to install all the prerequisites before
|
||||
the <a href="http://gcc.gnu.org/install/prerequisites.html">gcc web
|
||||
site</a>. It is important to install all the prerequisites before
|
||||
running the gcc <code>configure</code> script.
|
||||
The prerequisite libraries can be conveniently downloaded using the
|
||||
script <code>contrib/download_prerequisites</code> in the GCC sources.
|
||||
@@ -171,7 +152,7 @@ described above):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
git clone --branch devel/gccgo git://gcc.gnu.org/git/gcc.git gccgo
|
||||
svn checkout svn://gcc.gnu.org/svn/gcc/branches/gccgo gccgo
|
||||
mkdir objdir
|
||||
cd objdir
|
||||
../gccgo/configure --prefix=/opt/gccgo --enable-languages=c,c++,go --with-ld=/opt/gold/bin/ld
|
||||
@@ -179,10 +160,27 @@ make
|
||||
make install
|
||||
</pre>
|
||||
|
||||
<h3 id="Ubuntu">A note on Ubuntu</h3>
|
||||
|
||||
<p>
|
||||
Current versions of Ubuntu and versions of GCC before 4.8 disagree on
|
||||
where system libraries and header files are found. This is not a
|
||||
gccgo issue. When building older versions of GCC, setting these
|
||||
environment variables while configuring and building gccgo may fix the
|
||||
problem.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
|
||||
C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
|
||||
CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
|
||||
export LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH
|
||||
</pre>
|
||||
|
||||
<h2 id="Using_gccgo">Using gccgo</h2>
|
||||
|
||||
<p>
|
||||
The gccgo compiler works like other gcc frontends. As of GCC 5 the gccgo
|
||||
The gccgo compiler works like other gcc frontends. As of GCC 5 the gccgo
|
||||
installation also includes a version of the <code>go</code> command,
|
||||
which may be used to build Go programs as described at
|
||||
<a href="https://golang.org/cmd/go">https://golang.org/cmd/go</a>.
|
||||
@@ -207,7 +205,7 @@ gccgo -o file file.o
|
||||
|
||||
<p>
|
||||
To run the resulting file, you will need to tell the program where to
|
||||
find the compiled Go packages. There are a few ways to do this:
|
||||
find the compiled Go packages. There are a few ways to do this:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
@@ -225,11 +223,11 @@ export LD_LIBRARY_PATH
|
||||
|
||||
<p>
|
||||
Here <code>${prefix}</code> is the <code>--prefix</code> option used
|
||||
when building gccgo. For a binary install this is
|
||||
normally <code>/usr</code>. Whether to use <code>lib</code>
|
||||
when building gccgo. For a binary install this is
|
||||
normally <code>/usr</code>. Whether to use <code>lib</code>
|
||||
or <code>lib64</code> depends on the target.
|
||||
Typically <code>lib64</code> is correct for x86_64 systems,
|
||||
and <code>lib</code> is correct for other systems. The idea is to
|
||||
and <code>lib</code> is correct for other systems. The idea is to
|
||||
name the directory where <code>libgo.so</code> is found.
|
||||
</p>
|
||||
|
||||
@@ -324,9 +322,9 @@ objcopy -j .go_export FILE.o FILE.gox
|
||||
|
||||
<p>
|
||||
The gccgo compiler will look in the current
|
||||
directory for import files. In more complex scenarios you
|
||||
directory for import files. In more complex scenarios you
|
||||
may pass the <code>-I</code> or <code>-L</code> option to
|
||||
gccgo. Both options take directories to search. The
|
||||
gccgo. Both options take directories to search. The
|
||||
<code>-L</code> option is also passed to the linker.
|
||||
</p>
|
||||
|
||||
@@ -347,11 +345,11 @@ gccgo -o main main.o mypackage.o # Explicitly links with mypackage.o
|
||||
|
||||
<p>
|
||||
If you use the <code>-g</code> option when you compile, you can run
|
||||
<code>gdb</code> on your executable. The debugger has only limited
|
||||
knowledge about Go. You can set breakpoints, single-step,
|
||||
etc. You can print variables, but they will be printed as though they
|
||||
had C/C++ types. For numeric types this doesn't matter. Go strings
|
||||
and interfaces will show up as two-element structures. Go
|
||||
<code>gdb</code> on your executable. The debugger has only limited
|
||||
knowledge about Go. You can set breakpoints, single-step,
|
||||
etc. You can print variables, but they will be printed as though they
|
||||
had C/C++ types. For numeric types this doesn't matter. Go strings
|
||||
and interfaces will show up as two-element structures. Go
|
||||
maps and channels are always represented as C pointers to run-time
|
||||
structures.
|
||||
</p>
|
||||
@@ -366,15 +364,12 @@ or with C++ code compiled using <code>extern "C"</code>.
|
||||
<h3 id="Types">Types</h3>
|
||||
|
||||
<p>
|
||||
Basic types map directly: an <code>int32</code> in Go is
|
||||
an <code>int32_t</code> in C, an <code>int64</code> is
|
||||
an <code>int64_t</code>, etc.
|
||||
The Go type <code>int</code> is an integer that is the same size as a
|
||||
pointer, and as such corresponds to the C type <code>intptr_t</code>.
|
||||
Go <code>byte</code> is equivalent to C <code>unsigned char</code>.
|
||||
Pointers in Go are pointers in C.
|
||||
A Go <code>struct</code> is the same as C <code>struct</code> with the
|
||||
same fields and types.
|
||||
Basic types map directly: an <code>int</code> in Go is an <code>int</code>
|
||||
in C, an <code>int32</code> is an <code>int32_t</code>,
|
||||
etc. Go <code>byte</code> is equivalent to C <code>unsigned
|
||||
char</code>.
|
||||
Pointers in Go are pointers in C. A Go <code>struct</code> is the same as C
|
||||
<code>struct</code> with the same fields and types.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -385,7 +380,7 @@ structure (this is <b style="color: red;">subject to change</b>):
|
||||
<pre>
|
||||
struct __go_string {
|
||||
const unsigned char *__data;
|
||||
intptr_t __length;
|
||||
int __length;
|
||||
};
|
||||
</pre>
|
||||
|
||||
@@ -398,29 +393,29 @@ assuming that the C pointer does point to 10 elements.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A slice in Go is a structure. The current definition is
|
||||
A slice in Go is a structure. The current definition is
|
||||
(this is <b style="color: red;">subject to change</b>):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
struct __go_slice {
|
||||
void *__values;
|
||||
intptr_t __count;
|
||||
intptr_t __capacity;
|
||||
int __count;
|
||||
int __capacity;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The type of a Go function is a pointer to a struct (this is
|
||||
<b style="color: red;">subject to change</b>). The first field in the
|
||||
<b style="color: red;">subject to change</b>). The first field in the
|
||||
struct points to the code of the function, which will be equivalent to
|
||||
a pointer to a C function whose parameter types are equivalent, with
|
||||
an additional trailing parameter. The trailing parameter is the
|
||||
an additional trailing parameter. The trailing parameter is the
|
||||
closure, and the argument to pass is a pointer to the Go function
|
||||
struct.
|
||||
|
||||
When a Go function returns more than one value, the C function returns
|
||||
a struct. For example, these functions are roughly equivalent:
|
||||
a struct. For example, these functions are roughly equivalent:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -457,7 +452,7 @@ pointer while the C function is still using it.
|
||||
<p>
|
||||
Go code can call C functions directly using a Go extension implemented
|
||||
in gccgo: a function declaration may be preceded by
|
||||
<code>//extern NAME</code>. For example, here is how the C function
|
||||
<code>//extern NAME</code>. For example, here is how the C function
|
||||
<code>open</code> can be declared in Go:
|
||||
</p>
|
||||
|
||||
@@ -517,11 +512,11 @@ the <code>-gccgo</code> option instead.
|
||||
|
||||
<p>
|
||||
Compile your C code as usual, and add the option
|
||||
<code>-fdump-go-spec=<var>FILENAME</var></code>. This will create the
|
||||
<code>-fdump-go-spec=<var>FILENAME</var></code>. This will create the
|
||||
file <code><var>FILENAME</var></code> as a side effect of the
|
||||
compilation. This file will contain Go declarations for the types,
|
||||
variables and functions declared in the C code. C types that can not
|
||||
be represented in Go will be recorded as comments in the Go code. The
|
||||
compilation. This file will contain Go declarations for the types,
|
||||
variables and functions declared in the C code. C types that can not
|
||||
be represented in Go will be recorded as comments in the Go code. The
|
||||
generated file will not have a <code>package</code> declaration, but
|
||||
can otherwise be compiled directly by gccgo.
|
||||
</p>
|
||||
@@ -531,3 +526,15 @@ This procedure is full of unstated caveats and restrictions and we make no
|
||||
guarantee that it will not change in the future. It is more useful as a
|
||||
starting point for real Go code than as a regular procedure.
|
||||
</p>
|
||||
|
||||
<h2 id="RTEMS_Port">RTEMS Port</h2>
|
||||
<p>
|
||||
The gccgo compiler has been ported to <a href="http://www.rtems.com/">
|
||||
<code>RTEMS</code></a>. <code>RTEMS</code> is a real-time executive
|
||||
that provides a high performance environment for embedded applications
|
||||
on a range of processors and embedded hardware. The current gccgo
|
||||
port is for x86. The goal is to extend the port to most of the
|
||||
<a href="http://www.rtems.org/wiki/index.php/SupportedCPUs">
|
||||
architectures supported by <code>RTEMS</code></a>. For more information on the port,
|
||||
as well as instructions on how to install it, please see this
|
||||
<a href="http://www.rtems.org/wiki/index.php/GCCGoRTEMS"><code>RTEMS</code> Wiki page</a>.
|
||||
|
||||
@@ -166,7 +166,7 @@ providing a complete Go 1.1 implementation.
|
||||
<h3 id="gc_flag">Command-line flag parsing</h3>
|
||||
|
||||
<p>
|
||||
In the gc toolchain, the compilers and linkers now use the
|
||||
In the gc tool chain, the compilers and linkers now use the
|
||||
same command-line flag parsing rules as the Go flag package, a departure
|
||||
from the traditional Unix flag parsing. This may affect scripts that invoke
|
||||
the tool directly.
|
||||
@@ -305,7 +305,7 @@ The race detector is documented in <a href="/doc/articles/race_detector.html">a
|
||||
<p>
|
||||
Due to the change of the <a href="#int"><code>int</code></a> to 64 bits and
|
||||
a new internal <a href="//golang.org/s/go11func">representation of functions</a>,
|
||||
the arrangement of function arguments on the stack has changed in the gc toolchain.
|
||||
the arrangement of function arguments on the stack has changed in the gc tool chain.
|
||||
Functions written in assembly will need to be revised at least
|
||||
to adjust frame pointer offsets.
|
||||
</p>
|
||||
@@ -395,7 +395,7 @@ Run <code>go help test</code> for more information.
|
||||
The <a href="/cmd/fix/"><code>fix</code></a> command, usually run as
|
||||
<code>go fix</code>, no longer applies fixes to update code from
|
||||
before Go 1 to use Go 1 APIs.
|
||||
To update pre-Go 1 code to Go 1.1, use a Go 1.0 toolchain
|
||||
To update pre-Go 1 code to Go 1.1, use a Go 1.0 tool chain
|
||||
to convert the code to Go 1.0 first.
|
||||
</p>
|
||||
|
||||
@@ -427,7 +427,7 @@ To build a file only with Go 1.0.x, use the converse constraint:
|
||||
<h3 id="platforms">Additional platforms</h3>
|
||||
|
||||
<p>
|
||||
The Go 1.1 toolchain adds experimental support for <code>freebsd/arm</code>,
|
||||
The Go 1.1 tool chain adds experimental support for <code>freebsd/arm</code>,
|
||||
<code>netbsd/386</code>, <code>netbsd/amd64</code>, <code>netbsd/arm</code>,
|
||||
<code>openbsd/386</code> and <code>openbsd/amd64</code> platforms.
|
||||
</p>
|
||||
|
||||
1448
doc/go1.10.html
1448
doc/go1.10.html
File diff suppressed because it is too large
Load Diff
934
doc/go1.11.html
934
doc/go1.11.html
@@ -1,934 +0,0 @@
|
||||
<!--{
|
||||
"Title": "Go 1.11 Release Notes",
|
||||
"Path": "/doc/go1.11",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<!--
|
||||
NOTE: In this document and others in this directory, the convention is to
|
||||
set fixed-width phrases with non-fixed-width spaces, as in
|
||||
<code>hello</code> <code>world</code>.
|
||||
Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
|
||||
<style>
|
||||
main ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">Introduction to Go 1.11</h2>
|
||||
|
||||
<p>
|
||||
The latest Go release, version 1.11, arrives six months after <a href="go1.10">Go 1.10</a>.
|
||||
Most of its changes are in the implementation of the toolchain, runtime, and libraries.
|
||||
As always, the release maintains the Go 1 <a href="/doc/go1compat.html">promise of compatibility</a>.
|
||||
We expect almost all Go programs to continue to compile and run as before.
|
||||
</p>
|
||||
|
||||
<h2 id="language">Changes to the language</h2>
|
||||
|
||||
<p>
|
||||
There are no changes to the language specification.
|
||||
</p>
|
||||
|
||||
<h2 id="ports">Ports</h2>
|
||||
|
||||
<p> <!-- CL 94255, CL 115038, etc -->
|
||||
As <a href="go1.10#ports">announced in the Go 1.10 release notes</a>, Go 1.11 now requires
|
||||
OpenBSD 6.2 or later, macOS 10.10 Yosemite or later, or Windows 7 or later;
|
||||
support for previous versions of these operating systems has been removed.
|
||||
</p>
|
||||
|
||||
<p> <!-- CL 121657 -->
|
||||
Go 1.11 supports the upcoming OpenBSD 6.4 release. Due to changes in
|
||||
the OpenBSD kernel, older versions of Go will not work on OpenBSD 6.4.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There are <a href="https://golang.org/issue/25206">known issues</a> with NetBSD on i386 hardware.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 107935 -->
|
||||
The race detector is now supported on <code>linux/ppc64le</code>
|
||||
and, to a lesser extent, on <code>netbsd/amd64</code>. The NetBSD race detector support
|
||||
has <a href="https://golang.org/issue/26403">known issues</a>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 109255 -->
|
||||
The memory sanitizer (<code>-msan</code>) is now supported on <code>linux/arm64</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 93875 -->
|
||||
The build modes <code>c-shared</code> and <code>c-archive</code> are now supported on
|
||||
<code>freebsd/amd64</code>.
|
||||
</p>
|
||||
|
||||
<p id="mips"><!-- CL 108475 -->
|
||||
On 64-bit MIPS systems, the new environment variable settings
|
||||
<code>GOMIPS64=hardfloat</code> (the default) and
|
||||
<code>GOMIPS64=softfloat</code> select whether to use
|
||||
hardware instructions or software emulation for floating-point computations.
|
||||
For 32-bit systems, the environment variable is still <code>GOMIPS</code>,
|
||||
as <a href="go1.10#mips">added in Go 1.10</a>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 107475 -->
|
||||
On soft-float ARM systems (<code>GOARM=5</code>), Go now uses a more
|
||||
efficient software floating point interface. This is transparent to
|
||||
Go code, but ARM assembly that uses floating-point instructions not
|
||||
guarded on GOARM will break and must be ported to
|
||||
the <a href="https://golang.org/cl/107475">new interface</a>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 94076 -->
|
||||
Go 1.11 on ARMv7 no longer requires a Linux kernel configured
|
||||
with <code>KUSER_HELPERS</code>. This setting is enabled in default
|
||||
kernel configurations, but is sometimes disabled in stripped-down
|
||||
configurations.
|
||||
</p>
|
||||
|
||||
<h3 id="wasm">WebAssembly</h3>
|
||||
<p>
|
||||
Go 1.11 adds an experimental port to <a href="https://webassembly.org">WebAssembly</a>
|
||||
(<code>js/wasm</code>).
|
||||
</p>
|
||||
<p>
|
||||
Go programs currently compile to one WebAssembly module that
|
||||
includes the Go runtime for goroutine scheduling, garbage
|
||||
collection, maps, etc.
|
||||
As a result, the resulting size is at minimum around
|
||||
2 MB, or 500 KB compressed. Go programs can call into JavaScript
|
||||
using the new experimental
|
||||
<a href="/pkg/syscall/js/"><code>syscall/js</code></a> package.
|
||||
Binary size and interop with other languages has not yet been a
|
||||
priority but may be addressed in future releases.
|
||||
</p>
|
||||
<p>
|
||||
As a result of the addition of the new <code>GOOS</code> value
|
||||
"<code>js</code>" and <code>GOARCH</code> value "<code>wasm</code>",
|
||||
Go files named <code>*_js.go</code> or <code>*_wasm.go</code> will
|
||||
now be <a href="/pkg/go/build/#hdr-Build_Constraints">ignored by Go
|
||||
tools</a> except when those GOOS/GOARCH values are being used.
|
||||
If you have existing filenames matching those patterns, you will need to rename them.
|
||||
</p>
|
||||
<p>
|
||||
More information can be found on the
|
||||
<a href="https://golang.org/wiki/WebAssembly">WebAssembly wiki page</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="riscv">RISC-V GOARCH values reserved</h3>
|
||||
<p><!-- CL 106256 -->
|
||||
The main Go compiler does not yet support the RISC-V architecture <!-- is gonna change everything -->
|
||||
but we've reserved the <code>GOARCH</code> values
|
||||
"<code>riscv</code>" and "<code>riscv64</code>", as used by Gccgo,
|
||||
which does support RISC-V. This means that Go files
|
||||
named <code>*_riscv.go</code> will now also
|
||||
be <a href="/pkg/go/build/#hdr-Build_Constraints">ignored by Go
|
||||
tools</a> except when those GOOS/GOARCH values are being used.
|
||||
</p>
|
||||
|
||||
<h2 id="tools">Tools</h2>
|
||||
|
||||
<h3 id="modules">Modules, package versioning, and dependency management</h3>
|
||||
<p>
|
||||
Go 1.11 adds preliminary support for a <a href="/cmd/go/#hdr-Modules__module_versions__and_more">new concept called “modules,”</a>
|
||||
an alternative to GOPATH with integrated support for versioning and
|
||||
package distribution.
|
||||
Using modules, developers are no longer confined to working inside GOPATH,
|
||||
version dependency information is explicit yet lightweight,
|
||||
and builds are more reliable and reproducible.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Module support is considered experimental.
|
||||
Details are likely to change in response to feedback from Go 1.11 users,
|
||||
and we have more tools planned.
|
||||
Although the details of module support may change, projects that convert
|
||||
to modules using Go 1.11 will continue to work with Go 1.12 and later.
|
||||
If you encounter bugs using modules,
|
||||
please <a href="https://golang.org/issue/new">file issues</a>
|
||||
so we can fix them. For more information, see the
|
||||
<a href="/cmd/go#hdr-Modules__module_versions__and_more"><code>go</code> command documentation</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="importpath">Import path restriction</h3>
|
||||
|
||||
<p>
|
||||
Because Go module support assigns special meaning to the
|
||||
<code>@</code> symbol in command line operations,
|
||||
the <code>go</code> command now disallows the use of
|
||||
import paths containing <code>@</code> symbols.
|
||||
Such import paths were never allowed by <code>go</code> <code>get</code>,
|
||||
so this restriction can only affect users building
|
||||
custom GOPATH trees by other means.
|
||||
</p>
|
||||
|
||||
<h3 id="gopackages">Package loading</h3>
|
||||
|
||||
<p>
|
||||
The new package
|
||||
<a href="https://godoc.org/golang.org/x/tools/go/packages"><code>golang.org/x/tools/go/packages</code></a>
|
||||
provides a simple API for locating and loading packages of Go source code.
|
||||
Although not yet part of the standard library, for many tasks it
|
||||
effectively replaces the <a href="/pkg/go/build"><code>go/build</code></a>
|
||||
package, whose API is unable to fully support modules.
|
||||
Because it runs an external query command such as
|
||||
<a href="/cmd/go/#hdr-List_packages"><code>go list</code></a>
|
||||
to obtain information about Go packages, it enables the construction of
|
||||
analysis tools that work equally well with alternative build systems
|
||||
such as <a href="https://bazel.build">Bazel</a>
|
||||
and <a href="https://buckbuild.com">Buck</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="gocache">Build cache requirement</h3>
|
||||
|
||||
<p>
|
||||
Go 1.11 will be the last release to support setting the environment
|
||||
variable <code>GOCACHE=off</code> to disable the
|
||||
<a href="/cmd/go/#hdr-Build_and_test_caching">build cache</a>,
|
||||
introduced in Go 1.10.
|
||||
Starting in Go 1.12, the build cache will be required,
|
||||
as a step toward eliminating <code>$GOPATH/pkg</code>.
|
||||
The module and package loading support described above
|
||||
already require that the build cache be enabled.
|
||||
If you have disabled the build cache to avoid problems you encountered,
|
||||
please <a href="https://golang.org/issue/new">file an issue</a> to let us know about them.
|
||||
</p>
|
||||
|
||||
<h3 id="compiler">Compiler toolchain</h3>
|
||||
|
||||
<p><!-- CL 109918 -->
|
||||
More functions are now eligible for inlining by default, including
|
||||
functions that call <code>panic</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 97375 -->
|
||||
The compiler toolchain now supports column information
|
||||
in <a href="/cmd/compile/#hdr-Compiler_Directives">line
|
||||
directives</a>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 106797 -->
|
||||
A new package export data format has been introduced.
|
||||
This should be transparent to end users, except for speeding up
|
||||
build times for large Go projects.
|
||||
If it does cause problems, it can be turned off again by
|
||||
passing <code>-gcflags=all=-iexport=false</code> to
|
||||
the <code>go</code> tool when building a binary.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 100459 -->
|
||||
The compiler now rejects unused variables declared in a type switch
|
||||
guard, such as <code>x</code> in the following example:
|
||||
</p>
|
||||
<pre>
|
||||
func f(v interface{}) {
|
||||
switch x := v.(type) {
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
This was already rejected by both <code>gccgo</code>
|
||||
and <a href="/pkg/go/types/">go/types</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="assembler">Assembler</h3>
|
||||
|
||||
<p><!-- CL 113315 -->
|
||||
The assembler for <code>amd64</code> now accepts AVX512 instructions.
|
||||
</p>
|
||||
|
||||
<h3 id="debugging">Debugging</h3>
|
||||
|
||||
<p><!-- CL 100738, CL 93664 -->
|
||||
The compiler now produces significantly more accurate debug
|
||||
information for optimized binaries, including variable location
|
||||
information, line numbers, and breakpoint locations.
|
||||
|
||||
This should make it possible to debug binaries
|
||||
compiled <em>without</em> <code>-N</code> <code>-l</code>.
|
||||
|
||||
There are still limitations to the quality of the debug information,
|
||||
some of which are fundamental, and some of which will continue to
|
||||
improve with future releases.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 118276 -->
|
||||
DWARF sections are now compressed by default because of the expanded
|
||||
and more accurate debug information produced by the compiler.
|
||||
|
||||
This is transparent to most ELF tools (such as debuggers on Linux
|
||||
and *BSD) and is supported by the Delve debugger on all platforms,
|
||||
but has limited support in the native tools on macOS and Windows.
|
||||
|
||||
To disable DWARF compression,
|
||||
pass <code>-ldflags=-compressdwarf=false</code> to
|
||||
the <code>go</code> tool when building a binary.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 109699 -->
|
||||
Go 1.11 adds experimental support for calling Go functions from
|
||||
within a debugger.
|
||||
|
||||
This is useful, for example, to call <code>String</code> methods
|
||||
when paused at a breakpoint.
|
||||
|
||||
This is currently only supported by Delve (version 1.1.0 and up).
|
||||
</p>
|
||||
|
||||
<h3 id="test">Test</h3>
|
||||
|
||||
<p>
|
||||
Since Go 1.10, the <code>go</code> <code>test</code> command runs
|
||||
<code>go</code> <code>vet</code> on the package being tested,
|
||||
to identify problems before running the test. Since <code>vet</code>
|
||||
typechecks the code with <a href="/pkg/go/types/">go/types</a>
|
||||
before running, tests that do not typecheck will now fail.
|
||||
|
||||
In particular, tests that contain an unused variable inside a
|
||||
closure compiled with Go 1.10, because the Go compiler incorrectly
|
||||
accepted them (<a href="https://golang.org/issues/3059">Issue #3059</a>),
|
||||
but will now fail, since <code>go/types</code> correctly reports an
|
||||
"unused variable" error in this case.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 102696 -->
|
||||
The <code>-memprofile</code> flag
|
||||
to <code>go</code> <code>test</code> now defaults to the
|
||||
"allocs" profile, which records the total bytes allocated since the
|
||||
test began (including garbage-collected bytes).
|
||||
</p>
|
||||
|
||||
<h3 id="vet">Vet</h3>
|
||||
|
||||
<p><!-- CL 108555 -->
|
||||
The <a href="/cmd/vet/"><code>go</code> <code>vet</code></a>
|
||||
command now reports a fatal error when the package under analysis
|
||||
does not typecheck. Previously, a type checking error simply caused
|
||||
a warning to be printed, and <code>vet</code> to exit with status 1.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 108559 -->
|
||||
Additionally, <a href="/cmd/vet"><code>go</code> <code>vet</code></a>
|
||||
has become more robust when format-checking <code>printf</code> wrappers.
|
||||
Vet now detects the mistake in this example:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func wrapper(s string, args ...interface{}) {
|
||||
fmt.Printf(s, args...)
|
||||
}
|
||||
|
||||
func main() {
|
||||
wrapper("%s", 42)
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3 id="trace">Trace</h3>
|
||||
|
||||
<p><!-- CL 63274 -->
|
||||
With the new <code>runtime/trace</code>
|
||||
package's <a href="/pkg/runtime/trace/#hdr-User_annotation">user
|
||||
annotation API</a>, users can record application-level information
|
||||
in execution traces and create groups of related goroutines.
|
||||
The <code>go</code> <code>tool</code> <code>trace</code>
|
||||
command visualizes this information in the trace view and the new
|
||||
user task/region analysis page.
|
||||
</p>
|
||||
|
||||
<h3 id="cgo">Cgo</h3>
|
||||
|
||||
<p>
|
||||
Since Go 1.10, cgo has translated some C pointer types to the Go
|
||||
type <code>uintptr</code>. These types include
|
||||
the <code>CFTypeRef</code> hierarchy in Darwin's CoreFoundation
|
||||
framework and the <code>jobject</code> hierarchy in Java's JNI
|
||||
interface. In Go 1.11, several improvements have been made to the code
|
||||
that detects these types. Code that uses these types may need some
|
||||
updating. See the <a href="go1.10.html#cgo">Go 1.10 release notes</a> for
|
||||
details. <!-- CL 126275, CL 127156, CL 122217, CL 122575, CL 123177 -->
|
||||
</p>
|
||||
|
||||
<h3 id="go_command">Go command</h3>
|
||||
|
||||
<p><!-- CL 126656 -->
|
||||
The environment variable <code>GOFLAGS</code> may now be used
|
||||
to set default flags for the <code>go</code> command.
|
||||
This is useful in certain situations.
|
||||
Linking can be noticeably slower on underpowered systems due to DWARF,
|
||||
and users may want to set <code>-ldflags=-w</code> by default.
|
||||
For modules, some users and CI systems will want vendoring always,
|
||||
so they should set <code>-mod=vendor</code> by default.
|
||||
For more information, see the <a href="/cmd/go/#hdr-Environment_variables"><code>go</code>
|
||||
command documentation</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="godoc">Godoc</h3>
|
||||
|
||||
<p>
|
||||
Go 1.11 will be the last release to support <code>godoc</code>'s command-line interface.
|
||||
In future releases, <code>godoc</code> will only be a web server. Users should use
|
||||
<code>go</code> <code>doc</code> for command-line help output instead.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 85396, CL 124495 -->
|
||||
The <code>godoc</code> web server now shows which version of Go introduced
|
||||
new API features. The initial Go version of types, funcs, and methods are shown
|
||||
right-aligned. For example, see <a href="/pkg/os/#UserCacheDir"><code>UserCacheDir</code></a>, with "1.11"
|
||||
on the right side. For struct fields, inline comments are added when the struct field was
|
||||
added in a Go version other than when the type itself was introduced.
|
||||
For a struct field example, see
|
||||
<a href="/pkg/net/http/httptrace/#ClientTrace.Got1xxResponse"><code>ClientTrace.Got1xxResponse</code></a>.
|
||||
</p>
|
||||
|
||||
<h3 id="gofmt">Gofmt</h3>
|
||||
|
||||
<p>
|
||||
One minor detail of the default formatting of Go source code has changed.
|
||||
When formatting expression lists with inline comments, the comments were
|
||||
aligned according to a heuristic.
|
||||
However, in some cases the alignment would be split up too easily, or
|
||||
introduce too much whitespace.
|
||||
The heuristic has been changed to behave better for human-written code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that these kinds of minor updates to gofmt are expected from time to
|
||||
time.
|
||||
In general, systems that need consistent formatting of Go source code should
|
||||
use a specific version of the <code>gofmt</code> binary.
|
||||
See the <a href="/pkg/go/format/">go/format</a> package documentation for more
|
||||
information.
|
||||
</p>
|
||||
|
||||
<h3 id="run">Run</h3>
|
||||
|
||||
<p>
|
||||
<!-- CL 109341 -->
|
||||
The <a href="/cmd/go/"><code>go</code> <code>run</code></a>
|
||||
command now allows a single import path, a directory name or a
|
||||
pattern matching a single package.
|
||||
This allows <code>go</code> <code>run</code> <code>pkg</code> or <code>go</code> <code>run</code> <code>dir</code>, most importantly <code>go</code> <code>run</code> <code>.</code>
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime</h2>
|
||||
|
||||
<p><!-- CL 85887 -->
|
||||
The runtime now uses a sparse heap layout so there is no longer a
|
||||
limit to the size of the Go heap (previously, the limit was 512GiB).
|
||||
This also fixes rare "address space conflict" failures in mixed Go/C
|
||||
binaries or binaries compiled with <code>-race</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 108679, CL 106156 -->
|
||||
On macOS and iOS, the runtime now uses <code>libSystem.dylib</code> instead of
|
||||
calling the kernel directly. This should make Go binaries more
|
||||
compatible with future versions of macOS and iOS.
|
||||
The <a href="/pkg/syscall">syscall</a> package still makes direct
|
||||
system calls; fixing this is planned for a future release.
|
||||
</p>
|
||||
|
||||
<h2 id="performance">Performance</h2>
|
||||
|
||||
<p>
|
||||
As always, the changes are so general and varied that precise
|
||||
statements about performance are difficult to make. Most programs
|
||||
should run a bit faster, due to better generated code and
|
||||
optimizations in the core library.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 74851 -->
|
||||
There were multiple performance changes to the <code>math/big</code>
|
||||
package as well as many changes across the tree specific to <code>GOARCH=arm64</code>.
|
||||
</p>
|
||||
|
||||
<h3 id="performance-compiler">Compiler toolchain</h3>
|
||||
|
||||
<p><!-- CL 110055 -->
|
||||
The compiler now optimizes map clearing operations of the form:
|
||||
</p>
|
||||
<pre>
|
||||
for k := range m {
|
||||
delete(m, k)
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p><!-- CL 109517 -->
|
||||
The compiler now optimizes slice extension of the form
|
||||
<code>append(s,</code> <code>make([]T,</code> <code>n)...)</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 100277, CL 105635, CL 109776 -->
|
||||
The compiler now performs significantly more aggressive bounds-check
|
||||
and branch elimination. Notably, it now recognizes transitive
|
||||
relations, so if <code>i<j</code> and <code>j<len(s)</code>,
|
||||
it can use these facts to eliminate the bounds check
|
||||
for <code>s[i]</code>. It also understands simple arithmetic such
|
||||
as <code>s[i-10]</code> and can recognize more inductive cases in
|
||||
loops. Furthermore, the compiler now uses bounds information to more
|
||||
aggressively optimize shift operations.
|
||||
</p>
|
||||
|
||||
<h2 id="library">Core library</h2>
|
||||
|
||||
<p>
|
||||
All of the changes to the standard library are minor.
|
||||
</p>
|
||||
|
||||
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
||||
|
||||
<p>
|
||||
As always, there are various minor changes and updates to the library,
|
||||
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
|
||||
in mind.
|
||||
</p>
|
||||
|
||||
<!-- CL 115095: https://golang.org/cl/115095: yes (`go test pkg` now always builds pkg even if there are no test files): cmd/go: output coverage report even if there are no test files -->
|
||||
<!-- CL 110395: https://golang.org/cl/110395: cmd/go, cmd/compile: use Windows response files to avoid arg length limits -->
|
||||
<!-- CL 112436: https://golang.org/cl/112436: cmd/pprof: add readline support similar to upstream -->
|
||||
|
||||
|
||||
<dl id="crypto"><dt><a href="/pkg/crypto/">crypto</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 64451 -->
|
||||
Certain crypto operations, including
|
||||
<a href="/pkg/crypto/ecdsa/#Sign"><code>ecdsa.Sign</code></a>,
|
||||
<a href="/pkg/crypto/rsa/#EncryptPKCS1v15"><code>rsa.EncryptPKCS1v15</code></a> and
|
||||
<a href="/pkg/crypto/rsa/#GenerateKey"><code>rsa.GenerateKey</code></a>,
|
||||
now randomly read an extra byte of randomness to ensure tests don't rely on internal behavior.
|
||||
</p>
|
||||
|
||||
</dl><!-- crypto -->
|
||||
|
||||
<dl id="crypto/cipher"><dt><a href="/pkg/crypto/cipher/">crypto/cipher</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 48510, CL 116435 -->
|
||||
The new function <a href="/pkg/crypto/cipher/#NewGCMWithTagSize"><code>NewGCMWithTagSize</code></a>
|
||||
implements Galois Counter Mode with non-standard tag lengths for compatibility with existing cryptosystems.
|
||||
</p>
|
||||
|
||||
</dl><!-- crypto/cipher -->
|
||||
|
||||
<dl id="crypto/rsa"><dt><a href="/pkg/crypto/rsa/">crypto/rsa</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 103876 -->
|
||||
<a href="/pkg/crypto/rsa/#PublicKey"><code>PublicKey</code></a> now implements a
|
||||
<a href="/pkg/crypto/rsa/#PublicKey.Size"><code>Size</code></a> method that
|
||||
returns the modulus size in bytes.
|
||||
</p>
|
||||
|
||||
</dl><!-- crypto/rsa -->
|
||||
|
||||
<dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 85115 -->
|
||||
<a href="/pkg/crypto/tls/#ConnectionState"><code>ConnectionState</code></a>'s new
|
||||
<a href="/pkg/crypto/tls/#ConnectionState.ExportKeyingMaterial"><code>ExportKeyingMaterial</code></a>
|
||||
method allows exporting keying material bound to the
|
||||
connection according to RFC 5705.
|
||||
</p>
|
||||
|
||||
</dl><!-- crypto/tls -->
|
||||
|
||||
<dl id="crypto/x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 123355, CL 123695 -->
|
||||
The deprecated, legacy behavior of treating the <code>CommonName</code> field as
|
||||
a hostname when no Subject Alternative Names are present is now disabled when the CN is not a
|
||||
valid hostname.
|
||||
The <code>CommonName</code> can be completely ignored by adding the experimental value
|
||||
<code>x509ignoreCN=1</code> to the <code>GODEBUG</code> environment variable.
|
||||
When the CN is ignored, certificates without SANs validate under chains with name constraints
|
||||
instead of returning <code>NameConstraintsWithoutSANs</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 113475 -->
|
||||
Extended key usage restrictions are again checked only if they appear in the <code>KeyUsages</code>
|
||||
field of <a href="/pkg/crypto/x509/#VerifyOptions"><code>VerifyOptions</code></a>, instead of always being checked.
|
||||
This matches the behavior of Go 1.9 and earlier.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 102699 -->
|
||||
The value returned by <a href="/pkg/crypto/x509/#SystemCertPool"><code>SystemCertPool</code></a>
|
||||
is now cached and might not reflect system changes between invocations.
|
||||
</p>
|
||||
|
||||
</dl><!-- crypto/x509 -->
|
||||
|
||||
<dl id="debug/elf"><dt><a href="/pkg/debug/elf/">debug/elf</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 112115 -->
|
||||
More <a href="/pkg/debug/elf/#ELFOSABI_NONE"><code>ELFOSABI</code></a>
|
||||
and <a href="/pkg/debug/elf/#EM_NONE"><code>EM</code></a>
|
||||
constants have been added.
|
||||
</p>
|
||||
|
||||
</dl><!-- debug/elf -->
|
||||
|
||||
<dl id="encoding/asn1"><dt><a href="/pkg/encoding/asn1/">encoding/asn1</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 110561 -->
|
||||
<code>Marshal</code> and <code><a href="/pkg/encoding/asn1/#Unmarshal">Unmarshal</a></code>
|
||||
now support "private" class annotations for fields.
|
||||
</p>
|
||||
|
||||
</dl><!-- encoding/asn1 -->
|
||||
|
||||
<dl id="encoding/base32"><dt><a href="/pkg/encoding/base32/">encoding/base32</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 112516 -->
|
||||
The decoder now consistently
|
||||
returns <code>io.ErrUnexpectedEOF</code> for an incomplete
|
||||
chunk. Previously it would return <code>io.EOF</code> in some
|
||||
cases.
|
||||
</p>
|
||||
|
||||
</dl><!-- encoding/base32 -->
|
||||
|
||||
<dl id="encoding/csv"><dt><a href="/pkg/encoding/csv/">encoding/csv</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 99696 -->
|
||||
The <code>Reader</code> now rejects attempts to set
|
||||
the <a href="/pkg/encoding/csv/#Reader.Comma"><code>Comma</code></a>
|
||||
field to a double-quote character, as double-quote characters
|
||||
already have a special meaning in CSV.
|
||||
</p>
|
||||
|
||||
</dl><!-- encoding/csv -->
|
||||
|
||||
<!-- CL 100235 was reverted -->
|
||||
|
||||
<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 121815 -->
|
||||
The package has changed its behavior when a typed interface
|
||||
value is passed to an implicit escaper function. Previously such
|
||||
a value was written out as (an escaped form)
|
||||
of <code><nil></code>. Now such values are ignored, just
|
||||
as an untyped <code>nil</code> value is (and always has been)
|
||||
ignored.
|
||||
</p>
|
||||
|
||||
</dl><!-- html/template -->
|
||||
|
||||
<dl id="image/gif"><dt><a href="/pkg/image/gif/">image/gif</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 93076 -->
|
||||
Non-looping animated GIFs are now supported. They are denoted by having a
|
||||
<code><a href="/pkg/image/gif/#GIF.LoopCount">LoopCount</a></code> of -1.
|
||||
</p>
|
||||
|
||||
</dl><!-- image/gif -->
|
||||
|
||||
<dl id="io/ioutil"><dt><a href="/pkg/io/ioutil/">io/ioutil</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 105675 -->
|
||||
The <code><a href="/pkg/io/ioutil/#TempFile">TempFile</a></code>
|
||||
function now supports specifying where the random characters in
|
||||
the filename are placed. If the <code>prefix</code> argument
|
||||
includes a "<code>*</code>", the random string replaces the
|
||||
"<code>*</code>". For example, a <code>prefix</code> argument of "<code>myname.*.bat</code>" will
|
||||
result in a random filename such as
|
||||
"<code>myname.123456.bat</code>". If no "<code>*</code>" is
|
||||
included the old behavior is retained, and the random digits are
|
||||
appended to the end.
|
||||
</p>
|
||||
|
||||
</dl><!-- io/ioutil -->
|
||||
|
||||
<dl id="math/big"><dt><a href="/pkg/math/big/">math/big</a></dt>
|
||||
<dd>
|
||||
|
||||
<p><!-- CL 108996 -->
|
||||
<a href="/pkg/math/big/#Int.ModInverse"><code>ModInverse</code></a> now returns nil when g and n are not relatively prime. The result was previously undefined.
|
||||
</p>
|
||||
|
||||
</dl><!-- math/big -->
|
||||
|
||||
<dl id="mime/multipart"><dt><a href="/pkg/mime/multipart/">mime/multipart</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 121055 -->
|
||||
The handling of form-data with missing/empty file names has been
|
||||
restored to the behavior in Go 1.9: in the
|
||||
<a href="/pkg/mime/multipart/#Form"><code>Form</code></a> for
|
||||
the form-data part the value is available in
|
||||
the <code>Value</code> field rather than the <code>File</code>
|
||||
field. In Go releases 1.10 through 1.10.3 a form-data part with
|
||||
a missing/empty file name and a non-empty "Content-Type" field
|
||||
was stored in the <code>File</code> field. This change was a
|
||||
mistake in 1.10 and has been reverted to the 1.9 behavior.
|
||||
</p>
|
||||
|
||||
</dl><!-- mime/multipart -->
|
||||
|
||||
<dl id="mime/quotedprintable"><dt><a href="/pkg/mime/quotedprintable/">mime/quotedprintable</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 121095 -->
|
||||
To support invalid input found in the wild, the package now
|
||||
permits non-ASCII bytes but does not validate their encoding.
|
||||
</p>
|
||||
|
||||
</dl><!-- mime/quotedprintable -->
|
||||
|
||||
<dl id="net"><dt><a href="/pkg/net/">net</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 72810 -->
|
||||
The new <a href="/pkg/net/#ListenConfig"><code>ListenConfig</code></a> type and the new
|
||||
<a href="/pkg/net/#Dialer.Control"><code>Dialer.Control</code></a> field permit
|
||||
setting socket options before accepting and creating connections, respectively.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 76391 -->
|
||||
The <a href="/pkg/syscall/#RawConn"><code>syscall.RawConn</code></a> <code>Read</code>
|
||||
and <code>Write</code> methods now work correctly on Windows.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 107715 -->
|
||||
The <code>net</code> package now automatically uses the
|
||||
<a href="http://man7.org/linux/man-pages/man2/splice.2.html"><code>splice</code> system call</a>
|
||||
on Linux when copying data between TCP connections in
|
||||
<a href="/pkg/net/#TCPConn.ReadFrom"><code>TCPConn.ReadFrom</code></a>, as called by
|
||||
<a href="/pkg/io/#Copy"><code>io.Copy</code></a>. The result is faster, more efficient TCP proxying.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 108297 -->
|
||||
The <a href="/pkg/net/#TCPConn.File"><code>TCPConn.File</code></a>,
|
||||
<a href="/pkg/net/#UDPConn.File"><code>UDPConn.File</code></a>,
|
||||
<a href="/pkg/net/#UnixCOnn.File"><code>UnixConn.File</code></a>,
|
||||
and <a href="/pkg/net/#IPConn.File"><code>IPConn.File</code></a>
|
||||
methods no longer put the returned <code>*os.File</code> into
|
||||
blocking mode.
|
||||
</p>
|
||||
|
||||
</dl><!-- net -->
|
||||
|
||||
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 71272 -->
|
||||
The <a href="/pkg/net/http/#Transport"><code>Transport</code></a> type has a
|
||||
new <a href="/pkg/net/http/#Transport.MaxConnsPerHost"><code>MaxConnsPerHost</code></a>
|
||||
option that permits limiting the maximum number of connections
|
||||
per host.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 79919 -->
|
||||
The <a href="/pkg/net/http/#Cookie"><code>Cookie</code></a> type has a new
|
||||
<a href="/pkg/net/http/#Cookie.SameSite"><code>SameSite</code></a> field
|
||||
(of new type also named
|
||||
<a href="/pkg/net/http/#SameSite"><code>SameSite</code></a>) to represent the new cookie attribute recently supported by most browsers.
|
||||
The <code>net/http</code>'s <code>Transport</code> does not use the <code>SameSite</code>
|
||||
attribute itself, but the package supports parsing and serializing the
|
||||
attribute for browsers to use.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 81778 -->
|
||||
It is no longer allowed to reuse a <a href="/pkg/net/http/#Server"><code>Server</code></a>
|
||||
after a call to
|
||||
<a href="/pkg/net/http/#Server.Shutdown"><code>Shutdown</code></a> or
|
||||
<a href="/pkg/net/http/#Server.Close"><code>Close</code></a>. It was never officially supported
|
||||
in the past and had often surprising behavior. Now, all future calls to the server's <code>Serve</code>
|
||||
methods will return errors after a shutdown or close.
|
||||
</p>
|
||||
|
||||
<!-- CL 89275 was reverted before Go 1.11 -->
|
||||
|
||||
<p><!-- CL 93296 -->
|
||||
The constant <code>StatusMisdirectedRequest</code> is now defined for HTTP status code 421.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 123875 -->
|
||||
The HTTP server will no longer cancel contexts or send on
|
||||
<a href="/pkg/net/http/#CloseNotifier"><code>CloseNotifier</code></a>
|
||||
channels upon receiving pipelined HTTP/1.1 requests. Browsers do
|
||||
not use HTTP pipelining, but some clients (such as
|
||||
Debian's <code>apt</code>) may be configured to do so.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 115255 -->
|
||||
<a href="/pkg/net/http/#ProxyFromEnvironment"><code>ProxyFromEnvironment</code></a>, which is used by the
|
||||
<a href="/pkg/net/http/#DefaultTransport"><code>DefaultTransport</code></a>, now
|
||||
supports CIDR notation and ports in the <code>NO_PROXY</code> environment variable.
|
||||
</p>
|
||||
|
||||
</dl><!-- net/http -->
|
||||
|
||||
<dl id="net/http/httputil"><dt><a href="/pkg/net/http/httputil/">net/http/httputil</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 77410 -->
|
||||
The
|
||||
<a href="/pkg/net/http/httputil/#ReverseProxy"><code>ReverseProxy</code></a>
|
||||
has a new
|
||||
<a href="/pkg/net/http/httputil/#ReverseProxy.ErrorHandler"><code>ErrorHandler</code></a>
|
||||
option to permit changing how errors are handled.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 115135 -->
|
||||
The <code>ReverseProxy</code> now also passes
|
||||
"<code>TE:</code> <code>trailers</code>" request headers
|
||||
through to the backend, as required by the gRPC protocol.
|
||||
</p>
|
||||
|
||||
</dl><!-- net/http/httputil -->
|
||||
|
||||
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 78835 -->
|
||||
The new <a href="/pkg/os/#UserCacheDir"><code>UserCacheDir</code></a> function
|
||||
returns the default root directory to use for user-specific cached data.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 94856 -->
|
||||
The new <a href="/pkg/os/#ModeIrregular"><code>ModeIrregular</code></a>
|
||||
is a <a href="/pkg/os/#FileMode"><code>FileMode</code></a> bit to represent
|
||||
that a file is not a regular file, but nothing else is known about it, or that
|
||||
it's not a socket, device, named pipe, symlink, or other file type for which
|
||||
Go has a defined mode bit.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 99337 -->
|
||||
<a href="/pkg/os/#Symlink"><code>Symlink</code></a> now works
|
||||
for unprivileged users on Windows 10 on machines with Developer
|
||||
Mode enabled.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 100077 -->
|
||||
When a non-blocking descriptor is passed
|
||||
to <a href="/pkg/os#NewFile"><code>NewFile</code></a>, the
|
||||
resulting <code>*File</code> will be kept in non-blocking
|
||||
mode. This means that I/O for that <code>*File</code> will use
|
||||
the runtime poller rather than a separate thread, and that
|
||||
the <a href="/pkg/os/#File.SetDeadline"><code>SetDeadline</code></a>
|
||||
methods will work.
|
||||
</p>
|
||||
|
||||
</dl><!-- os -->
|
||||
|
||||
<dl id="os/signal"><dt><a href="/pkg/os/signal/">os/signal</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 108376 -->
|
||||
The new <a href="/pkg/os/signal/#Ignored"><code>Ignored</code></a> function reports
|
||||
whether a signal is currently ignored.
|
||||
</p>
|
||||
|
||||
</dl><!-- os/signal -->
|
||||
|
||||
<dl id="os/user"><dt><a href="/pkg/os/user/">os/user</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 92456 -->
|
||||
The <code>os/user</code> package can now be built in pure Go
|
||||
mode using the build tag "<code>osusergo</code>",
|
||||
independent of the use of the environment
|
||||
variable <code>CGO_ENABLED=0</code>. Previously the only way to use
|
||||
the package's pure Go implementation was to disable <code>cgo</code>
|
||||
support across the entire program.
|
||||
</p>
|
||||
|
||||
</dl><!-- os/user -->
|
||||
|
||||
<!-- CL 101715 was reverted -->
|
||||
|
||||
<dl id="pkg-runtime"><dt id="runtime-again"><a href="/pkg/runtime/">runtime</a></dt>
|
||||
<dd>
|
||||
|
||||
<p><!-- CL 70993 -->
|
||||
Setting the <code>GODEBUG=tracebackancestors=<em>N</em></code>
|
||||
environment variable now extends tracebacks with the stacks at
|
||||
which goroutines were created, where <em>N</em> limits the
|
||||
number of ancestor goroutines to report.
|
||||
</p>
|
||||
|
||||
</dl><!-- runtime -->
|
||||
|
||||
<dl id="runtime/pprof"><dt><a href="/pkg/runtime/pprof/">runtime/pprof</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 102696 -->
|
||||
This release adds a new "allocs" profile type that profiles
|
||||
total number of bytes allocated since the program began
|
||||
(including garbage-collected bytes). This is identical to the
|
||||
existing "heap" profile viewed in <code>-alloc_space</code> mode.
|
||||
Now <code>go test -memprofile=...</code> reports an "allocs" profile
|
||||
instead of "heap" profile.
|
||||
</p>
|
||||
|
||||
</dl><!-- runtime/pprof -->
|
||||
|
||||
<dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 87095 -->
|
||||
The mutex profile now includes reader/writer contention
|
||||
for <a href="/pkg/sync/#RWMutex"><code>RWMutex</code></a>.
|
||||
Writer/writer contention was already included in the mutex
|
||||
profile.
|
||||
</p>
|
||||
|
||||
</dl><!-- sync -->
|
||||
|
||||
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 106275 -->
|
||||
On Windows, several fields were changed from <code>uintptr</code> to a new
|
||||
<a href="/pkg/syscall/?GOOS=windows&GOARCH=amd64#Pointer"><code>Pointer</code></a>
|
||||
type to avoid problems with Go's garbage collector. The same change was made
|
||||
to the <a href="https://godoc.org/golang.org/x/sys/windows"><code>golang.org/x/sys/windows</code></a>
|
||||
package. For any code affected, users should first migrate away from the <code>syscall</code>
|
||||
package to the <code>golang.org/x/sys/windows</code> package, and then change
|
||||
to using the <code>Pointer</code>, while obeying the
|
||||
<a href="/pkg/unsafe/#Pointer"><code>unsafe.Pointer</code> conversion rules</a>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 118658 -->
|
||||
On Linux, the <code>flags</code> parameter to
|
||||
<a href="/pkg/syscall/?GOOS=linux&GOARCH=amd64#Faccessat"><code>Faccessat</code></a>
|
||||
is now implemented just as in glibc. In earlier Go releases the
|
||||
flags parameter was ignored.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 118658 -->
|
||||
On Linux, the <code>flags</code> parameter to
|
||||
<a href="/pkg/syscall/?GOOS=linux&GOARCH=amd64#Fchmodat"><code>Fchmodat</code></a>
|
||||
is now validated. Linux's <code>fchmodat</code> doesn't support the <code>flags</code> parameter
|
||||
so we now mimic glibc's behavior and return an error if it's non-zero.
|
||||
</p>
|
||||
|
||||
</dl><!-- syscall -->
|
||||
|
||||
<dl id="text/scanner"><dt><a href="/pkg/text/scanner/">text/scanner</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 112037 -->
|
||||
The <a href="/pkg/text/scanner/#Scanner.Scan"><code>Scanner.Scan</code></a> method now returns
|
||||
the <a href="/pkg/text/scanner/#RawString"><code>RawString</code></a> token
|
||||
instead of <a href="/pkg/text/scanner/#String"><code>String</code></a>
|
||||
for raw string literals.
|
||||
</p>
|
||||
|
||||
</dl><!-- text/scanner -->
|
||||
|
||||
<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 84480 -->
|
||||
Modifying template variables via assignments is now permitted via the <code>=</code> token:
|
||||
</p>
|
||||
<pre>
|
||||
{{"{{"}} $v := "init" {{"}}"}}
|
||||
{{"{{"}} if true {{"}}"}}
|
||||
{{"{{"}} $v = "changed" {{"}}"}}
|
||||
{{"{{"}} end {{"}}"}}
|
||||
v: {{"{{"}} $v {{"}}"}} {{"{{"}}/* "changed" */{{"}}"}}</pre>
|
||||
|
||||
<p><!-- CL 95215 -->
|
||||
In previous versions untyped <code>nil</code> values passed to
|
||||
template functions were ignored. They are now passed as normal
|
||||
arguments.
|
||||
</p>
|
||||
|
||||
</dl><!-- text/template -->
|
||||
|
||||
<dl id="time"><dt><a href="/pkg/time/">time</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 98157 -->
|
||||
Parsing of timezones denoted by sign and offset is now
|
||||
supported. In previous versions, numeric timezone names
|
||||
(such as <code>+03</code>) were not considered valid, and only
|
||||
three-letter abbreviations (such as <code>MST</code>) were accepted
|
||||
when expecting a timezone name.
|
||||
</p>
|
||||
</dl><!-- time -->
|
||||
949
doc/go1.12.html
949
doc/go1.12.html
@@ -1,949 +0,0 @@
|
||||
<!--{
|
||||
"Title": "Go 1.12 Release Notes",
|
||||
"Path": "/doc/go1.12",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<!--
|
||||
NOTE: In this document and others in this directory, the convention is to
|
||||
set fixed-width phrases with non-fixed-width spaces, as in
|
||||
<code>hello</code> <code>world</code>.
|
||||
Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
|
||||
<style>
|
||||
main ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">Introduction to Go 1.12</h2>
|
||||
|
||||
<p>
|
||||
The latest Go release, version 1.12, arrives six months after <a href="go1.11">Go 1.11</a>.
|
||||
Most of its changes are in the implementation of the toolchain, runtime, and libraries.
|
||||
As always, the release maintains the Go 1 <a href="/doc/go1compat">promise of compatibility</a>.
|
||||
We expect almost all Go programs to continue to compile and run as before.
|
||||
</p>
|
||||
|
||||
<h2 id="language">Changes to the language</h2>
|
||||
|
||||
<p>
|
||||
There are no changes to the language specification.
|
||||
</p>
|
||||
|
||||
<h2 id="ports">Ports</h2>
|
||||
|
||||
<p><!-- CL 138675 -->
|
||||
The race detector is now supported on <code>linux/arm64</code>.
|
||||
</p>
|
||||
|
||||
<p id="freebsd">
|
||||
Go 1.12 is the last release that is supported on FreeBSD 10.x, which has
|
||||
already reached end-of-life. Go 1.13 will require FreeBSD 11.2+ or FreeBSD
|
||||
12.0+.
|
||||
FreeBSD 12.0+ requires a kernel with the COMPAT_FREEBSD11 option set (this is the default).
|
||||
</p>
|
||||
|
||||
<p><!-- CL 146898 -->
|
||||
cgo is now supported on <code>linux/ppc64</code>.
|
||||
</p>
|
||||
|
||||
<p id="hurd"><!-- CL 146023 -->
|
||||
<code>hurd</code> is now a recognized value for <code>GOOS</code>, reserved
|
||||
for the GNU/Hurd system for use with <code>gccgo</code>.
|
||||
</p>
|
||||
|
||||
<h3 id="windows">Windows</h3>
|
||||
|
||||
<p>
|
||||
Go's new <code>windows/arm</code> port supports running Go on Windows 10
|
||||
IoT Core on 32-bit ARM chips such as the Raspberry Pi 3.
|
||||
</p>
|
||||
|
||||
<h3 id="aix">AIX</h3>
|
||||
|
||||
<p>
|
||||
Go now supports AIX 7.2 and later on POWER8 architectures (<code>aix/ppc64</code>). External linking, cgo, pprof and the race detector aren't yet supported.
|
||||
</p>
|
||||
|
||||
<h3 id="darwin">Darwin</h3>
|
||||
|
||||
<p>
|
||||
Go 1.12 is the last release that will run on macOS 10.10 Yosemite.
|
||||
Go 1.13 will require macOS 10.11 El Capitan or later.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 141639 -->
|
||||
<code>libSystem</code> is now used when making syscalls on Darwin,
|
||||
ensuring forward-compatibility with future versions of macOS and iOS.
|
||||
<!-- CL 153338 -->
|
||||
The switch to <code>libSystem</code> triggered additional App Store
|
||||
checks for private API usage. Since it is considered private,
|
||||
<code>syscall.Getdirentries</code> now always fails with
|
||||
<code>ENOSYS</code> on iOS.
|
||||
Additionally, <a href="/pkg/syscall/#Setrlimit"><code>syscall.Setrlimit</code></a>
|
||||
reports <code>invalid</code> <code>argument</code> in places where it historically
|
||||
succeeded. These consequences are not specific to Go and users should expect
|
||||
behavioral parity with <code>libSystem</code>'s implementation going forward.
|
||||
</p>
|
||||
|
||||
<h2 id="tools">Tools</h2>
|
||||
|
||||
<h3 id="vet"><code>go tool vet</code> no longer supported</h3>
|
||||
|
||||
<p>
|
||||
The <code>go vet</code> command has been rewritten to serve as the
|
||||
base for a range of different source code analysis tools. See
|
||||
the <a href="https://godoc.org/golang.org/x/tools/go/analysis">golang.org/x/tools/go/analysis</a>
|
||||
package for details. A side-effect is that <code>go tool vet</code>
|
||||
is no longer supported. External tools that use <code>go tool
|
||||
vet</code> must be changed to use <code>go
|
||||
vet</code>. Using <code>go vet</code> instead of <code>go tool
|
||||
vet</code> should work with all supported versions of Go.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
As part of this change, the experimental <code>-shadow</code> option
|
||||
is no longer available with <code>go vet</code>. Checking for
|
||||
variable shadowing may now be done using
|
||||
<pre>
|
||||
go get -u golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
|
||||
go vet -vettool=$(which shadow)
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<h3 id="tour">Tour</h3>
|
||||
|
||||
<p> <!-- CL 152657 -->
|
||||
The Go tour is no longer included in the main binary distribution. To
|
||||
run the tour locally, instead of running <code>go</code> <code>tool</code> <code>tour</code>,
|
||||
manually install it:
|
||||
<pre>
|
||||
go get -u golang.org/x/tour
|
||||
tour
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<h3 id="gocache">Build cache requirement</h3>
|
||||
|
||||
<p>
|
||||
The <a href="/cmd/go/#hdr-Build_and_test_caching">build cache</a> is now
|
||||
required as a step toward eliminating
|
||||
<code>$GOPATH/pkg</code>. Setting the environment variable
|
||||
<code>GOCACHE=off</code> will cause <code>go</code> commands that write to the
|
||||
cache to fail.
|
||||
</p>
|
||||
|
||||
<h3 id="binary-only">Binary-only packages</h3>
|
||||
|
||||
<p>
|
||||
Go 1.12 is the last release that will support binary-only packages.
|
||||
</p>
|
||||
|
||||
<h3 id="cgo">Cgo</h3>
|
||||
|
||||
<p>
|
||||
Go 1.12 will translate the C type <code>EGLDisplay</code> to the Go type <code>uintptr</code>.
|
||||
This change is similar to how Go 1.10 and newer treats Darwin's CoreFoundation
|
||||
and Java's JNI types. See the
|
||||
<a href="/cmd/cgo/#hdr-Special_cases">cgo documentation</a>
|
||||
for more information.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 152657 -->
|
||||
Mangled C names are no longer accepted in packages that use Cgo. Use the Cgo
|
||||
names instead. For example, use the documented cgo name <code>C.char</code>
|
||||
rather than the mangled name <code>_Ctype_char</code> that cgo generates.
|
||||
</p>
|
||||
|
||||
<h3 id="modules">Modules</h3>
|
||||
|
||||
<p><!-- CL 148517 -->
|
||||
When <code>GO111MODULE</code> is set to <code>on</code>, the <code>go</code>
|
||||
command now supports module-aware operations outside of a module directory,
|
||||
provided that those operations do not need to resolve import paths relative to
|
||||
the current directory or explicitly edit the <code>go.mod</code> file.
|
||||
Commands such as <code>go</code> <code>get</code>,
|
||||
<code>go</code> <code>list</code>, and
|
||||
<code>go</code> <code>mod</code> <code>download</code> behave as if in a
|
||||
module with initially-empty requirements.
|
||||
In this mode, <code>go</code> <code>env</code> <code>GOMOD</code> reports
|
||||
the system's null device (<code>/dev/null</code> or <code>NUL</code>).
|
||||
</p>
|
||||
|
||||
<p><!-- CL 146382 -->
|
||||
<code>go</code> commands that download and extract modules are now safe to
|
||||
invoke concurrently.
|
||||
The module cache (<code>GOPATH/pkg/mod</code>) must reside in a filesystem that
|
||||
supports file locking.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 147282, 147281 -->
|
||||
The <code>go</code> directive in a <code>go.mod</code> file now indicates the
|
||||
version of the language used by the files within that module.
|
||||
It will be set to the current release
|
||||
(<code>go</code> <code>1.12</code>) if no existing version is
|
||||
present.
|
||||
If the <code>go</code> directive for a module specifies a
|
||||
version <em>newer</em> than the toolchain in use, the <code>go</code> command
|
||||
will attempt to build the packages regardless, and will note the mismatch only if
|
||||
that build fails.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 147282, 147281 -->
|
||||
This changed use of the <code>go</code> directive means that if you
|
||||
use Go 1.12 to build a module, thus recording <code>go 1.12</code>
|
||||
in the <code>go.mod</code> file, you will get an error when
|
||||
attempting to build the same module with Go 1.11 through Go 1.11.3.
|
||||
Go 1.11.4 or later will work fine, as will releases older than Go 1.11.
|
||||
If you must use Go 1.11 through 1.11.3, you can avoid the problem by
|
||||
setting the language version to 1.11, using the Go 1.12 go tool,
|
||||
via <code>go mod edit -go=1.11</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 152739 -->
|
||||
When an import cannot be resolved using the active modules,
|
||||
the <code>go</code> command will now try to use the modules mentioned in the
|
||||
main module's <code>replace</code> directives before consulting the module
|
||||
cache and the usual network sources.
|
||||
If a matching replacement is found but the <code>replace</code> directive does
|
||||
not specify a version, the <code>go</code> command uses a pseudo-version
|
||||
derived from the zero <code>time.Time</code> (such
|
||||
as <code>v0.0.0-00010101000000-000000000000</code>).
|
||||
</p>
|
||||
|
||||
<h3 id="compiler">Compiler toolchain</h3>
|
||||
|
||||
<p><!-- CL 134155, 134156 -->
|
||||
The compiler's live variable analysis has improved. This may mean that
|
||||
finalizers will be executed sooner in this release than in previous
|
||||
releases. If that is a problem, consider the appropriate addition of a
|
||||
<a href="/pkg/runtime/#KeepAlive"><code>runtime.KeepAlive</code></a> call.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 147361 -->
|
||||
More functions are now eligible for inlining by default, including
|
||||
functions that do nothing but call another function.
|
||||
This extra inlining makes it additionally important to use
|
||||
<a href="/pkg/runtime/#CallersFrames"><code>runtime.CallersFrames</code></a>
|
||||
instead of iterating over the result of
|
||||
<a href="/pkg/runtime/#Callers"><code>runtime.Callers</code></a> directly.
|
||||
<pre>
|
||||
// Old code which no longer works correctly (it will miss inlined call frames).
|
||||
var pcs [10]uintptr
|
||||
n := runtime.Callers(1, pcs[:])
|
||||
for _, pc := range pcs[:n] {
|
||||
f := runtime.FuncForPC(pc)
|
||||
if f != nil {
|
||||
fmt.Println(f.Name())
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<pre>
|
||||
// New code which will work correctly.
|
||||
var pcs [10]uintptr
|
||||
n := runtime.Callers(1, pcs[:])
|
||||
frames := runtime.CallersFrames(pcs[:n])
|
||||
for {
|
||||
frame, more := frames.Next()
|
||||
fmt.Println(frame.Function)
|
||||
if !more {
|
||||
break
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<p><!-- CL 153477 -->
|
||||
Wrappers generated by the compiler to implement method expressions
|
||||
are no longer reported
|
||||
by <a href="/pkg/runtime/#CallersFrames"><code>runtime.CallersFrames</code></a>
|
||||
and <a href="/pkg/runtime/#Stack"><code>runtime.Stack</code></a>. They
|
||||
are also not printed in panic stack traces.
|
||||
|
||||
This change aligns the <code>gc</code> toolchain to match
|
||||
the <code>gccgo</code> toolchain, which already elided such wrappers
|
||||
from stack traces.
|
||||
|
||||
Clients of these APIs might need to adjust for the missing
|
||||
frames. For code that must interoperate between 1.11 and 1.12
|
||||
releases, you can replace the method expression <code>x.M</code>
|
||||
with the function literal <code>func (...) { x.M(...) } </code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 144340 -->
|
||||
The compiler now accepts a <code>-lang</code> flag to set the Go language
|
||||
version to use. For example, <code>-lang=go1.8</code> causes the compiler to
|
||||
emit an error if the program uses type aliases, which were added in Go 1.9.
|
||||
Language changes made before Go 1.12 are not consistently enforced.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 147160 -->
|
||||
The compiler toolchain now uses different conventions to call Go
|
||||
functions and assembly functions. This should be invisible to users,
|
||||
except for calls that simultaneously cross between Go and
|
||||
assembly <em>and</em> cross a package boundary. If linking results
|
||||
in an error like "relocation target not defined for ABIInternal (but
|
||||
is defined for ABI0)", please refer to the
|
||||
<a href="https://github.com/golang/proposal/blob/master/design/27539-internal-abi.md#compatibility">compatibility section</a>
|
||||
of the ABI design document.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 145179 -->
|
||||
There have been many improvements to the DWARF debug information
|
||||
produced by the compiler, including improvements to argument
|
||||
printing and variable location information.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 61511 -->
|
||||
Go programs now also maintain stack frame pointers on <code>linux/arm64</code>
|
||||
for the benefit of profiling tools like <code>perf</code>. The frame pointer
|
||||
maintenance has a small run-time overhead that varies but averages around 3%.
|
||||
To build a toolchain that does not use frame pointers, set
|
||||
<code>GOEXPERIMENT=noframepointer</code> when running <code>make.bash</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 142717 -->
|
||||
The obsolete "safe" compiler mode (enabled by the <code>-u</code> gcflag) has been removed.
|
||||
</p>
|
||||
|
||||
<h3 id="godoc"><code>godoc</code> and <code>go</code> <code>doc</code></h3>
|
||||
|
||||
<p>
|
||||
In Go 1.12, <code>godoc</code> no longer has a command-line interface and
|
||||
is only a web server. Users should use <code>go</code> <code>doc</code>
|
||||
for command-line help output instead. Go 1.12 is the last release that will
|
||||
include the <code>godoc</code> webserver; in Go 1.13 it will be available
|
||||
via <code>go</code> <code>get</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 141977 -->
|
||||
<code>go</code> <code>doc</code> now supports the <code>-all</code> flag,
|
||||
which will cause it to print all exported APIs and their documentation,
|
||||
as the <code>godoc</code> command line used to do.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 140959 -->
|
||||
<code>go</code> <code>doc</code> also now includes the <code>-src</code> flag,
|
||||
which will show the target's source code.
|
||||
</p>
|
||||
|
||||
<h3 id="trace">Trace</h3>
|
||||
|
||||
<p><!-- CL 60790 -->
|
||||
The trace tool now supports plotting mutator utilization curves,
|
||||
including cross-references to the execution trace. These are useful
|
||||
for analyzing the impact of the garbage collector on application
|
||||
latency and throughput.
|
||||
</p>
|
||||
|
||||
<h3 id="assembler">Assembler</h3>
|
||||
|
||||
<p><!-- CL 147218 -->
|
||||
On <code>arm64</code>, the platform register was renamed from
|
||||
<code>R18</code> to <code>R18_PLATFORM</code> to prevent accidental
|
||||
use, as the OS could choose to reserve this register.
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime</h2>
|
||||
|
||||
<p><!-- CL 138959 -->
|
||||
Go 1.12 significantly improves the performance of sweeping when a
|
||||
large fraction of the heap remains live. This reduces allocation
|
||||
latency immediately following a garbage collection.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 139719 -->
|
||||
The Go runtime now releases memory back to the operating system more
|
||||
aggressively, particularly in response to large allocations that
|
||||
can't reuse existing heap space.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 146342, CL 146340, CL 146345, CL 146339, CL 146343, CL 146337, CL 146341, CL 146338 -->
|
||||
The Go runtime's timer and deadline code is faster and scales better
|
||||
with higher numbers of CPUs. In particular, this improves the
|
||||
performance of manipulating network connection deadlines.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 135395 -->
|
||||
On Linux, the runtime now uses <code>MADV_FREE</code> to release unused
|
||||
memory. This is more efficient but may result in higher reported
|
||||
RSS. The kernel will reclaim the unused data when it is needed.
|
||||
To revert to the Go 1.11 behavior (<code>MADV_DONTNEED</code>), set the
|
||||
environment variable <code>GODEBUG=madvdontneed=1</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 149578 -->
|
||||
Adding cpu.<em>extension</em>=off to the
|
||||
<a href="/doc/diagnostics.html#godebug">GODEBUG</a> environment
|
||||
variable now disables the use of optional CPU instruction
|
||||
set extensions in the standard library and runtime. This is not
|
||||
yet supported on Windows.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 158337 -->
|
||||
Go 1.12 improves the accuracy of memory profiles by fixing
|
||||
overcounting of large heap allocations.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 159717 -->
|
||||
Tracebacks, <code>runtime.Caller</code>,
|
||||
and <code>runtime.Callers</code> no longer include
|
||||
compiler-generated initialization functions. Doing a traceback
|
||||
during the initialization of a global variable will now show a
|
||||
function named <code>PKG.init.ializers</code>.
|
||||
</p>
|
||||
|
||||
<h2 id="library">Core library</h2>
|
||||
|
||||
<h3 id="tls_1_3">TLS 1.3</h3>
|
||||
|
||||
<p>
|
||||
Go 1.12 adds opt-in support for TLS 1.3 in the <code>crypto/tls</code> package as
|
||||
specified by <a href="https://www.rfc-editor.org/info/rfc8446">RFC 8446</a>. It can
|
||||
be enabled by adding the value <code>tls13=1</code> to the <code>GODEBUG</code>
|
||||
environment variable. It will be enabled by default in Go 1.13.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To negotiate TLS 1.3, make sure you do not set an explicit <code>MaxVersion</code> in
|
||||
<a href="/pkg/crypto/tls/#Config"><code>Config</code></a> and run your program with
|
||||
the environment variable <code>GODEBUG=tls13=1</code> set.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
All TLS 1.2 features except <code>TLSUnique</code> in
|
||||
<a href="/pkg/crypto/tls/#ConnectionState"><code>ConnectionState</code></a>
|
||||
and renegotiation are available in TLS 1.3 and provide equivalent or
|
||||
better security and performance. Note that even though TLS 1.3 is backwards
|
||||
compatible with previous versions, certain legacy systems might not work
|
||||
correctly when attempting to negotiate it. RSA certificate keys too small
|
||||
to be secure (including 512-bit keys) will not work with TLS 1.3.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TLS 1.3 cipher suites are not configurable. All supported cipher suites are
|
||||
safe, and if <code>PreferServerCipherSuites</code> is set in
|
||||
<a href="/pkg/crypto/tls/#Config"><code>Config</code></a> the preference order
|
||||
is based on the available hardware.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Early data (also called "0-RTT mode") is not currently supported as a
|
||||
client or server. Additionally, a Go 1.12 server does not support skipping
|
||||
unexpected early data if a client sends it. Since TLS 1.3 0-RTT mode
|
||||
involves clients keeping state regarding which servers support 0-RTT,
|
||||
a Go 1.12 server cannot be part of a load-balancing pool where some other
|
||||
servers do support 0-RTT. If switching a domain from a server that supported
|
||||
0-RTT to a Go 1.12 server, 0-RTT would have to be disabled for at least the
|
||||
lifetime of the issued session tickets before the switch to ensure
|
||||
uninterrupted operation.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In TLS 1.3 the client is the last one to speak in the handshake, so if it causes
|
||||
an error to occur on the server, it will be returned on the client by the first
|
||||
<a href="/pkg/crypto/tls/#Conn.Read"><code>Read</code></a>, not by
|
||||
<a href="/pkg/crypto/tls/#Conn.Handshake"><code>Handshake</code></a>. For
|
||||
example, that will be the case if the server rejects the client certificate.
|
||||
Similarly, session tickets are now post-handshake messages, so are only
|
||||
received by the client upon its first
|
||||
<a href="/pkg/crypto/tls/#Conn.Read"><code>Read</code></a>.
|
||||
</p>
|
||||
|
||||
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
||||
|
||||
<p>
|
||||
As always, there are various minor changes and updates to the library,
|
||||
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
|
||||
in mind.
|
||||
</p>
|
||||
|
||||
<!-- TODO: CL 115677: https://golang.org/cl/115677: cmd/vet: check embedded field tags too -->
|
||||
|
||||
<dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 149297 -->
|
||||
<code>Reader</code>'s <a href="/pkg/bufio/#Reader.UnreadRune"><code>UnreadRune</code></a> and
|
||||
<a href="/pkg/bufio/#Reader.UnreadByte"><code>UnreadByte</code></a> methods will now return an error
|
||||
if they are called after <a href="/pkg/bufio/#Reader.Peek"><code>Peek</code></a>.
|
||||
</p>
|
||||
|
||||
</dl><!-- bufio -->
|
||||
|
||||
<dl id="bytes"><dt><a href="/pkg/bytes/">bytes</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 137855 -->
|
||||
The new function <a href="/pkg/bytes/#ReplaceAll"><code>ReplaceAll</code></a> returns a copy of
|
||||
a byte slice with all non-overlapping instances of a value replaced by another.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 145098 -->
|
||||
A pointer to a zero-value <a href="/pkg/bytes/#Reader"><code>Reader</code></a> is now
|
||||
functionally equivalent to <a href="/pkg/bytes/#NewReader"><code>NewReader</code></a><code>(nil)</code>.
|
||||
Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases.
|
||||
</p>
|
||||
|
||||
</dl><!-- bytes -->
|
||||
|
||||
<dl id="crypto/rand"><dt><a href="/pkg/crypto/rand/">crypto/rand</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 139419 -->
|
||||
A warning will now be printed to standard error the first time
|
||||
<code>Reader.Read</code> is blocked for more than 60 seconds waiting
|
||||
to read entropy from the kernel.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 120055 -->
|
||||
On FreeBSD, <code>Reader</code> now uses the <code>getrandom</code>
|
||||
system call if available, <code>/dev/urandom</code> otherwise.
|
||||
</p>
|
||||
|
||||
</dl><!-- crypto/rand -->
|
||||
|
||||
<dl id="crypto/rc4"><dt><a href="/pkg/crypto/rc4/">crypto/rc4</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 130397 -->
|
||||
This release removes the assembly implementations, leaving only
|
||||
the pure Go version. The Go compiler generates code that is
|
||||
either slightly better or slightly worse, depending on the exact
|
||||
CPU. RC4 is insecure and should only be used for compatibility
|
||||
with legacy systems.
|
||||
</p>
|
||||
|
||||
</dl><!-- crypto/rc4 -->
|
||||
|
||||
<dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 143177 -->
|
||||
If a client sends an initial message that does not look like TLS, the server
|
||||
will no longer reply with an alert, and it will expose the underlying
|
||||
<code>net.Conn</code> in the new field <code>Conn</code> of
|
||||
<a href="/pkg/crypto/tls/#RecordHeaderError"><code>RecordHeaderError</code></a>.
|
||||
</p>
|
||||
|
||||
</dl><!-- crypto/tls -->
|
||||
|
||||
<dl id="database/sql"><dt><a href="/pkg/database/sql/">database/sql</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 145738 -->
|
||||
A query cursor can now be obtained by passing a
|
||||
<a href="/pkg/database/sql/#Rows"><code>*Rows</code></a>
|
||||
value to the <a href="/pkg/database/sql/#Row.Scan"><code>Row.Scan</code></a> method.
|
||||
</p>
|
||||
|
||||
</dl><!-- database/sql -->
|
||||
|
||||
<dl id="expvar"><dt><a href="/pkg/expvar/">expvar</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 139537 -->
|
||||
The new <a href="/pkg/expvar/#Map.Delete"><code>Delete</code></a> method allows
|
||||
for deletion of key/value pairs from a <a href="/pkg/expvar/#Map"><code>Map</code></a>.
|
||||
</p>
|
||||
|
||||
</dl><!-- expvar -->
|
||||
|
||||
<dl id="fmt"><dt><a href="/pkg/fmt/">fmt</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 142737 -->
|
||||
Maps are now printed in key-sorted order to ease testing. The ordering rules are:
|
||||
<ul>
|
||||
<li>When applicable, nil compares low
|
||||
<li>ints, floats, and strings order by <
|
||||
<li>NaN compares less than non-NaN floats
|
||||
<li>bool compares false before true
|
||||
<li>Complex compares real, then imaginary
|
||||
<li>Pointers compare by machine address
|
||||
<li>Channel values compare by machine address
|
||||
<li>Structs compare each field in turn
|
||||
<li>Arrays compare each element in turn
|
||||
<li>Interface values compare first by <code>reflect.Type</code> describing the concrete type
|
||||
and then by concrete value as described in the previous rules.
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p><!-- CL 129777 -->
|
||||
When printing maps, non-reflexive key values like <code>NaN</code> were previously
|
||||
displayed as <code><nil></code>. As of this release, the correct values are printed.
|
||||
</p>
|
||||
|
||||
</dl><!-- fmt -->
|
||||
|
||||
<dl id="go/doc"><dt><a href="/pkg/go/doc/">go/doc</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 140958 -->
|
||||
To address some outstanding issues in <a href="/cmd/doc/"><code>cmd/doc</code></a>,
|
||||
this package has a new <a href="/pkg/go/doc/#Mode"><code>Mode</code></a> bit,
|
||||
<code>PreserveAST</code>, which controls whether AST data is cleared.
|
||||
</p>
|
||||
|
||||
</dl><!-- go/doc -->
|
||||
|
||||
<dl id="go/token"><dt><a href="/pkg/go/token/">go/token</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 134075 -->
|
||||
The <a href="/pkg/go/token#File"><code>File</code></a> type has a new
|
||||
<a href="/pkg/go/token#File.LineStart"><code>LineStart</code></a> field,
|
||||
which returns the position of the start of a given line. This is especially useful
|
||||
in programs that occasionally handle non-Go files, such as assembly, but wish to use
|
||||
the <code>token.Pos</code> mechanism to identify file positions.
|
||||
</p>
|
||||
|
||||
</dl><!-- go/token -->
|
||||
|
||||
<dl id="image"><dt><a href="/pkg/image/">image</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 118755 -->
|
||||
The <a href="/pkg/image/#RegisterFormat"><code>RegisterFormat</code></a> function is now safe for concurrent use.
|
||||
</p>
|
||||
|
||||
</dl><!-- image -->
|
||||
|
||||
<dl id="image/png"><dt><a href="/pkg/image/png/">image/png</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 134235 -->
|
||||
Paletted images with fewer than 16 colors now encode to smaller outputs.
|
||||
</p>
|
||||
|
||||
</dl><!-- image/png -->
|
||||
|
||||
<dl id="io"><dt><a href="/pkg/io/">io</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 139457 -->
|
||||
The new <a href="/pkg/io#StringWriter"><code>StringWriter</code></a> interface wraps the
|
||||
<a href="/pkg/io/#WriteString"><code>WriteString</code></a> function.
|
||||
</p>
|
||||
|
||||
</dl><!-- io -->
|
||||
|
||||
<dl id="math"><dt><a href="/pkg/math/">math</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 153059 -->
|
||||
The functions
|
||||
<a href="/pkg/math/#Sin"><code>Sin</code></a>,
|
||||
<a href="/pkg/math/#Cos"><code>Cos</code></a>,
|
||||
<a href="/pkg/math/#Tan"><code>Tan</code></a>,
|
||||
and <a href="/pkg/math/#Sincos"><code>Sincos</code></a> now
|
||||
apply Payne-Hanek range reduction to huge arguments. This
|
||||
produces more accurate answers, but they will not be bit-for-bit
|
||||
identical with the results in earlier releases.
|
||||
</p>
|
||||
</dl><!-- math -->
|
||||
|
||||
<dl id="math/bits"><dt><a href="/pkg/math/bits/">math/bits</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 123157 -->
|
||||
New extended precision operations <a href="/pkg/math/bits/#Add"><code>Add</code></a>, <a href="/pkg/math/bits/#Sub"><code>Sub</code></a>, <a href="/pkg/math/bits/#Mul"><code>Mul</code></a>, and <a href="/pkg/math/bits/#Div"><code>Div</code></a> are available in <code>uint</code>, <code>uint32</code>, and <code>uint64</code> versions.
|
||||
</p>
|
||||
|
||||
</dl><!-- math/bits -->
|
||||
|
||||
<dl id="net"><dt><a href="/pkg/net/">net</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 146659 -->
|
||||
The
|
||||
<a href="/pkg/net/#Dialer.DualStack"><code>Dialer.DualStack</code></a> setting is now ignored and deprecated;
|
||||
RFC 6555 Fast Fallback ("Happy Eyeballs") is now enabled by default. To disable, set
|
||||
<a href="/pkg/net/#Dialer.FallbackDelay"><code>Dialer.FallbackDelay</code></a> to a negative value.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 107196 -->
|
||||
Similarly, TCP keep-alives are now enabled by default if
|
||||
<a href="/pkg/net/#Dialer.KeepAlive"><code>Dialer.KeepAlive</code></a> is zero.
|
||||
To disable, set it to a negative value.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 113997 -->
|
||||
On Linux, the <a href="http://man7.org/linux/man-pages/man2/splice.2.html"><code>splice</code> system call</a> is now used when copying from a
|
||||
<a href="/pkg/net/#UnixConn"><code>UnixConn</code></a> to a
|
||||
<a href="/pkg/net/#TCPConn"><code>TCPConn</code></a>.
|
||||
</p>
|
||||
</dl><!-- net -->
|
||||
|
||||
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 143177 -->
|
||||
The HTTP server now rejects misdirected HTTP requests to HTTPS servers with a plaintext "400 Bad Request" response.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 130115 -->
|
||||
The new <a href="/pkg/net/http/#Client.CloseIdleConnections"><code>Client.CloseIdleConnections</code></a>
|
||||
method calls the <code>Client</code>'s underlying <code>Transport</code>'s <code>CloseIdleConnections</code>
|
||||
if it has one.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 145398 -->
|
||||
The <a href="/pkg/net/http/#Transport"><code>Transport</code></a> no longer rejects HTTP responses which declare
|
||||
HTTP Trailers but don't use chunked encoding. Instead, the declared trailers are now just ignored.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 152080 --> <!-- CL 151857 -->
|
||||
The <a href="/pkg/net/http/#Transport"><code>Transport</code></a> no longer handles <code>MAX_CONCURRENT_STREAMS</code> values
|
||||
advertised from HTTP/2 servers as strictly as it did during Go 1.10 and Go 1.11. The default behavior is now back
|
||||
to how it was in Go 1.9: each connection to a server can have up to <code>MAX_CONCURRENT_STREAMS</code> requests
|
||||
active and then new TCP connections are created as needed. In Go 1.10 and Go 1.11 the <code>http2</code> package
|
||||
would block and wait for requests to finish instead of creating new connections.
|
||||
To get the stricter behavior back, import the
|
||||
<a href="https://godoc.org/golang.org/x/net/http2"><code>golang.org/x/net/http2</code></a> package
|
||||
directly and set
|
||||
<a href="https://godoc.org/golang.org/x/net/http2#Transport.StrictMaxConcurrentStreams"><code>Transport.StrictMaxConcurrentStreams</code></a> to
|
||||
<code>true</code>.
|
||||
</p>
|
||||
|
||||
</dl><!-- net/http -->
|
||||
|
||||
<dl id="net/url"><dt><a href="/pkg/net/url/">net/url</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 159157, CL 160178 -->
|
||||
<a href="/pkg/net/url/#Parse"><code>Parse</code></a>,
|
||||
<a href="/pkg/net/url/#ParseRequestURI"><code>ParseRequestURI</code></a>,
|
||||
and
|
||||
<a href="/pkg/net/url/#URL.Parse"><code>URL.Parse</code></a>
|
||||
now return an
|
||||
error for URLs containing ASCII control characters, which includes NULL,
|
||||
tab, and newlines.
|
||||
</p>
|
||||
|
||||
</dl><!-- net/url -->
|
||||
|
||||
<dl id="net/http/httputil"><dt><a href="/pkg/net/http/httputil/">net/http/httputil</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 146437 -->
|
||||
The <a href="/pkg/net/http/httputil/#ReverseProxy"><code>ReverseProxy</code></a> now automatically
|
||||
proxies WebSocket requests.
|
||||
</p>
|
||||
|
||||
</dl><!-- net/http/httputil -->
|
||||
|
||||
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 125443 -->
|
||||
The new <a href="/pkg/os/#ProcessState.ExitCode"><code>ProcessState.ExitCode</code></a> method
|
||||
returns the process's exit code.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 135075 -->
|
||||
<code>ModeCharDevice</code> has been added to the <code>ModeType</code> bitmask, allowing for
|
||||
<code>ModeDevice | ModeCharDevice</code> to be recovered when masking a
|
||||
<a href="/pkg/os/#FileMode"><code>FileMode</code></a> with <code>ModeType</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 139418 -->
|
||||
The new function <a href="/pkg/os/#UserHomeDir"><code>UserHomeDir</code></a> returns the
|
||||
current user's home directory.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 146020 -->
|
||||
<a href="/pkg/os/#RemoveAll"><code>RemoveAll</code></a> now supports paths longer than 4096 characters
|
||||
on most Unix systems.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 130676 -->
|
||||
<a href="/pkg/os/#File.Sync"><code>File.Sync</code></a> now uses <code>F_FULLFSYNC</code> on macOS
|
||||
to correctly flush the file contents to permanent storage.
|
||||
This may cause the method to run more slowly than in previous releases.
|
||||
</p>
|
||||
|
||||
<p><!--CL 155517 -->
|
||||
<a href="/pkg/os/#File"><code>File</code></a> now supports
|
||||
a <a href="/pkg/os/#File.SyscallConn"><code>SyscallConn</code></a>
|
||||
method returning
|
||||
a <a href="/pkg/syscall/#RawConn"><code>syscall.RawConn</code></a>
|
||||
interface value. This may be used to invoke system-specific
|
||||
operations on the underlying file descriptor.
|
||||
</p>
|
||||
|
||||
</dl><!-- os -->
|
||||
|
||||
<dl id="path/filepath"><dt><a href="/pkg/path/filepath/">path/filepath</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 145220 -->
|
||||
The <a href="/pkg/path/filepath/#IsAbs"><code>IsAbs</code></a> function now returns true when passed
|
||||
a reserved filename on Windows such as <code>NUL</code>.
|
||||
<a href="https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#naming-conventions">List of reserved names.</a>
|
||||
</p>
|
||||
|
||||
</dl><!-- path/filepath -->
|
||||
|
||||
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 33572 -->
|
||||
A new <a href="/pkg/reflect#MapIter"><code>MapIter</code></a> type is
|
||||
an iterator for ranging over a map. This type is exposed through the
|
||||
<a href="/pkg/reflect#Value"><code>Value</code></a> type's new
|
||||
<a href="/pkg/reflect#Value.MapRange"><code>MapRange</code></a> method.
|
||||
This follows the same iteration semantics as a range statement, with <code>Next</code>
|
||||
to advance the iterator, and <code>Key</code>/<code>Value</code> to access each entry.
|
||||
</p>
|
||||
|
||||
</dl><!-- reflect -->
|
||||
|
||||
<dl id="regexp"><dt><a href="/pkg/regexp/">regexp</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 139784 -->
|
||||
<a href="/pkg/regexp/#Regexp.Copy"><code>Copy</code></a> is no longer necessary
|
||||
to avoid lock contention, so it has been given a partial deprecation comment.
|
||||
<a href="/pkg/regexp/#Regexp.Copy"><code>Copy</code></a>
|
||||
may still be appropriate if the reason for its use is to make two copies with
|
||||
different <a href="/pkg/regexp/#Regexp.Longest"><code>Longest</code></a> settings.
|
||||
</p>
|
||||
|
||||
</dl><!-- regexp -->
|
||||
|
||||
<dl id="runtime/debug"><dt><a href="/pkg/runtime/debug/">runtime/debug</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 144220 -->
|
||||
A new <a href="/pkg/runtime/debug/#BuildInfo"><code>BuildInfo</code></a> type
|
||||
exposes the build information read from the running binary, available only in
|
||||
binaries built with module support. This includes the main package path, main
|
||||
module information, and the module dependencies. This type is given through the
|
||||
<a href="/pkg/runtime/debug/#ReadBuildInfo"><code>ReadBuildInfo</code></a> function
|
||||
on <a href="/pkg/runtime/debug/#BuildInfo"><code>BuildInfo</code></a>.
|
||||
</p>
|
||||
|
||||
</dl><!-- runtime/debug -->
|
||||
|
||||
<dl id="strings"><dt><a href="/pkg/strings/">strings</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 137855 -->
|
||||
The new function <a href="/pkg/strings/#ReplaceAll"><code>ReplaceAll</code></a> returns a copy of
|
||||
a string with all non-overlapping instances of a value replaced by another.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 145098 -->
|
||||
A pointer to a zero-value <a href="/pkg/strings/#Reader"><code>Reader</code></a> is now
|
||||
functionally equivalent to <a href="/pkg/strings/#NewReader"><code>NewReader</code></a><code>(nil)</code>.
|
||||
Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 122835 -->
|
||||
The new <a href="/pkg/strings/#Builder.Cap"><code>Builder.Cap</code></a> method returns the capacity of the builder's underlying byte slice.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 131495 -->
|
||||
The character mapping functions <a href="/pkg/strings/#Map"><code>Map</code></a>,
|
||||
<a href="/pkg/strings/#Title"><code>Title</code></a>,
|
||||
<a href="/pkg/strings/#ToLower"><code>ToLower</code></a>,
|
||||
<a href="/pkg/strings/#ToLowerSpecial"><code>ToLowerSpecial</code></a>,
|
||||
<a href="/pkg/strings/#ToTitle"><code>ToTitle</code></a>,
|
||||
<a href="/pkg/strings/#ToTitleSpecial"><code>ToTitleSpecial</code></a>,
|
||||
<a href="/pkg/strings/#ToUpper"><code>ToUpper</code></a>, and
|
||||
<a href="/pkg/strings/#ToUpperSpecial"><code>ToUpperSpecial</code></a>
|
||||
now always guarantee to return valid UTF-8. In earlier releases, if the input was invalid UTF-8 but no character replacements
|
||||
needed to be applied, these routines incorrectly returned the invalid UTF-8 unmodified.
|
||||
</p>
|
||||
|
||||
</dl><!-- strings -->
|
||||
|
||||
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 138595 -->
|
||||
64-bit inodes are now supported on FreeBSD 12. Some types have been adjusted accordingly.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 125456 -->
|
||||
The Unix socket
|
||||
(<a href="https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/"><code>AF_UNIX</code></a>)
|
||||
address family is now supported for compatible versions of Windows.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 147117 -->
|
||||
The new function <a href="/pkg/syscall/?GOOS=windows&GOARCH=amd64#Syscall18"><code>Syscall18</code></a>
|
||||
has been introduced for Windows, allowing for calls with up to 18 arguments.
|
||||
</p>
|
||||
|
||||
</dl><!-- syscall -->
|
||||
|
||||
<dl id="syscall/js"><dt><a href="/pkg/syscall/js/">syscall/js</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 153559 -->
|
||||
<p>
|
||||
The <code>Callback</code> type and <code>NewCallback</code> function have been renamed;
|
||||
they are now called
|
||||
<a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Func"><code>Func</code></a> and
|
||||
<a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#FuncOf"><code>FuncOf</code></a>, respectively.
|
||||
This is a breaking change, but WebAssembly support is still experimental
|
||||
and not yet subject to the
|
||||
<a href="/doc/go1compat">Go 1 compatibility promise</a>. Any code using the
|
||||
old names will need to be updated.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 141644 -->
|
||||
If a type implements the new
|
||||
<a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Wrapper"><code>Wrapper</code></a>
|
||||
interface,
|
||||
<a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#ValueOf"><code>ValueOf</code></a>
|
||||
will use it to return the JavaScript value for that type.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 143137 -->
|
||||
The meaning of the zero
|
||||
<a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value"><code>Value</code></a>
|
||||
has changed. It now represents the JavaScript <code>undefined</code> value
|
||||
instead of the number zero.
|
||||
This is a breaking change, but WebAssembly support is still experimental
|
||||
and not yet subject to the
|
||||
<a href="/doc/go1compat">Go 1 compatibility promise</a>. Any code relying on
|
||||
the zero <a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value"><code>Value</code></a>
|
||||
to mean the number zero will need to be updated.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 144384 -->
|
||||
The new
|
||||
<a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value.Truthy"><code>Value.Truthy</code></a>
|
||||
method reports the
|
||||
<a href="https://developer.mozilla.org/en-US/docs/Glossary/Truthy">JavaScript "truthiness"</a>
|
||||
of a given value.
|
||||
</p>
|
||||
|
||||
</dl><!-- syscall/js -->
|
||||
|
||||
<dl id="testing"><dt><a href="/pkg/testing/">testing</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 139258 -->
|
||||
The <a href="/cmd/go/#hdr-Testing_flags"><code>-benchtime</code></a> flag now supports setting an explicit iteration count instead of a time when the value ends with an "<code>x</code>". For example, <code>-benchtime=100x</code> runs the benchmark 100 times.
|
||||
</p>
|
||||
|
||||
</dl><!-- testing -->
|
||||
|
||||
<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 142217 -->
|
||||
When executing a template, long context values are no longer truncated in errors.
|
||||
</p>
|
||||
<p>
|
||||
<code>executing "tmpl" at <.very.deep.context.v...>: map has no entry for key "notpresent"</code>
|
||||
</p>
|
||||
<p>
|
||||
is now
|
||||
</p>
|
||||
<p>
|
||||
<code>executing "tmpl" at <.very.deep.context.value.notpresent>: map has no entry for key "notpresent"</code>
|
||||
</p>
|
||||
|
||||
<dd>
|
||||
<p><!-- CL 143097 -->
|
||||
If a user-defined function called by a template panics, the
|
||||
panic is now caught and returned as an error by
|
||||
the <code>Execute</code> or <code>ExecuteTemplate</code> method.
|
||||
</p>
|
||||
</dl><!-- text/template -->
|
||||
|
||||
<dl id="time"><dt><a href="/pkg/time/">time</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 151299 -->
|
||||
The time zone database in <code>$GOROOT/lib/time/zoneinfo.zip</code>
|
||||
has been updated to version 2018i. Note that this ZIP file is
|
||||
only used if a time zone database is not provided by the operating
|
||||
system.
|
||||
</p>
|
||||
|
||||
</dl><!-- time -->
|
||||
|
||||
<dl id="unsafe"><dt><a href="/pkg/unsafe/">unsafe</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 146058 -->
|
||||
It is invalid to convert a nil <code>unsafe.Pointer</code> to <code>uintptr</code> and back with arithmetic.
|
||||
(This was already invalid, but will now cause the compiler to misbehave.)
|
||||
</p>
|
||||
|
||||
</dl><!-- unsafe -->
|
||||
1066
doc/go1.13.html
1066
doc/go1.13.html
File diff suppressed because it is too large
Load Diff
924
doc/go1.14.html
924
doc/go1.14.html
@@ -1,924 +0,0 @@
|
||||
<!--{
|
||||
"Title": "Go 1.14 Release Notes",
|
||||
"Path": "/doc/go1.14"
|
||||
}-->
|
||||
|
||||
<!--
|
||||
NOTE: In this document and others in this directory, the convention is to
|
||||
set fixed-width phrases with non-fixed-width spaces, as in
|
||||
<code>hello</code> <code>world</code>.
|
||||
Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
|
||||
<style>
|
||||
main ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">Introduction to Go 1.14</h2>
|
||||
|
||||
<p>
|
||||
The latest Go release, version 1.14, arrives six months after <a href="go1.13">Go 1.13</a>.
|
||||
Most of its changes are in the implementation of the toolchain, runtime, and libraries.
|
||||
As always, the release maintains the Go 1 <a href="/doc/go1compat.html">promise of compatibility</a>.
|
||||
We expect almost all Go programs to continue to compile and run as before.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Module support in the <code>go</code> command is now ready for production use,
|
||||
and we encourage all users to <a href="https://blog.golang.org/migrating-to-go-modules">migrate to Go
|
||||
modules for dependency management</a>. If you are unable to migrate due to a problem in the Go
|
||||
toolchain, please ensure that the problem has an
|
||||
<a href="https://golang.org/issue?q=is%3Aissue+is%3Aopen+label%3Amodules">open issue</a>
|
||||
filed. (If the issue is not on the <code>Go1.15</code> milestone, please let us
|
||||
know why it prevents you from migrating so that we can prioritize it
|
||||
appropriately.)
|
||||
</p>
|
||||
|
||||
<h2 id="language">Changes to the language</h2>
|
||||
|
||||
<p>
|
||||
Per the <a href="https://github.com/golang/proposal/blob/master/design/6977-overlapping-interfaces.md">overlapping interfaces proposal</a>,
|
||||
Go 1.14 now permits embedding of interfaces with overlapping method sets:
|
||||
methods from an embedded interface may have the same names and identical signatures
|
||||
as methods already present in the (embedding) interface. This solves problems that typically
|
||||
(but not exclusively) occur with diamond-shaped embedding graphs.
|
||||
Explicitly declared methods in an interface must remain
|
||||
<a href="https://tip.golang.org/ref/spec#Uniqueness_of_identifiers">unique</a>, as before.
|
||||
</p>
|
||||
|
||||
<h2 id="ports">Ports</h2>
|
||||
|
||||
<h3 id="darwin">Darwin</h3>
|
||||
|
||||
<p>
|
||||
Go 1.14 is the last release that will run on macOS 10.11 El Capitan.
|
||||
Go 1.15 will require macOS 10.12 Sierra or later.
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/34749 -->
|
||||
Go 1.14 is the last Go release to support 32-bit binaries on
|
||||
macOS (the <code>darwin/386</code> port). They are no longer
|
||||
supported by macOS, starting with macOS 10.15 (Catalina).
|
||||
Go continues to support the 64-bit <code>darwin/amd64</code> port.
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/34751 -->
|
||||
Go 1.14 will likely be the last Go release to support 32-bit
|
||||
binaries on iOS, iPadOS, watchOS, and tvOS
|
||||
(the <code>darwin/arm</code> port). Go continues to support the
|
||||
64-bit <code>darwin/arm64</code> port.
|
||||
</p>
|
||||
|
||||
<h3 id="windows">Windows</h3>
|
||||
|
||||
<p><!-- CL 203601 -->
|
||||
Go binaries on Windows now
|
||||
have <a href="https://docs.microsoft.com/en-us/windows/win32/memory/data-execution-prevention">DEP
|
||||
(Data Execution Prevention)</a> enabled.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 202439 -->
|
||||
On Windows, creating a file
|
||||
via <a href="/pkg/os#CreateFile"><code>os.OpenFile</code></a> with
|
||||
the <a href="/pkg/os/#O_CREATE"><code>os.O_CREATE</code></a> flag, or
|
||||
via <a href="/pkg/syscall#Open"><code>syscall.Open</code></a> with
|
||||
the <a href="/pkg/syscall#O_CREAT"><code>syscall.O_CREAT</code></a>
|
||||
flag, will now create the file as read-only if the
|
||||
bit <code>0o200</code> (owner write permission) is not set in the
|
||||
permission argument. This makes the behavior on Windows more like
|
||||
that on Unix systems.
|
||||
</p>
|
||||
|
||||
<h3 id="wasm">WebAssembly</h3>
|
||||
|
||||
<p><!-- CL 203600 -->
|
||||
JavaScript values referenced from Go via <code>js.Value</code>
|
||||
objects can now be garbage collected.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 203600 -->
|
||||
<code>js.Value</code> values can no longer be compared using
|
||||
the <code>==</code> operator, and instead must be compared using
|
||||
their <code>Equal</code> method.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 203600 -->
|
||||
<code>js.Value</code> now
|
||||
has <code>IsUndefined</code>, <code>IsNull</code>,
|
||||
and <code>IsNaN</code> methods.
|
||||
</p>
|
||||
|
||||
<h3 id="riscv">RISC-V</h3>
|
||||
|
||||
<p><!-- Issue 27532 -->
|
||||
Go 1.14 contains experimental support for 64-bit RISC-V on Linux
|
||||
(<code>GOOS=linux</code>, <code>GOARCH=riscv64</code>). Be aware
|
||||
that performance, assembly syntax stability, and possibly
|
||||
correctness are a work in progress.
|
||||
</p>
|
||||
|
||||
<h3 id="freebsd">FreeBSD</h3>
|
||||
|
||||
<p><!-- CL 199919 -->
|
||||
Go now supports the 64-bit ARM architecture on FreeBSD 12.0 or later (the
|
||||
<code>freebsd/arm64</code> port).
|
||||
</p>
|
||||
|
||||
<h3 id="nacl">Native Client (NaCl)</h3>
|
||||
|
||||
<p><!-- golang.org/issue/30439 -->
|
||||
As <a href="go1.13#ports">announced</a> in the Go 1.13 release notes,
|
||||
Go 1.14 drops support for the Native Client platform (<code>GOOS=nacl</code>).
|
||||
</p>
|
||||
|
||||
<h3 id="illumos">Illumos</h3>
|
||||
|
||||
<p><!-- CL 203758 -->
|
||||
The runtime now respects zone CPU caps
|
||||
(the <code>zone.cpu-cap</code> resource control)
|
||||
for <code>runtime.NumCPU</code> and the default value
|
||||
of <code>GOMAXPROCS</code>.
|
||||
</p>
|
||||
|
||||
<h2 id="tools">Tools</h2>
|
||||
|
||||
<h3 id="go-command">Go command</h3>
|
||||
|
||||
<h4 id="vendor">Vendoring</h4>
|
||||
<!-- golang.org/issue/33848 -->
|
||||
|
||||
<p>
|
||||
When the main module contains a top-level <code>vendor</code> directory and
|
||||
its <code>go.mod</code> file specifies <code>go</code> <code>1.14</code> or
|
||||
higher, the <code>go</code> command now defaults to <code>-mod=vendor</code>
|
||||
for operations that accept that flag. A new value for that flag,
|
||||
<code>-mod=mod</code>, causes the <code>go</code> command to instead load
|
||||
modules from the module cache (as when no <code>vendor</code> directory is
|
||||
present).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When <code>-mod=vendor</code> is set (explicitly or by default), the
|
||||
<code>go</code> command now verifies that the main module's
|
||||
<code>vendor/modules.txt</code> file is consistent with its
|
||||
<code>go.mod</code> file.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>go</code> <code>list</code> <code>-m</code> no longer silently omits
|
||||
transitive dependencies that do not provide packages in
|
||||
the <code>vendor</code> directory. It now fails explicitly if
|
||||
<code>-mod=vendor</code> is set and information is requested for a module not
|
||||
mentioned in <code>vendor/modules.txt</code>.
|
||||
</p>
|
||||
|
||||
<h4 id="go-flags">Flags</h4>
|
||||
|
||||
<p><!-- golang.org/issue/32502, golang.org/issue/30345 -->
|
||||
The <code>go</code> <code>get</code> command no longer accepts
|
||||
the <code>-mod</code> flag. Previously, the flag's setting either
|
||||
<a href="https://golang.org/issue/30345">was ignored</a> or
|
||||
<a href="https://golang.org/issue/32502">caused the build to fail</a>.
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/33326 -->
|
||||
<code>-mod=readonly</code> is now set by default when the <code>go.mod</code>
|
||||
file is read-only and no top-level <code>vendor</code> directory is present.
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/31481 -->
|
||||
<code>-modcacherw</code> is a new flag that instructs the <code>go</code>
|
||||
command to leave newly-created directories in the module cache at their
|
||||
default permissions rather than making them read-only.
|
||||
The use of this flag makes it more likely that tests or other tools will
|
||||
accidentally add files not included in the module's verified checksum.
|
||||
However, it allows the use of <code>rm</code> <code>-rf</code>
|
||||
(instead of <code>go</code> <code>clean</code> <code>-modcache</code>)
|
||||
to remove the module cache.
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/34506 -->
|
||||
<code>-modfile=file</code> is a new flag that instructs the <code>go</code>
|
||||
command to read (and possibly write) an alternate <code>go.mod</code> file
|
||||
instead of the one in the module root directory. A file
|
||||
named <code>go.mod</code> must still be present in order to determine the
|
||||
module root directory, but it is not accessed. When <code>-modfile</code> is
|
||||
specified, an alternate <code>go.sum</code> file is also used: its path is
|
||||
derived from the <code>-modfile</code> flag by trimming the <code>.mod</code>
|
||||
extension and appending <code>.sum</code>.
|
||||
</p>
|
||||
|
||||
<h4 id="go-env-vars">Environment variables</h4>
|
||||
|
||||
<p><!-- golang.org/issue/32966 -->
|
||||
<code>GOINSECURE</code> is a new environment variable that instructs
|
||||
the <code>go</code> command to not require an HTTPS connection, and to skip
|
||||
certificate validation, when fetching certain modules directly from their
|
||||
origins. Like the existing <code>GOPRIVATE</code> variable, the value
|
||||
of <code>GOINSECURE</code> is a comma-separated list of glob patterns.
|
||||
</p>
|
||||
|
||||
<h4 id="commands-outside-modules">Commands outside modules</h4>
|
||||
|
||||
<p><!-- golang.org/issue/32027 -->
|
||||
When module-aware mode is enabled explicitly (by setting
|
||||
<code>GO111MODULE=on</code>), most module commands have more
|
||||
limited functionality if no <code>go.mod</code> file is present. For
|
||||
example, <code>go</code> <code>build</code>,
|
||||
<code>go</code> <code>run</code>, and other build commands can only build
|
||||
packages in the standard library and packages specified as <code>.go</code>
|
||||
files on the command line.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Previously, the <code>go</code> command would resolve each package path
|
||||
to the latest version of a module but would not record the module path
|
||||
or version. This resulted in <a href="https://golang.org/issue/32027">slow,
|
||||
non-reproducible builds</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>go</code> <code>get</code> continues to work as before, as do
|
||||
<code>go</code> <code>mod</code> <code>download</code> and
|
||||
<code>go</code> <code>list</code> <code>-m</code> with explicit versions.
|
||||
</p>
|
||||
|
||||
<h4 id="incompatible-versions"><code>+incompatible</code> versions</h4>
|
||||
<!-- golang.org/issue/34165 -->
|
||||
|
||||
<p>
|
||||
If the latest version of a module contains a <code>go.mod</code> file,
|
||||
<code>go</code> <code>get</code> will no longer upgrade to an
|
||||
<a href="/cmd/go/#hdr-Module_compatibility_and_semantic_versioning">incompatible</a>
|
||||
major version of that module unless such a version is requested explicitly
|
||||
or is already required.
|
||||
<code>go</code> <code>list</code> also omits incompatible major versions
|
||||
for such a module when fetching directly from version control, but may
|
||||
include them if reported by a proxy.
|
||||
</p>
|
||||
|
||||
|
||||
<h4 id="go.mod"><code>go.mod</code> file maintenance</h4>
|
||||
<!-- golang.org/issue/34822 -->
|
||||
|
||||
<p>
|
||||
<code>go</code> commands other than
|
||||
<code>go</code> <code>mod</code> <code>tidy</code> no longer
|
||||
remove a <code>require</code> directive that specifies a version of an indirect dependency
|
||||
that is already implied by other (transitive) dependencies of the main
|
||||
module.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>go</code> commands other than
|
||||
<code>go</code> <code>mod</code> <code>tidy</code> no longer
|
||||
edit the <code>go.mod</code> file if the changes are only cosmetic.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When <code>-mod=readonly</code> is set, <code>go</code> commands will no
|
||||
longer fail due to a missing <code>go</code> directive or an erroneous
|
||||
<code>// indirect</code> comment.
|
||||
</p>
|
||||
|
||||
<h4 id="module-downloading">Module downloading</h4>
|
||||
|
||||
<p><!-- golang.org/issue/26092 -->
|
||||
The <code>go</code> command now supports Subversion repositories in module mode.
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/30748 -->
|
||||
The <code>go</code> command now includes snippets of plain-text error messages
|
||||
from module proxies and other HTTP servers.
|
||||
An error message will only be shown if it is valid UTF-8 and consists of only
|
||||
graphic characters and spaces.
|
||||
</p>
|
||||
|
||||
<h4 id="go-test">Testing</h4>
|
||||
|
||||
<p><!-- golang.org/issue/24929 -->
|
||||
<code>go test -v</code> now streams <code>t.Log</code> output as it happens,
|
||||
rather than at the end of all tests.
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime</h2>
|
||||
|
||||
<p><!-- CL 190098 -->
|
||||
This release improves the performance of most uses
|
||||
of <code>defer</code> to incur almost zero overhead compared to
|
||||
calling the deferred function directly.
|
||||
As a result, <code>defer</code> can now be used in
|
||||
performance-critical code without overhead concerns.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 201760, CL 201762 and many others -->
|
||||
Goroutines are now asynchronously preemptible.
|
||||
As a result, loops without function calls no longer potentially
|
||||
deadlock the scheduler or significantly delay garbage collection.
|
||||
This is supported on all platforms except <code>windows/arm</code>,
|
||||
<code>darwin/arm</code>, <code>js/wasm</code>, and
|
||||
<code>plan9/*</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A consequence of the implementation of preemption is that on Unix
|
||||
systems, including Linux and macOS systems, programs built with Go
|
||||
1.14 will receive more signals than programs built with earlier
|
||||
releases.
|
||||
This means that programs that use packages
|
||||
like <a href="/pkg/syscall/"><code>syscall</code></a>
|
||||
or <a href="https://godoc.org/golang.org/x/sys/unix"><code>golang.org/x/sys/unix</code></a>
|
||||
will see more slow system calls fail with <code>EINTR</code> errors.
|
||||
Those programs will have to handle those errors in some way, most
|
||||
likely looping to try the system call again. For more
|
||||
information about this
|
||||
see <a href="http://man7.org/linux/man-pages/man7/signal.7.html"><code>man
|
||||
7 signal</code></a> for Linux systems or similar documentation for
|
||||
other systems.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 201765, CL 195701 and many others -->
|
||||
The page allocator is more efficient and incurs significantly less
|
||||
lock contention at high values of <code>GOMAXPROCS</code>.
|
||||
This is most noticeable as lower latency and higher throughput for
|
||||
large allocations being done in parallel and at a high rate.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 171844 and many others -->
|
||||
Internal timers, used by
|
||||
<a href="/pkg/time/#After"><code>time.After</code></a>,
|
||||
<a href="/pkg/time/#Tick"><code>time.Tick</code></a>,
|
||||
<a href="/pkg/net/#Conn"><code>net.Conn.SetDeadline</code></a>,
|
||||
and friends, are more efficient, with less lock contention and fewer
|
||||
context switches.
|
||||
This is a performance improvement that should not cause any user
|
||||
visible changes.
|
||||
</p>
|
||||
|
||||
<h2 id="compiler">Compiler</h2>
|
||||
|
||||
<p><!-- CL 162237 -->
|
||||
This release adds <code>-d=checkptr</code> as a compile-time option
|
||||
for adding instrumentation to check that Go code is following
|
||||
<code>unsafe.Pointer</code> safety rules dynamically.
|
||||
This option is enabled by default (except on Windows) with
|
||||
the <code>-race</code> or <code>-msan</code> flags, and can be
|
||||
disabled with <code>-gcflags=all=-d=checkptr=0</code>.
|
||||
Specifically, <code>-d=checkptr</code> checks the following:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
When converting <code>unsafe.Pointer</code> to <code>*T</code>,
|
||||
the resulting pointer must be aligned appropriately
|
||||
for <code>T</code>.
|
||||
</li>
|
||||
<li>
|
||||
If the result of pointer arithmetic points into a Go heap object,
|
||||
one of the <code>unsafe.Pointer</code>-typed operands must point
|
||||
into the same object.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
Using <code>-d=checkptr</code> is not currently recommended on
|
||||
Windows because it causes false alerts in the standard library.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 204338 -->
|
||||
The compiler can now emit machine-readable logs of key optimizations
|
||||
using the <code>-json</code> flag, including inlining, escape
|
||||
analysis, bounds-check elimination, and nil-check elimination.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 196959 -->
|
||||
Detailed escape analysis diagnostics (<code>-m=2</code>) now work again.
|
||||
This had been dropped from the new escape analysis implementation in
|
||||
the previous release.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 196217 -->
|
||||
All Go symbols in macOS binaries now begin with an underscore,
|
||||
following platform conventions.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 202117 -->
|
||||
This release includes experimental support for compiler-inserted
|
||||
coverage instrumentation for fuzzing.
|
||||
See <a href="https://golang.org/issue/14565">issue 14565</a> for more
|
||||
details.
|
||||
This API may change in future releases.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 174704 --><!-- CL 196784 -->
|
||||
Bounds check elimination now uses information from slice creation and can
|
||||
eliminate checks for indexes with types smaller than <code>int</code>.
|
||||
</p>
|
||||
|
||||
<h2 id="library">Core library</h2>
|
||||
|
||||
<h3 id="hash/maphash">New byte sequence hashing package</h3>
|
||||
|
||||
<p> <!-- golang.org/issue/28322, CL 186877 -->
|
||||
Go 1.14 includes a new package,
|
||||
<a href="/pkg/hash/maphash/"><code>hash/maphash</code></a>,
|
||||
which provides hash functions on byte sequences.
|
||||
These hash functions are intended to be used to implement hash tables or
|
||||
other data structures that need to map arbitrary strings or byte
|
||||
sequences to a uniform distribution on unsigned 64-bit integers.
|
||||
</p>
|
||||
<p>
|
||||
The hash functions are collision-resistant but not cryptographically secure.
|
||||
</p>
|
||||
<p>
|
||||
The hash value of a given byte sequence is consistent within a
|
||||
single process, but will be different in different processes.
|
||||
</p>
|
||||
|
||||
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
||||
|
||||
<p>
|
||||
As always, there are various minor changes and updates to the library,
|
||||
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
|
||||
in mind.
|
||||
</p>
|
||||
|
||||
<dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 191976 -->
|
||||
Support for SSL version 3.0 (SSLv3) has been removed. Note that SSLv3 is the
|
||||
<a href="https://tools.ietf.org/html/rfc7568">cryptographically broken</a>
|
||||
protocol predating TLS.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 191999 -->
|
||||
TLS 1.3 can't be disabled via the <code>GODEBUG</code> environment
|
||||
variable anymore. Use the
|
||||
<a href="/pkg/crypto/tls/#Config.MaxVersion"><code>Config.MaxVersion</code></a>
|
||||
field to configure TLS versions.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 205059 -->
|
||||
When multiple certificate chains are provided through the
|
||||
<a href="/pkg/crypto/tls/#Config.Certificates"><code>Config.Certificates</code></a>
|
||||
field, the first one compatible with the peer is now automatically
|
||||
selected. This allows for example providing an ECDSA and an RSA
|
||||
certificate, and letting the package automatically select the best one.
|
||||
Note that the performance of this selection is going to be poor unless the
|
||||
<a href="/pkg/crypto/tls/#Certificate.Leaf"><code>Certificate.Leaf</code></a>
|
||||
field is set. The
|
||||
<a href="/pkg/crypto/tls/#Config.NameToCertificate"><code>Config.NameToCertificate</code></a>
|
||||
field, which only supports associating a single certificate with
|
||||
a give name, is now deprecated and should be left as <code>nil</code>.
|
||||
Similarly the
|
||||
<a href="/pkg/crypto/tls/#Config.BuildNameToCertificate"><code>Config.BuildNameToCertificate</code></a>
|
||||
method, which builds the <code>NameToCertificate</code> field
|
||||
from the leaf certificates, is now deprecated and should not be
|
||||
called.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 175517 -->
|
||||
The new <a href="/pkg/crypto/tls/#CipherSuites"><code>CipherSuites</code></a>
|
||||
and <a href="/pkg/crypto/tls/#InsecureCipherSuites"><code>InsecureCipherSuites</code></a>
|
||||
functions return a list of currently implemented cipher suites.
|
||||
The new <a href="/pkg/crypto/tls/#CipherSuiteName"><code>CipherSuiteName</code></a>
|
||||
function returns a name for a cipher suite ID.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 205058, 205057 -->
|
||||
The new <a href="/pkg/crypto/tls/#ClientHelloInfo.SupportsCertificate">
|
||||
<code>(*ClientHelloInfo).SupportsCertificate</code></a> and
|
||||
<a href="/pkg/crypto/tls/#CertificateRequestInfo.SupportsCertificate">
|
||||
<code>(*CertificateRequestInfo).SupportsCertificate</code></a>
|
||||
methods expose whether a peer supports a certain certificate.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 174329 -->
|
||||
The <code>tls</code> package no longer supports the legacy Next Protocol
|
||||
Negotiation (NPN) extension and now only supports ALPN. In previous
|
||||
releases it supported both. There are no API changes and applications
|
||||
should function identically as before. Most other clients and servers have
|
||||
already removed NPN support in favor of the standardized ALPN.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 205063, 205062 -->
|
||||
RSA-PSS signatures are now used when supported in TLS 1.2 handshakes. This
|
||||
won't affect most applications, but custom
|
||||
<a href="/pkg/crypto/tls/#Certificate.PrivateKey"><code>Certificate.PrivateKey</code></a>
|
||||
implementations that don't support RSA-PSS signatures will need to use the new
|
||||
<a href="/pkg/crypto/tls/#Certificate.SupportedSignatureAlgorithms">
|
||||
<code>Certificate.SupportedSignatureAlgorithms</code></a>
|
||||
field to disable them.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 205059, 205059 -->
|
||||
<a href="/pkg/crypto/tls/#Config.Certificates"><code>Config.Certificates</code></a> and
|
||||
<a href="/pkg/crypto/tls/#Config.GetCertificate"><code>Config.GetCertificate</code></a>
|
||||
can now both be nil if
|
||||
<a href="/pkg/crypto/tls/#Config.GetConfigForClient"><code>Config.GetConfigForClient</code></a>
|
||||
is set. If the callbacks return neither certificates nor an error, the
|
||||
<code>unrecognized_name</code> is now sent.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 205058 -->
|
||||
The new <a href="/pkg/crypto/tls/#CertificateRequestInfo.Version"><code>CertificateRequestInfo.Version</code></a>
|
||||
field provides the TLS version to client certificates callbacks.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 205068 -->
|
||||
The new <code>TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256</code> and
|
||||
<code>TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256</code> constants use
|
||||
the final names for the cipher suites previously referred to as
|
||||
<code>TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305</code> and
|
||||
<code>TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305</code>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- crypto/tls -->
|
||||
|
||||
<dl id="crypto/x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 204046 -->
|
||||
<a href="/pkg/crypto/x509/#Certificate.CreateCRL"><code>Certificate.CreateCRL</code></a>
|
||||
now supports Ed25519 issuers.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl id="debug/dwarf"><dt><a href="/pkg/debug/dwarf/">debug/dwarf</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 175138 -->
|
||||
The <code>debug/dwarf</code> package now supports reading DWARF
|
||||
version 5.
|
||||
</p>
|
||||
<p>
|
||||
The new
|
||||
method <a href="/pkg/debug/dwarf/#Data.AddSection"><code>(*Data).AddSection</code></a>
|
||||
supports adding arbitrary new DWARF sections from the input file
|
||||
to the DWARF <code>Data</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 192698 -->
|
||||
The new
|
||||
method <a href="/pkg/debug/dwarf/#Reader.ByteOrder"><code>(*Reader).ByteOrder</code></a>
|
||||
returns the byte order of the current compilation unit.
|
||||
This may be used to interpret attributes that are encoded in the
|
||||
native ordering, such as location descriptions.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 192699 -->
|
||||
The new
|
||||
method <a href="/pkg/debug/dwarf/#LineReader.Files"><code>(*LineReader).Files</code></a>
|
||||
returns the file name table from a line reader.
|
||||
This may be used to interpret the value of DWARF attributes such
|
||||
as <code>AttrDeclFile</code>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- debug/dwarf -->
|
||||
|
||||
<dl id="encoding/asn1"><dt><a href="/pkg/encoding/asn1/">encoding/asn1</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 126624 -->
|
||||
<a href="/pkg/encoding/asn1/#Unmarshal"><code>Unmarshal</code></a>
|
||||
now supports ASN.1 string type BMPString, represented by the new
|
||||
<a href="/pkg/encoding/asn1/#TagBMPString"><code>TagBMPString</code></a>
|
||||
constant.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- encoding/asn1 -->
|
||||
|
||||
<dl id="encoding/json"><dt><a href="/pkg/encoding/json/">encoding/json</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 200677 -->
|
||||
The <a href="/pkg/encoding/json/#Decoder"><code>Decoder</code></a>
|
||||
type supports a new
|
||||
method <a href="/pkg/encoding/json/#Decoder.InputOffset"><code>InputOffset</code></a>
|
||||
that returns the input stream byte offset of the current
|
||||
decoder position.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 200217 -->
|
||||
<a href="/pkg/encoding/json/#Compact"><code>Compact</code></a> no longer
|
||||
escapes the <code>U+2028</code> and <code>U+2029</code> characters, which
|
||||
was never a documented feature. For proper escaping, see <a
|
||||
href="/pkg/encoding/json/#HTMLEscape"><code>HTMLEscape</code></a>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 195045 -->
|
||||
<a href="/pkg/encoding/json/#Number"><code>Number</code></a> no longer
|
||||
accepts invalid numbers, to follow the documented behavior more closely.
|
||||
If a program needs to accept invalid numbers like the empty string,
|
||||
consider wrapping the type with <a href="/pkg/encoding/json/#Unmarshaler"><code>Unmarshaler</code></a>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 200237 -->
|
||||
<a href="/pkg/encoding/json/#Unmarshal"><code>Unmarshal</code></a>
|
||||
can now support map keys with string underlying type which implement
|
||||
<a href="/pkg/encoding/#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- encoding/json -->
|
||||
|
||||
<dl id="go/build"><dt><a href="/pkg/go/build/">go/build</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 203820, 211657 -->
|
||||
The <a href="/pkg/go/build/#Context"><code>Context</code></a>
|
||||
type has a new field <code>Dir</code> which may be used to set
|
||||
the working directory for the build.
|
||||
The default is the current directory of the running process.
|
||||
In module mode, this is used to locate the main module.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- go/build -->
|
||||
|
||||
<dl id="go/doc"><dt><a href="/pkg/go/doc/">go/doc</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 204830 -->
|
||||
The new
|
||||
function <a href="/pkg/go/doc/#NewFromFiles"><code>NewFromFiles</code></a>
|
||||
computes package documentation from a list
|
||||
of <code>*ast.File</code>'s and associates examples with the
|
||||
appropriate package elements.
|
||||
The new information is available in a new <code>Examples</code>
|
||||
field
|
||||
in the <a href="/pkg/go/doc/#Package"><code>Package</code></a>, <a href="/pkg/go/doc/#Type"><code>Type</code></a>,
|
||||
and <a href="/pkg/go/doc/#Func"><code>Func</code></a> types, and a
|
||||
new <a href="/pkg/go/doc/#Example.Suffix"><code>Suffix</code></a>
|
||||
field in
|
||||
the <a href="/pkg/go/doc/#Example"><code>Example</code></a>
|
||||
type.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- go/doc -->
|
||||
|
||||
<dl id="io/ioutil"><dt><a href="/pkg/io/ioutil/">io/ioutil</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 198488 -->
|
||||
<a href="/pkg/io/ioutil/#TempDir"><code>TempDir</code></a> can now create directories
|
||||
whose names have predictable prefixes and suffixes.
|
||||
As with <a href="/pkg/io/ioutil/#TempFile"><code>TempFile</code></a>, if the pattern
|
||||
contains a '*', the random string replaces the last '*'.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl id="log"><dt><a href="/pkg/log/">log</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 186182 -->
|
||||
The
|
||||
new <a href="https://tip.golang.org/pkg/log/#pkg-constants"><code>Lmsgprefix</code></a>
|
||||
flag may be used to tell the logging functions to emit the
|
||||
optional output prefix immediately before the log message rather
|
||||
than at the start of the line.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- log -->
|
||||
|
||||
<dl id="math"><dt><a href="/pkg/math/">math</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 127458 -->
|
||||
The new <a href="/pkg/math/#FMA"><code>FMA</code></a> function
|
||||
computes <code>x*y+z</code> in floating point with no
|
||||
intermediate rounding of the <code>x*y</code>
|
||||
computation. Several architectures implement this computation
|
||||
using dedicated hardware instructions for additional performance.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- math -->
|
||||
|
||||
<dl id="math/big"><dt><a href="/pkg/math/big/">math/big</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 164972 -->
|
||||
The <a href="/pkg/math/big/#Int.GCD"><code>GCD</code></a> method
|
||||
now allows the inputs <code>a</code> and <code>b</code> to be
|
||||
zero or negative.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- math/big -->
|
||||
|
||||
<dl id="math/bits"><dt><a href="/pkg/math/bits/">math/bits</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 197838 -->
|
||||
The new functions
|
||||
<a href="/pkg/math/bits/#Rem"><code>Rem</code></a>,
|
||||
<a href="/pkg/math/bits/#Rem32"><code>Rem32</code></a>, and
|
||||
<a href="/pkg/math/bits/#Rem64"><code>Rem64</code></a>
|
||||
support computing a remainder even when the quotient overflows.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- math/bits -->
|
||||
|
||||
<dl id="mime"><dt><a href="/pkg/mime/">mime</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 186927 -->
|
||||
The default type of <code>.js</code> and <code>.mjs</code> files
|
||||
is now <code>text/javascript</code> rather
|
||||
than <code>application/javascript</code>.
|
||||
This is in accordance
|
||||
with <a href="https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/">an
|
||||
IETF draft</a> that treats <code>application/javascript</code> as obsolete.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- mime -->
|
||||
|
||||
<dl id="mime/multipart"><dt><a href="/pkg/mime/multipart/">mime/multipart</a></dt>
|
||||
<dd>
|
||||
<p>
|
||||
The
|
||||
new <a href="/pkg/mime/multipart/#Reader"><code>Reader</code></a>
|
||||
method <a href="/pkg/mime/multipart/#Reader.NextRawPart"><code>NextRawPart</code></a>
|
||||
supports fetching the next MIME part without transparently
|
||||
decoding <code>quoted-printable</code> data.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- mime/multipart -->
|
||||
|
||||
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 200760 -->
|
||||
The new <a href="/pkg/net/http/#Header"><code>Header</code></a>
|
||||
method <a href="/pkg/net/http/#Header.Values"><code>Values</code></a>
|
||||
can be used to fetch all values associated with a
|
||||
canonicalized key.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 61291 -->
|
||||
The
|
||||
new <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
|
||||
field <a href="/pkg/net/http/#Transport.DialTLSContext"><code>DialTLSContext</code></a>
|
||||
can be used to specify an optional dial function for creating
|
||||
TLS connections for non-proxied HTTPS requests.
|
||||
This new field can be used instead
|
||||
of <a href="/pkg/net/http/#Transport.DialTLS"><code>DialTLS</code></a>,
|
||||
which is now considered deprecated; <code>DialTLS</code> will
|
||||
continue to work, but new code should
|
||||
use <code>DialTLSContext</code>, which allows the transport to
|
||||
cancel dials as soon as they are no longer needed.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 192518, CL 194218 -->
|
||||
On Windows, <a href="/pkg/net/http/#ServeFile"><code>ServeFile</code></a> now correctly
|
||||
serves files larger than 2GB.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net/http -->
|
||||
|
||||
<dl id="net/http/httptest"><dt><a href="/pkg/net/http/httptest/">net/http/httptest</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 201557 -->
|
||||
The
|
||||
new <a href="/pkg/net/http/httptest/#Server"><code>Server</code></a>
|
||||
field <a href="/pkg/net/http/httptest/#Server.EnableHTTP2"><code>EnableHTTP2</code></a>
|
||||
supports enabling HTTP/2 on the test server.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net/http/httptest -->
|
||||
|
||||
<dl id="net/textproto"><dt><a href="/pkg/net/textproto/">net/textproto</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 200760 -->
|
||||
The
|
||||
new <a href="/pkg/net/textproto/#MIMEHeader"><code>MIMEHeader</code></a>
|
||||
method <a href="/pkg/net/textproto/#MIMEHeader.Values"><code>Values</code></a>
|
||||
can be used to fetch all values associated with a canonicalized
|
||||
key.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net/textproto -->
|
||||
|
||||
<dl id="net/url"><dt><a href="/pkg/net/url/">net/url</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 185117 -->
|
||||
When parsing of a URL fails
|
||||
(for example by <a href="/pkg/net/url/#Parse"><code>Parse</code></a>
|
||||
or <a href="/pkg/net/url/#ParseRequestURI"><code>ParseRequestURI</code></a>),
|
||||
the resulting <a href="/pkg/net/url/#Error.Error"><code>Error</code></a> message
|
||||
will now quote the unparsable URL.
|
||||
This provides clearer structure and consistency with other parsing errors.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net/url -->
|
||||
|
||||
<dl id="os/signal"><dt><a href="/pkg/os/signal/">os/signal</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 187739 -->
|
||||
On Windows,
|
||||
the <code>CTRL_CLOSE_EVENT</code>, <code>CTRL_LOGOFF_EVENT</code>,
|
||||
and <code>CTRL_SHUTDOWN_EVENT</code> events now generate
|
||||
a <code>syscall.SIGTERM</code> signal, similar to how Control-C
|
||||
and Control-Break generate a <code>syscall.SIGINT</code> signal.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- os/signal -->
|
||||
|
||||
<dl id="plugin"><dt><a href="/pkg/plugin/">plugin</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 191617 -->
|
||||
The <code>plugin</code> package now supports <code>freebsd/amd64</code>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- plugin -->
|
||||
|
||||
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 85661 -->
|
||||
<a href="/pkg/reflect#StructOf"><code>StructOf</code></a> now
|
||||
supports creating struct types with unexported fields, by
|
||||
setting the <code>PkgPath</code> field in
|
||||
a <code>StructField</code> element.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- reflect -->
|
||||
|
||||
<dl id="pkg-runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 200081 -->
|
||||
<code>runtime.Goexit</code> can no longer be aborted by a
|
||||
recursive <code>panic</code>/<code>recover</code>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 188297, CL 191785 -->
|
||||
On macOS, <code>SIGPIPE</code> is no longer forwarded to signal
|
||||
handlers installed before the Go runtime is initialized.
|
||||
This is necessary because macOS delivers <code>SIGPIPE</code>
|
||||
<a href="https://golang.org/issue/33384">to the main thread</a>
|
||||
rather than the thread writing to the closed pipe.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- runtime -->
|
||||
|
||||
<dl id="runtime/pprof"><dt><a href="/pkg/runtime/pprof/">runtime/pprof</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 204636, 205097 -->
|
||||
The generated profile no longer includes the pseudo-PCs used for inline
|
||||
marks. Symbol information of inlined functions is encoded in
|
||||
<a href="https://github.com/google/pprof/blob/5e96527/proto/profile.proto#L177-L184">the format</a>
|
||||
the pprof tool expects. This is a fix for the regression introduced
|
||||
during recent releases.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- runtime/pprof -->
|
||||
|
||||
<dl id="strconv"><dt><a href="/pkg/strconv/">strconv</a></dt>
|
||||
<dd>
|
||||
<p>
|
||||
The <a href="/pkg/strconv/#NumError"><code>NumError</code></a>
|
||||
type now has
|
||||
an <a href="/pkg/strconv/#NumError.Unwrap"><code>Unwrap</code></a>
|
||||
method that may be used to retrieve the reason that a conversion
|
||||
failed.
|
||||
This supports using <code>NumError</code> values
|
||||
with <a href="/pkg/errors/#Is"><code>errors.Is</code></a> to see
|
||||
if the underlying error
|
||||
is <a href="/pkg/strconv/#pkg-variables"><code>strconv.ErrRange</code></a>
|
||||
or <a href="/pkg/strconv/#pkg-variables"><code>strconv.ErrSyntax</code></a>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- strconv -->
|
||||
|
||||
<dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 200577 -->
|
||||
Unlocking a highly contended <code>Mutex</code> now directly
|
||||
yields the CPU to the next goroutine waiting for
|
||||
that <code>Mutex</code>. This significantly improves the
|
||||
performance of highly contended mutexes on high CPU count
|
||||
machines.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- sync -->
|
||||
|
||||
<dl id="testing"><dt><a href="/pkg/testing/">testing</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 201359 -->
|
||||
The testing package now supports cleanup functions, called after
|
||||
a test or benchmark has finished, by calling
|
||||
<a href="/pkg/testing#T.Cleanup"><code>T.Cleanup</code></a> or
|
||||
<a href="/pkg/testing#B.Cleanup"><code>B.Cleanup</code></a> respectively.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- testing -->
|
||||
|
||||
<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 206124 -->
|
||||
The text/template package now correctly reports errors when a
|
||||
parenthesized argument is used as a function.
|
||||
This most commonly shows up in erroneous cases like
|
||||
<code>{{if (eq .F "a") or (eq .F "b")}}</code>.
|
||||
This should be written as <code>{{if or (eq .F "a") (eq .F "b")}}</code>.
|
||||
The erroneous case never worked as expected, and will now be
|
||||
reported with an error <code>can't give argument to non-function</code>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- text/template -->
|
||||
|
||||
<dl id="unicode"><dt><a href="/pkg/unicode/">unicode</a></dt>
|
||||
<dd>
|
||||
<p>
|
||||
The <a href="/pkg/unicode/"><code>unicode</code></a> package and associated
|
||||
support throughout the system has been upgraded from Unicode 11.0 to
|
||||
<a href="https://www.unicode.org/versions/Unicode12.0.0/">Unicode 12.0</a>,
|
||||
which adds 554 new characters, including four new scripts, and 61 new emoji.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- unicode -->
|
||||
1051
doc/go1.15.html
1051
doc/go1.15.html
File diff suppressed because it is too large
Load Diff
191
doc/go1.16.html
191
doc/go1.16.html
@@ -1,191 +0,0 @@
|
||||
<!--{
|
||||
"Title": "Go 1.16 Release Notes",
|
||||
"Path": "/doc/go1.16"
|
||||
}-->
|
||||
|
||||
<!--
|
||||
NOTE: In this document and others in this directory, the convention is to
|
||||
set fixed-width phrases with non-fixed-width spaces, as in
|
||||
<code>hello</code> <code>world</code>.
|
||||
Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
|
||||
<style>
|
||||
main ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">DRAFT RELEASE NOTES — Introduction to Go 1.16</h2>
|
||||
|
||||
<p>
|
||||
<strong>
|
||||
Go 1.16 is not yet released. These are work-in-progress
|
||||
release notes. Go 1.16 is expected to be released in February 2021.
|
||||
</strong>
|
||||
</p>
|
||||
|
||||
<h2 id="language">Changes to the language</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="ports">Ports</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="tools">Tools</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h3 id="go-command">Go command</h3>
|
||||
|
||||
<p><!-- golang.org/issue/24031 -->
|
||||
<code>retract</code> directives may now be used in a <code>go.mod</code> file
|
||||
to indicate that certain published versions of the module should not be used
|
||||
by other modules. A module author may retract a version after a severe problem
|
||||
is discovered or if the version was published unintentionally.<br>
|
||||
TODO: write and link to section in golang.org/ref/mod<br>
|
||||
TODO: write and link to tutorial or blog post
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/29062 -->
|
||||
When using <code>go test</code>, a test that
|
||||
calls <code>os.Exit(0)</code> during execution of a test function
|
||||
will now be considered to fail.
|
||||
This will help catch cases in which a test calls code that calls
|
||||
os.Exit(0) and thereby stops running all future tests.
|
||||
If a <code>TestMain</code> function calls <code>os.Exit(0)</code>
|
||||
that is still considered to be a passing test.
|
||||
</p>
|
||||
|
||||
<h4 id="all-pattern">The <code>all</code> pattern</h4>
|
||||
|
||||
<p><!-- golang.org/cl/240623 -->
|
||||
When the main module's <code>go.mod</code> file
|
||||
declares <code>go</code> <code>1.16</code> or higher, the <code>all</code>
|
||||
package pattern now matches only those packages that are transitively imported
|
||||
by a package or test found in the main module. (Packages imported by <em>tests
|
||||
of</em> packages imported by the main module are no longer included.) This is
|
||||
the same set of packages retained
|
||||
by <code>go</code> <code>mod</code> <code>vendor</code> since Go 1.11.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="compiler">Compiler</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="linker">Linker</h2>
|
||||
|
||||
<p>
|
||||
This release includes additional improvements to the Go linker,
|
||||
reducing linker resource usage (both time and memory) and improving
|
||||
code robustness/maintainability. These changes form the second half
|
||||
of a two-release project to
|
||||
<a href="https://golang.org/s/better-linker">modernize the Go
|
||||
linker</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The linker changes in 1.16 extend the 1.15 improvements to all
|
||||
supported architecture/OS combinations (the 1.15 performance improvements
|
||||
were primarily focused on <code>ELF</code>-based OSes and
|
||||
<code>amd64</code> architectures). For a representative set of
|
||||
large Go programs, linking is 20-35% faster than 1.15 and requires
|
||||
5-15% less memory on average for <code>linux/amd64</code>, with larger
|
||||
improvements for other architectures and OSes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TODO: update with final numbers later in the release.
|
||||
</p>
|
||||
|
||||
<h2 id="library">Core library</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h3 id="net"><a href="/pkg/net/">net</a></h3>
|
||||
|
||||
<p><!-- CL 250357 -->
|
||||
The case of I/O on a closed network connection, or I/O on a network
|
||||
connection that is closed before any of the I/O completes, can now
|
||||
be detected using the new <a href="/pkg/net/#ErrClosed">ErrClosed</a> error.
|
||||
A typical use would be <code>errors.Is(err, net.ErrClosed)</code>.
|
||||
In earlier releases the only way to reliably detect this case was to
|
||||
match the string returned by the <code>Error</code> method
|
||||
with <code>"use of closed network connection"</code>.
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="text/template/parse"><a href="/pkg/text/template/parse/">text/template/parse</a></h3>
|
||||
|
||||
<p><!-- CL 229398, golang.org/issue/34652 -->
|
||||
A new <a href="/pkg/text/template/parse/#CommentNode"><code>CommentNode</code></a>
|
||||
was added to the parse tree. The <a href="/pkg/text/template/parse/#Mode"><code>Mode</code></a>
|
||||
field in the <code>parse.Tree</code> enables access to it.
|
||||
</p>
|
||||
<!-- text/template/parse -->
|
||||
|
||||
<h3 id="unicode"><a href="/pkg/unicode/">unicode</a></h3>
|
||||
|
||||
<p><!-- CL 248765 -->
|
||||
The <a href="/pkg/unicode/"><code>unicode</code></a> package and associated
|
||||
support throughout the system has been upgraded from Unicode 12.0.0 to
|
||||
<a href="https://www.unicode.org/versions/Unicode13.0.0/">Unicode 13.0.0</a>,
|
||||
which adds 5,930 new characters, including four new scripts, and 55 new emoji.
|
||||
Unicode 13.0.0 also designates plane 3 (U+30000-U+3FFFF) as the tertiary
|
||||
ideographic plane.
|
||||
</p>
|
||||
|
||||
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
||||
|
||||
<p>
|
||||
As always, there are various minor changes and updates to the library,
|
||||
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
|
||||
in mind.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 233637 -->
|
||||
In the <a href="/pkg/net/http/"><code>net/http</code></a> package, the
|
||||
behavior of <a href="/pkg/net/http/#StripPrefix"><code>StripPrefix</code></a>
|
||||
has been changed to strip the prefix from the request URL's
|
||||
<code>RawPath</code> field in addition to its <code>Path</code> field.
|
||||
In past releases, only the <code>Path</code> field was trimmed, and so if the
|
||||
request URL contained any escaped characters the URL would be modified to
|
||||
have mismatched <code>Path</code> and <code>RawPath</code> fields.
|
||||
In Go 1.16, <code>StripPrefix</code> trims both fields.
|
||||
If there are escaped characters in the prefix part of the request URL the
|
||||
handler serves a 404 instead of its previous behavior of invoking the
|
||||
underlying handler with a mismatched <code>Path</code>/<code>RawPath</code> pair.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 252497 -->
|
||||
The <a href="/pkg/net/http/"><code>net/http</code></a> package now rejects HTTP range requests
|
||||
of the form <code>"Range": "bytes=--N"</code> where <code>"-N"</code> is a negative suffix length, for
|
||||
example <code>"Range": "bytes=--2"</code>. It now replies with a <code>416 "Range Not Satisfiable"</code> response.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net/http -->
|
||||
@@ -266,7 +266,7 @@ is now an error.
|
||||
<p>
|
||||
On the ARM, the toolchain supports "external linking", which
|
||||
is a step towards being able to build shared libraries with the gc
|
||||
toolchain and to provide dynamic linking support for environments
|
||||
tool chain and to provide dynamic linking support for environments
|
||||
in which that is necessary.
|
||||
</p>
|
||||
|
||||
@@ -860,13 +860,13 @@ The new build tag <code>netgo</code> (off by default) allows the construction of
|
||||
The <a href="/pkg/net/"><code>net</code></a> package adds a new field
|
||||
<code>DualStack</code> to the <a href="/pkg/net/#Dialer"><code>Dialer</code></a>
|
||||
struct for TCP connection setup using a dual IP stack as described in
|
||||
<a href="https://tools.ietf.org/html/rfc6555">RFC 6555</a>.
|
||||
<a href="http://tools.ietf.org/html/rfc6555">RFC 6555</a>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
The <a href="/pkg/net/http/"><code>net/http</code></a> package will no longer
|
||||
transmit cookies that are incorrect according to
|
||||
<a href="https://tools.ietf.org/html/rfc6265">RFC 6265</a>.
|
||||
<a href="http://tools.ietf.org/html/rfc6265">RFC 6265</a>.
|
||||
It just logs an error and sends nothing.
|
||||
Also,
|
||||
the <a href="/pkg/net/http/"><code>net/http</code></a> package's
|
||||
|
||||
@@ -11,7 +11,7 @@ The latest Go release, version 1.3, arrives six months after 1.2,
|
||||
and contains no language changes.
|
||||
It focuses primarily on implementation work, providing
|
||||
precise garbage collection,
|
||||
a major refactoring of the compiler toolchain that results in
|
||||
a major refactoring of the compiler tool chain that results in
|
||||
faster builds, especially for large projects,
|
||||
significant performance improvements across the board,
|
||||
and support for DragonFly BSD, Solaris, Plan 9 and Google's Native Client architecture (NaCl).
|
||||
@@ -285,7 +285,7 @@ building and linking with a shared library.
|
||||
<h3 id="gc_flag">Command-line flag parsing</h3>
|
||||
|
||||
<p>
|
||||
In the gc toolchain, the assemblers now use the
|
||||
In the gc tool chain, the assemblers now use the
|
||||
same command-line flag parsing rules as the Go flag package, a departure
|
||||
from the traditional Unix flag parsing.
|
||||
This may affect scripts that invoke the tool directly.
|
||||
@@ -373,7 +373,7 @@ which can be useful information when debugging deadlocks or performance issues.
|
||||
|
||||
<p>
|
||||
A new package <a href="/pkg/debug/plan9obj/"><code>debug/plan9obj</code></a> was added to the standard library.
|
||||
It implements access to Plan 9 <a href="https://9p.io/magic/man2html/6/a.out">a.out</a> object files.
|
||||
It implements access to Plan 9 <a href="http://plan9.bell-labs.com/magic/man2html/6/a.out">a.out</a> object files.
|
||||
</p>
|
||||
|
||||
<h3 id="major_library_changes">Major changes to the library</h3>
|
||||
@@ -525,7 +525,7 @@ client.
|
||||
The <a href="/pkg/net/http/"><code>net/http</code></a> package's
|
||||
<a href="/pkg/net/http/#Request.ParseMultipartForm"><code>Request.ParseMultipartForm</code></a>
|
||||
method will now return an error if the body's <code>Content-Type</code>
|
||||
is not <code>multipart/form-data</code>.
|
||||
is not <code>mutipart/form-data</code>.
|
||||
Prior to Go 1.3 it would silently fail and return <code>nil</code>.
|
||||
Code that relies on the previous behavior should be updated.
|
||||
</li>
|
||||
|
||||
@@ -420,7 +420,7 @@ to automate the running of tools to generate source code before compilation.
|
||||
For example, it can be used to run the <a href="/cmd/yacc"><code>yacc</code></a>
|
||||
compiler-compiler on a <code>.y</code> file to produce the Go source file implementing the grammar,
|
||||
or to automate the generation of <code>String</code> methods for typed constants using the new
|
||||
<a href="https://godoc.org/golang.org/x/tools/cmd/stringer">stringer</a>
|
||||
<a href="http://godoc.org/golang.org/x/tools/cmd/stringer">stringer</a>
|
||||
tool in the <code>golang.org/x/tools</code> subrepository.
|
||||
</p>
|
||||
|
||||
@@ -619,9 +619,9 @@ has been created to serve as the location for new developments to support system
|
||||
calls on all kernels.
|
||||
It has a nicer structure, with three packages that each hold the implementation of
|
||||
system calls for one of
|
||||
<a href="https://godoc.org/golang.org/x/sys/unix">Unix</a>,
|
||||
<a href="https://godoc.org/golang.org/x/sys/windows">Windows</a> and
|
||||
<a href="https://godoc.org/golang.org/x/sys/plan9">Plan 9</a>.
|
||||
<a href="http://godoc.org/golang.org/x/sys/unix">Unix</a>,
|
||||
<a href="http://godoc.org/golang.org/x/sys/windows">Windows</a> and
|
||||
<a href="http://godoc.org/golang.org/x/sys/plan9">Plan 9</a>.
|
||||
These packages will be curated more generously, accepting all reasonable changes
|
||||
that reflect kernel interfaces in those operating systems.
|
||||
See the documentation and the article mentioned above for more information.
|
||||
@@ -670,7 +670,7 @@ The <a href="/pkg/crypto/"><code>crypto</code></a> package now has a
|
||||
|
||||
<li>
|
||||
The <a href="/pkg/crypto/tls/"><code>crypto/tls</code></a> package
|
||||
now supports ALPN as defined in <a href="https://tools.ietf.org/html/rfc7301">RFC 7301</a>.
|
||||
now supports ALPN as defined in <a href="http://tools.ietf.org/html/rfc7301">RFC 7301</a>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
@@ -10,7 +10,7 @@ Edit .,s;^([a-z][A-Za-z0-9_/]+)\.([A-Z][A-Za-z0-9_]+\.)?([A-Z][A-Za-z0-9_]+)([ .
|
||||
-->
|
||||
|
||||
<style>
|
||||
main ul li { margin: 0.5em 0; }
|
||||
ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">Introduction to Go 1.6</h2>
|
||||
@@ -116,7 +116,7 @@ instead of generated from <a href="/cmd/yacc/">yacc</a>.
|
||||
<p>
|
||||
The compiler, linker, and <code>go</code> command have a new flag <code>-msan</code>,
|
||||
analogous to <code>-race</code> and only available on linux/amd64,
|
||||
that enables interoperation with the <a href="https://clang.llvm.org/docs/MemorySanitizer.html">Clang MemorySanitizer</a>.
|
||||
that enables interoperation with the <a href="http://clang.llvm.org/docs/MemorySanitizer.html">Clang MemorySanitizer</a>.
|
||||
Such interoperation is useful mainly for testing a program containing suspect C or C++ code.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
|
||||
<style>
|
||||
main ul li { margin: 0.5em 0; }
|
||||
ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">Introduction to Go 1.7</h2>
|
||||
@@ -43,7 +43,7 @@ includes the <a href="#context">context package</a>, promoted from the
|
||||
and now used in the standard library;
|
||||
and <a href="#testing">adds support in the testing package</a> for
|
||||
creating hierarchies of tests and benchmarks.
|
||||
The release also <a href="#cmd_go">finalizes the vendoring support</a>
|
||||
The release also <a href="#cmd/go">finalizes the vendoring support</a>
|
||||
started in Go 1.5, making it a standard feature.
|
||||
</p>
|
||||
|
||||
@@ -67,7 +67,8 @@ This change has no effect on the correctness of existing programs.
|
||||
|
||||
<p>
|
||||
Go 1.7 adds support for macOS 10.12 Sierra.
|
||||
Binaries built with versions of Go before 1.7 will not work
|
||||
This support was backported to Go 1.6.3.
|
||||
Binaries built with versions of Go before 1.6.3 will not work
|
||||
correctly on Sierra.
|
||||
</p>
|
||||
|
||||
@@ -89,7 +90,7 @@ POWER5 architecture.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The OpenBSD port now requires OpenBSD 5.6 or later, for access to the <a href="https://man.openbsd.org/getentropy.2"><i>getentropy</i>(2)</a> system call.
|
||||
The OpenBSD port now requires OpenBSD 5.6 or later, for access to the <a href="http://man.openbsd.org/getentropy.2"><i>getentropy</i>(2)</a> system call.
|
||||
</p>
|
||||
|
||||
<h3 id="known_issues">Known Issues</h3>
|
||||
@@ -357,7 +358,7 @@ the code generation changes alone typically reduce program CPU time by 5-35%.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<!-- git log -''-grep '-[0-9][0-9]\.[0-9][0-9]%' go1.6.. -->
|
||||
<!-- git log --grep '-[0-9][0-9]\.[0-9][0-9]%' go1.6.. -->
|
||||
There have been significant optimizations bringing more than 10% improvements
|
||||
to implementations in the
|
||||
<a href="/pkg/crypto/sha1/"><code>crypto/sha1</code></a>,
|
||||
@@ -394,9 +395,9 @@ This allows the use of contexts for cancelation, timeouts, and passing
|
||||
request-scoped data in other standard library packages,
|
||||
including
|
||||
<a href="#net">net</a>,
|
||||
<a href="#net_http">net/http</a>,
|
||||
<a href="#net/http">net/http</a>,
|
||||
and
|
||||
<a href="#os_exec">os/exec</a>,
|
||||
<a href="#os/exec">os/exec</a>,
|
||||
as noted below.
|
||||
</p>
|
||||
|
||||
@@ -552,9 +553,10 @@ The
|
||||
|
||||
<dd>
|
||||
<p>
|
||||
There are many performance optimizations throughout the package.
|
||||
As noted above,
|
||||
there are significant performance optimizations throughout the package.
|
||||
Decompression speed is improved by about 10%,
|
||||
while compression for <code>DefaultCompression</code> is twice as fast.
|
||||
while compression speed for <code>DefaultCompression</code> is roughly doubled.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
1666
doc/go1.8.html
1666
doc/go1.8.html
File diff suppressed because it is too large
Load Diff
1024
doc/go1.9.html
1024
doc/go1.9.html
File diff suppressed because it is too large
Load Diff
@@ -775,7 +775,7 @@ to turn a string into an error. It replaces the old <code>os.NewError</code>.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/go1.go" `/ErrSyntax/`}}
|
||||
|
||||
|
||||
<p>
|
||||
<em>Updating</em>:
|
||||
Running <code>go</code> <code>fix</code> will update almost all code affected by the change.
|
||||
@@ -1827,7 +1827,7 @@ for full details.
|
||||
<tr><td>Uitob(x, b)</td> <td>FormatUint(uint64(x), b)</td></tr>
|
||||
<tr><td>Uitob64(x, b)</td> <td>FormatUint(x, b)</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
<p>
|
||||
<em>Updating</em>:
|
||||
Running <code>go</code> <code>fix</code> will update almost all code affected by the change.
|
||||
@@ -1841,7 +1841,7 @@ a cast that must be added by hand; the <code>go</code> <code>fix</code> tool wil
|
||||
<h3 id="templates">The template packages</h3>
|
||||
|
||||
<p>
|
||||
The <code>template</code> and <code>exp/template/html</code> packages have moved to
|
||||
The <code>template</code> and <code>exp/template/html</code> packages have moved to
|
||||
<a href="/pkg/text/template/"><code>text/template</code></a> and
|
||||
<a href="/pkg/html/template/"><code>html/template</code></a>.
|
||||
More significant, the interface to these packages has been simplified.
|
||||
@@ -2035,4 +2035,4 @@ They are available for many combinations of architecture and operating system
|
||||
Installation details are described on the
|
||||
<a href="/doc/install">Getting Started</a> page, while
|
||||
the distributions themselves are listed on the
|
||||
<a href="/dl/">downloads page</a>.
|
||||
<a href="https://golang.org/dl/">downloads page</a>.
|
||||
|
||||
@@ -190,8 +190,8 @@ For details and background, see
|
||||
<h2 id="tools">Tools</h2>
|
||||
|
||||
<p>
|
||||
Finally, the Go toolchain (compilers, linkers, build tools, and so
|
||||
on) is under active development and may change behavior. This
|
||||
Finally, the Go tool chain (compilers, linkers, build tools, and so
|
||||
on) are under active development and may change behavior. This
|
||||
means, for instance, that scripts that depend on the location and
|
||||
properties of the tools may be broken by a point release.
|
||||
</p>
|
||||
|
||||
1077
doc/go_faq.html
1077
doc/go_faq.html
File diff suppressed because it is too large
Load Diff
@@ -273,7 +273,9 @@ func f() {
|
||||
a = "hello, world"
|
||||
<-c
|
||||
}
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
func main() {
|
||||
go f()
|
||||
c <- 0
|
||||
@@ -416,12 +418,8 @@ func twoprint() {
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
calling <code>twoprint</code> will call <code>setup</code> exactly
|
||||
once.
|
||||
The <code>setup</code> function will complete before either call
|
||||
of <code>print</code>.
|
||||
The result will be that <code>"hello, world"</code> will be printed
|
||||
twice.
|
||||
calling <code>twoprint</code> causes <code>"hello, world"</code> to be printed twice.
|
||||
The first call to <code>doprint</code> runs <code>setup</code> once.
|
||||
</p>
|
||||
|
||||
<h2>Incorrect synchronization</h2>
|
||||
|
||||
1095
doc/go_spec.html
1095
doc/go_spec.html
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 84 KiB |
@@ -1,21 +1,16 @@
|
||||
<!--{
|
||||
"Title": "Help",
|
||||
"Path": "/help/",
|
||||
"Template": true
|
||||
"Path": "/help/"
|
||||
}-->
|
||||
|
||||
<div id="manual-nav"></div>
|
||||
|
||||
<h2 id="help">Get help</h2>
|
||||
|
||||
<img class="gopher" src="/doc/gopher/help.png" alt=""/>
|
||||
<img class="gopher" src="/doc/gopher/help.png"/>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<h3 id="mailinglist"><a href="https://groups.google.com/group/golang-nuts">Go Nuts Mailing List</a></h3>
|
||||
<p>
|
||||
Get help from Go users, and share your work on the official mailing list.
|
||||
</p>
|
||||
<p>
|
||||
Search the <a href="https://groups.google.com/group/golang-nuts">golang-nuts</a>
|
||||
archives and consult the <a href="/doc/go_faq.html">FAQ</a> and
|
||||
<a href="//golang.org/wiki">wiki</a> before posting.
|
||||
@@ -23,27 +18,20 @@ archives and consult the <a href="/doc/go_faq.html">FAQ</a> and
|
||||
|
||||
<h3 id="forum"><a href="https://forum.golangbridge.org/">Go Forum</a></h3>
|
||||
<p>
|
||||
The <a href="https://forum.golangbridge.org/">Go Forum</a> is a discussion
|
||||
The <a href="https://forum.golangbridge.org/">Go Forum</a> is an alternate discussion
|
||||
forum for Go programmers.
|
||||
</p>
|
||||
|
||||
<h3 id="discord"><a href="https://discord.gg/64C346U">Gophers Discord</a></h3>
|
||||
<p>
|
||||
Get live support and talk with other gophers on the Go Discord.
|
||||
</p>
|
||||
|
||||
<h3 id="slack"><a href="https://blog.gopheracademy.com/gophers-slack-community/">Gopher Slack</a></h3>
|
||||
<p>Get live support from other users in the Go slack channel.</p>
|
||||
<p>Get live support from the official Go slack channel.</p>
|
||||
|
||||
<h3 id="irc"><a href="irc:irc.freenode.net/go-nuts">Go IRC Channel</a></h3>
|
||||
<p>Get live support at <b>#go-nuts</b> on <b>irc.freenode.net</b>, the official
|
||||
Go IRC channel.</p>
|
||||
{{end}}
|
||||
|
||||
<h3 id="faq"><a href="/doc/faq">Frequently Asked Questions (FAQ)</a></h3>
|
||||
<p>Answers to common questions about Go.</p>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<h2 id="inform">Stay informed</h2>
|
||||
|
||||
<h3 id="announce"><a href="https://groups.google.com/group/golang-announce">Go Announcements Mailing List</a></h3>
|
||||
@@ -59,19 +47,15 @@ for important announcements, such as the availability of new Go releases.
|
||||
<h3 id="twitter"><a href="https://twitter.com/golang">@golang at Twitter</a></h3>
|
||||
<p>The Go project's official Twitter account.</p>
|
||||
|
||||
<h3 id="pluscom"><a href="https://plus.google.com/communities/114112804251407510571">Go+ community</a></h3>
|
||||
<p>A Google+ community for Go enthusiasts.</p>
|
||||
|
||||
<h3 id="reddit"><a href="https://reddit.com/r/golang">golang sub-Reddit</a></h3>
|
||||
<p>
|
||||
The <a href="https://reddit.com/r/golang">golang sub-Reddit</a> is a place
|
||||
for Go news and discussion.
|
||||
</p>
|
||||
|
||||
<h3 id="gotime"><a href="https://changelog.com/gotime">Go Time Podcast</a></h3>
|
||||
<p>
|
||||
The <a href="https://changelog.com/gotime">Go Time podcast</a> is a panel of Go experts and special guests
|
||||
discussing the Go programming language, the community, and everything in between.
|
||||
</p>
|
||||
{{end}}
|
||||
|
||||
<h2 id="community">Community resources</h2>
|
||||
|
||||
<h3 id="go_user_groups"><a href="/wiki/GoUserGroups">Go User Groups</a></h3>
|
||||
@@ -80,13 +64,11 @@ Each month in places around the world, groups of Go programmers ("gophers")
|
||||
meet to talk about Go. Find a chapter near you.
|
||||
</p>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<h3 id="playground"><a href="/play">Go Playground</a></h3>
|
||||
<p>A place to write, run, and share Go code.</p>
|
||||
|
||||
<h3 id="wiki"><a href="/wiki">Go Wiki</a></h3>
|
||||
<p>A wiki maintained by the Go community.</p>
|
||||
{{end}}
|
||||
|
||||
<h3 id="conduct"><a href="/conduct">Code of Conduct</a></h3>
|
||||
<p>
|
||||
|
||||
@@ -24,7 +24,7 @@ packages, though, read on.
|
||||
<div class="detail">
|
||||
|
||||
<p>
|
||||
There are two official Go compiler toolchains.
|
||||
There are two official Go compiler tool chains.
|
||||
This document focuses on the <code>gc</code> Go
|
||||
compiler and tools.
|
||||
For information on how to work on <code>gccgo</code>, a more traditional
|
||||
@@ -33,70 +33,72 @@ compiler using the GCC back end, see
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The Go compilers support the following instruction sets:
|
||||
The Go compilers support seven instruction sets.
|
||||
There are important differences in the quality of the compilers for the different
|
||||
architectures.
|
||||
</p>
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
<code>amd64</code>, <code>386</code>
|
||||
<code>amd64</code> (also known as <code>x86-64</code>)
|
||||
</dt>
|
||||
<dd>
|
||||
The <code>x86</code> instruction set, 64- and 32-bit.
|
||||
A mature implementation. New in 1.7 is its SSA-based back end
|
||||
that generates compact, efficient code.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>arm64</code>, <code>arm</code>
|
||||
<code>386</code> (<code>x86</code> or <code>x86-32</code>)
|
||||
</dt>
|
||||
<dd>
|
||||
The <code>ARM</code> instruction set, 64-bit (<code>AArch64</code>) and 32-bit.
|
||||
Comparable to the <code>amd64</code> port, but does
|
||||
not yet use the SSA-based back end. It has an effective
|
||||
optimizer (registerizer) and generates good code (although
|
||||
<code>gccgo</code> can do noticeably better sometimes).
|
||||
</dd>
|
||||
<dt>
|
||||
<code>mips64</code>, <code>mips64le</code>, <code>mips</code>, <code>mipsle</code>
|
||||
<code>arm</code> (<code>ARM</code>)
|
||||
</dt>
|
||||
<dd>
|
||||
The <code>MIPS</code> instruction set, big- and little-endian, 64- and 32-bit.
|
||||
Supports Linux, FreeBSD, NetBSD and Darwin binaries. Less widely used than the other ports.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>ppc64</code>, <code>ppc64le</code>
|
||||
<code>arm64</code> (<code>AArch64</code>)
|
||||
</dt>
|
||||
<dd>
|
||||
The 64-bit PowerPC instruction set, big- and little-endian.
|
||||
Supports Linux and Darwin binaries. New in 1.5 and not as well exercised as other ports.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>riscv64</code>
|
||||
<code>ppc64, ppc64le</code> (64-bit PowerPC big- and little-endian)
|
||||
</dt>
|
||||
<dd>
|
||||
The 64-bit RISC-V instruction set.
|
||||
Supports Linux binaries. New in 1.5 and not as well exercised as other ports.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>s390x</code>
|
||||
<code>mips64, mips64le</code> (64-bit MIPS big- and little-endian)
|
||||
</dt>
|
||||
<dd>
|
||||
The IBM z/Architecture.
|
||||
Supports Linux binaries. New in 1.6 and not as well exercised as other ports.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>wasm</code>
|
||||
<code>s390x</code> (IBM System z)
|
||||
</dt>
|
||||
<dd>
|
||||
<a href="https://webassembly.org">WebAssembly</a>.
|
||||
Supports Linux binaries. New in 1.7 and not as well exercised as other ports.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p>
|
||||
Except for things like low-level operating system interface code, the run-time
|
||||
support is the same in all ports and includes a mark-and-sweep garbage
|
||||
collector, efficient array and string slicing, and support for efficient
|
||||
goroutines, such as stacks that grow and shrink on demand.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The compilers can target the AIX, Android, DragonFly BSD, FreeBSD,
|
||||
Illumos, Linux, macOS/iOS (Darwin), NetBSD, OpenBSD, Plan 9, Solaris,
|
||||
and Windows operating systems (although not all operating systems
|
||||
support all architectures).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A list of ports which are considered "first class" is available at the
|
||||
<a href="/wiki/PortingPolicy#first-class-ports">first class ports</a>
|
||||
wiki page.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The full set of supported combinations is listed in the
|
||||
discussion of <a href="#environment">environment variables</a> below.
|
||||
The compilers can target the DragonFly BSD, FreeBSD, Linux, NetBSD, OpenBSD,
|
||||
OS X (Darwin), Plan 9, Solaris and Windows operating systems.
|
||||
The full set of supported combinations is listed in the discussion of
|
||||
<a href="#environment">environment variables</a> below.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -112,57 +114,32 @@ Go does not support CentOS 6 on these systems.
|
||||
|
||||
</div>
|
||||
|
||||
<h2 id="go14">Install Go compiler binaries for bootstrap</h2>
|
||||
<h2 id="go14">Install Go compiler binaries</h2>
|
||||
|
||||
<p>
|
||||
The Go toolchain is written in Go. To build it, you need a Go compiler installed.
|
||||
The scripts that do the initial build of the tools look for a "go" command
|
||||
in <code>$PATH</code>, so as long as you have Go installed in your
|
||||
system and configured in your <code>$PATH</code>, you are ready to build Go
|
||||
from source.
|
||||
Or if you prefer you can set <code>$GOROOT_BOOTSTRAP</code> to the
|
||||
root of a Go installation to use to build the new Go toolchain;
|
||||
<code>$GOROOT_BOOTSTRAP/bin/go</code> should be the go command to use.</p>
|
||||
|
||||
<h3 id="bootstrapFromBinaryRelease">Bootstrap toolchain from binary release</h3>
|
||||
|
||||
<p>
|
||||
To use a binary release as a bootstrap toolchain, see
|
||||
<a href="/dl/">the downloads page</a> or use any other
|
||||
packaged Go distribution.
|
||||
</p>
|
||||
|
||||
<h3 id="bootstrapFromSource">Bootstrap toolchain from source</h3>
|
||||
|
||||
<p>
|
||||
To build a bootstrap toolchain from source, use
|
||||
either the git branch <code>release-branch.go1.4</code> or
|
||||
<a href="https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz">go1.4-bootstrap-20171003.tar.gz</a>,
|
||||
which contains the Go 1.4 source code plus accumulated fixes
|
||||
to keep the tools running on newer operating systems.
|
||||
(Go 1.4 was the last distribution in which the toolchain was written in C.)
|
||||
After unpacking the Go 1.4 source, <code>cd</code> to
|
||||
the <code>src</code> subdirectory, set <code>CGO_ENABLED=0</code> in
|
||||
the environment, and run <code>make.bash</code> (or,
|
||||
on Windows, <code>make.bat</code>).
|
||||
The Go tool chain is written in Go. To build it, you need a Go compiler installed.
|
||||
The scripts that do the initial build of the tools look for an existing Go tool
|
||||
chain in <code>$HOME/go1.4</code>.
|
||||
(This path may be overridden by setting the <code>GOROOT_BOOTSTRAP</code>
|
||||
environment variable.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Once the Go 1.4 source has been unpacked into your GOROOT_BOOTSTRAP directory,
|
||||
you must keep this git clone instance checked out to branch
|
||||
<code>release-branch.go1.4</code>. Specifically, do not attempt to reuse
|
||||
this git clone in the later step named "Fetch the repository." The go1.4
|
||||
bootstrap toolchain <b>must be able</b> to properly traverse the go1.4 sources
|
||||
that it assumes are present under this repository root.
|
||||
Build the tools with Go version 1.4 or a point release (1.4.1, 1.4.2 etc.).
|
||||
Go 1.4 binaries can be found at <a href="/dl/">the downloads page</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="bootstrapFromCrosscompiledSource">Bootstrap toolchain from cross-compiled source</h3>
|
||||
<p>
|
||||
Download the zip or tarball of Go 1.4 for your platform and extract it to
|
||||
<code>$HOME/go1.4</code> (or your nominated <code>GOROOT_BOOTSTRAP</code>
|
||||
location).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To cross-compile a bootstrap toolchain from source, which is
|
||||
necessary on systems Go 1.4 did not target (for
|
||||
example, <code>linux/ppc64le</code>), install Go on a different system
|
||||
and run <a href="/src/bootstrap.bash">bootstrap.bash</a>.
|
||||
If you want to install Go 1.5 on a system that is not supported by Go 1.4 (such
|
||||
as <code>linux/ppc64</code> and <code>linux/mips64le</code>) you can either use
|
||||
<a href="/src/bootstrap.bash">bootstrap.bash</a> on a system that can bootstrap Go
|
||||
1.5 normally, or bootstrap with gccgo 5.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -180,12 +157,9 @@ That tree can be copied to a machine of the given target type
|
||||
and used as <code>GOROOT_BOOTSTRAP</code> to bootstrap a local build.
|
||||
</p>
|
||||
|
||||
<h3 id="bootstrapFromGccgo">Bootstrap toolchain using gccgo</h3>
|
||||
|
||||
<p>
|
||||
To use gccgo as the bootstrap toolchain, you need to arrange
|
||||
for <code>$GOROOT_BOOTSTRAP/bin/go</code> to be the go tool that comes
|
||||
as part of gccgo 5. For example on Ubuntu Vivid:
|
||||
To use gccgo, you need to arrange for <code>$GOROOT_BOOTSTRAP/bin/go</code> to be
|
||||
the go tool that comes as part of gccgo 5. For example on Ubuntu Vivid:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -204,7 +178,7 @@ have a <code>git</code> command before proceeding.)
|
||||
<p>
|
||||
If you do not have a working Git installation,
|
||||
follow the instructions on the
|
||||
<a href="https://git-scm.com/downloads">Git downloads</a> page.
|
||||
<a href="http://git-scm.com/downloads">Git downloads</a> page.
|
||||
</p>
|
||||
|
||||
<h2 id="ccompiler">(Optional) Install a C compiler</h2>
|
||||
@@ -225,14 +199,15 @@ To build without <code>cgo</code>, set the environment variable
|
||||
|
||||
<h2 id="fetch">Fetch the repository</h2>
|
||||
|
||||
<p>Change to the directory where you intend to install Go, and make sure
|
||||
the <code>goroot</code> directory does not exist. Then clone the repository
|
||||
and check out the latest release tag (<code class="versionTag">go1.12</code>,
|
||||
for example):</p>
|
||||
<p>Go will install to a directory named <code>go</code>.
|
||||
Change to the directory that will be its parent
|
||||
and make sure the <code>go</code> directory does not exist.
|
||||
Then clone the repository and check out the latest release tag
|
||||
(<code class="versionTag">go1.7.2</code>, for example):</p>
|
||||
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/go goroot
|
||||
$ cd goroot
|
||||
$ git clone https://go.googlesource.com/go
|
||||
$ cd go
|
||||
$ git checkout <span class="versionTag"><i><tag></i></span>
|
||||
</pre>
|
||||
|
||||
@@ -240,20 +215,6 @@ $ git checkout <span class="versionTag"><i><tag></i></span>
|
||||
Where <code><tag></code> is the version string of the release.
|
||||
</p>
|
||||
|
||||
<p>Go will be installed in the directory where it is checked out. For example,
|
||||
if Go is checked out in <code>$HOME/goroot</code>, executables will be installed
|
||||
in <code>$HOME/goroot/bin</code>. The directory may have any name, but note
|
||||
that if Go is checked out in <code>$HOME/go</code>, it will conflict with
|
||||
the default location of <code>$GOPATH</code>.
|
||||
See <a href="#gopath"><code>GOPATH</code></a> below.</p>
|
||||
|
||||
<p>
|
||||
Reminder: If you opted to also compile the bootstrap binaries from source (in an
|
||||
earlier section), you still need to <code>git clone</code> again at this point
|
||||
(to checkout the latest <code><tag></code>), because you must keep your
|
||||
go1.4 repository distinct.
|
||||
</p>
|
||||
|
||||
<h2 id="head">(Optional) Switch to the master branch</h2>
|
||||
|
||||
<p>If you intend to modify the go source code, and
|
||||
@@ -327,7 +288,7 @@ package main
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("hello, world\n")
|
||||
fmt.Printf("hello, world\n")
|
||||
}
|
||||
</pre>
|
||||
|
||||
@@ -359,7 +320,7 @@ You just need to do a little more setup.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <a href="/doc/code.html">How to Write Go Code</a> document
|
||||
The <a href="/doc/code.html">How to Write Go Code</a> document
|
||||
provides <b>essential setup instructions</b> for using the Go tools.
|
||||
</p>
|
||||
|
||||
@@ -369,7 +330,15 @@ provides <b>essential setup instructions</b> for using the Go tools.
|
||||
<p>
|
||||
The source code for several Go tools (including <a href="/cmd/godoc/">godoc</a>)
|
||||
is kept in <a href="https://golang.org/x/tools">the go.tools repository</a>.
|
||||
To install one of the tools (<code>godoc</code> in this case):
|
||||
To install all of them, run the <code>go</code> <code>get</code> command:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go get golang.org/x/tools/cmd/...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Or if you just want to install a specific command (<code>godoc</code> in this case):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -377,7 +346,7 @@ $ go get golang.org/x/tools/cmd/godoc
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
To install these tools, the <code>go</code> <code>get</code> command requires
|
||||
To install these tools, the <code>go</code> <code>get</code> command requires
|
||||
that <a href="#git">Git</a> be installed locally.
|
||||
</p>
|
||||
|
||||
@@ -386,11 +355,21 @@ You must also have a workspace (<code>GOPATH</code>) set up;
|
||||
see <a href="/doc/code.html">How to Write Go Code</a> for the details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Note</b>: The <code>go</code> command will install the <code>godoc</code>
|
||||
binary to <code>$GOROOT/bin</code> (or <code>$GOBIN</code>) and the
|
||||
<code>cover</code> and <code>vet</code> binaries to
|
||||
<code>$GOROOT/pkg/tool/$GOOS_$GOARCH</code>.
|
||||
You can access the latter commands with
|
||||
"<code>go</code> <code>tool</code> <code>cover</code>" and
|
||||
"<code>go</code> <code>tool</code> <code>vet</code>".
|
||||
</p>
|
||||
|
||||
<h2 id="community">Community resources</h2>
|
||||
|
||||
<p>
|
||||
The usual community resources such as
|
||||
<code>#go-nuts</code> on the <a href="https://freenode.net/">Freenode</a> IRC server
|
||||
<code>#go-nuts</code> on the <a href="http://freenode.net/">Freenode</a> IRC server
|
||||
and the
|
||||
<a href="//groups.google.com/group/golang-nuts">Go Nuts</a>
|
||||
mailing list have active developers that can help you with problems
|
||||
@@ -412,7 +391,7 @@ New releases are announced on the
|
||||
<a href="//groups.google.com/group/golang-announce">golang-announce</a>
|
||||
mailing list.
|
||||
Each announcement mentions the latest release tag, for instance,
|
||||
<code class="versionTag">go1.9</code>.
|
||||
<code class="versionTag">go1.7.2</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -442,13 +421,12 @@ to override the defaults.
|
||||
<ul>
|
||||
<li><code>$GOROOT</code>
|
||||
<p>
|
||||
The root of the Go tree, often <code>$HOME/go1.X</code>.
|
||||
The root of the Go tree, often <code>$HOME/go</code>.
|
||||
Its value is built into the tree when it is compiled, and
|
||||
defaults to the parent of the directory where <code>all.bash</code> was run.
|
||||
There is no need to set this unless you want to switch between multiple
|
||||
local copies of the repository.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><code>$GOROOT_FINAL</code>
|
||||
<p>
|
||||
@@ -456,99 +434,44 @@ The value assumed by installed binaries and scripts when
|
||||
<code>$GOROOT</code> is not set explicitly.
|
||||
It defaults to the value of <code>$GOROOT</code>.
|
||||
If you want to build the Go tree in one location
|
||||
but move it elsewhere after the build, set
|
||||
but move it elsewhere after the build, set
|
||||
<code>$GOROOT_FINAL</code> to the eventual location.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li id="gopath"><code>$GOPATH</code>
|
||||
<p>
|
||||
The directory where Go projects outside the Go distribution are typically
|
||||
checked out. For example, <code>golang.org/x/tools</code> might be checked out
|
||||
to <code>$GOPATH/src/golang.org/x/tools</code>. Executables outside the
|
||||
Go distribution are installed in <code>$GOPATH/bin</code> (or
|
||||
<code>$GOBIN</code>, if set). Modules are downloaded and cached in
|
||||
<code>$GOPATH/pkg/mod</code>.
|
||||
</p>
|
||||
|
||||
<p>The default location of <code>$GOPATH</code> is <code>$HOME/go</code>,
|
||||
and it's not usually necessary to set <code>GOPATH</code> explicitly. However,
|
||||
if you have checked out the Go distribution to <code>$HOME/go</code>,
|
||||
you must set <code>GOPATH</code> to another location to avoid conflicts.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><code>$GOBIN</code>
|
||||
<p>
|
||||
The directory where executables outside the Go distribution are installed
|
||||
using the <a href="/cmd/go">go command</a>. For example,
|
||||
<code>go get golang.org/x/tools/cmd/godoc</code> downloads, builds, and
|
||||
installs <code>$GOBIN/godoc</code>. By default, <code>$GOBIN</code> is
|
||||
<code>$GOPATH/bin</code> (or <code>$HOME/go/bin</code> if <code>GOPATH</code>
|
||||
is not set). After installing, you will want to add this directory to
|
||||
your <code>$PATH</code> so you can use installed tools.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that the Go distribution's executables are installed in
|
||||
<code>$GOROOT/bin</code> (for executables invoked by people) or
|
||||
<code>$GOTOOLDIR</code> (for executables invoked by the go command;
|
||||
defaults to <code>$GOROOT/pkg/$GOOS_GOARCH</code>) instead of
|
||||
<code>$GOBIN</code>.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><code>$GOOS</code> and <code>$GOARCH</code>
|
||||
<p>
|
||||
The name of the target operating system and compilation architecture.
|
||||
These default to the values of <code>$GOHOSTOS</code> and
|
||||
<code>$GOHOSTARCH</code> respectively (described below).
|
||||
</li>
|
||||
|
||||
<p>
|
||||
Choices for <code>$GOOS</code> are
|
||||
<code>android</code>, <code>darwin</code> (macOS/iOS),
|
||||
<code>dragonfly</code>, <code>freebsd</code>, <code>illumos</code>, <code>js</code>,
|
||||
<code>darwin</code> (Mac OS X 10.7 and above and iOS), <code>dragonfly</code>, <code>freebsd</code>,
|
||||
<code>linux</code>, <code>netbsd</code>, <code>openbsd</code>,
|
||||
<code>plan9</code>, <code>solaris</code> and <code>windows</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Choices for <code>$GOARCH</code> are
|
||||
<code>amd64</code> (64-bit x86, the most mature port),
|
||||
<code>386</code> (32-bit x86), <code>arm</code> (32-bit ARM), <code>arm64</code> (64-bit ARM),
|
||||
<code>ppc64le</code> (PowerPC 64-bit, little-endian), <code>ppc64</code> (PowerPC 64-bit, big-endian),
|
||||
<code>mips64le</code> (MIPS 64-bit, little-endian), <code>mips64</code> (MIPS 64-bit, big-endian),
|
||||
<code>mipsle</code> (MIPS 32-bit, little-endian), <code>mips</code> (MIPS 32-bit, big-endian),
|
||||
<code>s390x</code> (IBM System z 64-bit, big-endian), and
|
||||
<code>wasm</code> (WebAssembly 32-bit).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>mips64le</code> (MIPS 64-bit, little-endian), and <code>mips64</code> (MIPS 64-bit, big-endian).
|
||||
The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
|
||||
<table cellpadding="0">
|
||||
<tr>
|
||||
<th width="50"></th><th align="left" width="100"><code>$GOOS</code></th> <th align="left" width="100"><code>$GOARCH</code></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>aix</code></td> <td><code>ppc64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>android</code></td> <td><code>386</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>android</code></td> <td><code>amd64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>android</code></td> <td><code>arm</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>android</code></td> <td><code>arm64</code></td>
|
||||
<td></td><td><code>darwin</code></td> <td><code>386</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>darwin</code></td> <td><code>amd64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>darwin</code></td> <td><code>arm</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>darwin</code></td> <td><code>arm64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -564,12 +487,6 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
|
||||
<td></td><td><code>freebsd</code></td> <td><code>arm</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>illumos</code></td> <td><code>amd64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>js</code></td> <td><code>wasm</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>linux</code></td> <td><code>386</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -588,24 +505,12 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
|
||||
<td></td><td><code>linux</code></td> <td><code>ppc64le</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>linux</code></td> <td><code>mips</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>linux</code></td> <td><code>mipsle</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>linux</code></td> <td><code>mips64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>linux</code></td> <td><code>mips64le</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>linux</code></td> <td><code>riscv64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>linux</code></td> <td><code>s390x</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>netbsd</code></td> <td><code>386</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -624,18 +529,12 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
|
||||
<td></td><td><code>openbsd</code></td> <td><code>arm</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>openbsd</code></td> <td><code>arm64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>plan9</code></td> <td><code>386</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>plan9</code></td> <td><code>amd64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>plan9</code></td> <td><code>arm</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>solaris</code></td> <td><code>amd64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -653,16 +552,25 @@ The name of the host operating system and compilation architecture.
|
||||
These default to the local system's operating system and
|
||||
architecture.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<p>
|
||||
Valid choices are the same as for <code>$GOOS</code> and
|
||||
<code>$GOARCH</code>, listed above.
|
||||
The specified values must be compatible with the local system.
|
||||
For example, you should not set <code>$GOHOSTARCH</code> to
|
||||
For example, you should not set <code>$GOHOSTARCH</code> to
|
||||
<code>arm</code> on an x86 system.
|
||||
</p>
|
||||
|
||||
<li><code>$GOBIN</code>
|
||||
<p>
|
||||
The location where Go binaries will be installed.
|
||||
The default is <code>$GOROOT/bin</code>.
|
||||
After installing, you will want to arrange to add this
|
||||
directory to your <code>$PATH</code>, so you can use the tools.
|
||||
If <code>$GOBIN</code> is set, the <a href="/cmd/go">go command</a>
|
||||
installs all commands there.
|
||||
</p>
|
||||
|
||||
<li><code>$GO386</code> (for <code>386</code> only, default is auto-detected
|
||||
if built on either <code>386</code> or <code>amd64</code>, <code>387</code> otherwise)
|
||||
<p>
|
||||
@@ -671,10 +579,9 @@ This controls the code generated by gc to use either the 387 floating-point unit
|
||||
floating point computations.
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>GO386=387</code>: use x87 for floating point operations; should support all x86 chips (Pentium MMX or later).</li>
|
||||
<li><code>GO386=sse2</code>: use SSE2 for floating point operations; has better performance than 387, but only available on Pentium 4/Opteron/Athlon 64 or later.</li>
|
||||
<li><code>GO386=387</code>: use x87 for floating point operations; should support all x86 chips (Pentium MMX or later).
|
||||
<li><code>GO386=sse2</code>: use SSE2 for floating point operations; has better performance than 387, but only available on Pentium 4/Opteron/Athlon 64 or later.
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><code>$GOARM</code> (for <code>arm</code> only; default is auto-detected if building
|
||||
on the target processor, 6 if not)
|
||||
@@ -683,9 +590,9 @@ This sets the ARM floating point co-processor architecture version the run-time
|
||||
should target. If you are compiling on the target system, its value will be auto-detected.
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>GOARM=5</code>: use software floating point; when CPU doesn't have VFP co-processor</li>
|
||||
<li><code>GOARM=6</code>: use VFPv1 only; default if cross compiling; usually ARM11 or better cores (VFPv2 or better is also supported)</li>
|
||||
<li><code>GOARM=7</code>: use VFPv3; usually Cortex-A cores</li>
|
||||
<li><code>GOARM=5</code>: use software floating point; when CPU doesn't have VFP co-processor
|
||||
<li><code>GOARM=6</code>: use VFPv1 only; default if cross compiling; usually ARM11 or better cores (VFPv2 or better is also supported)
|
||||
<li><code>GOARM=7</code>: use VFPv3; usually Cortex-A cores
|
||||
</ul>
|
||||
<p>
|
||||
If in doubt, leave this variable unset, and adjust it if required
|
||||
@@ -694,36 +601,6 @@ The <a href="//golang.org/wiki/GoArm">GoARM</a> page
|
||||
on the <a href="//golang.org/wiki">Go community wiki</a>
|
||||
contains further details regarding Go's ARM support.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><code>$GOMIPS</code> (for <code>mips</code> and <code>mipsle</code> only) <br> <code>$GOMIPS64</code> (for <code>mips64</code> and <code>mips64le</code> only)
|
||||
<p>
|
||||
These variables set whether to use floating point instructions. Set to "<code>hardfloat</code>" to use floating point instructions; this is the default. Set to "<code>softfloat</code>" to use soft floating point.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><code>$GOPPC64</code> (for <code>ppc64</code> and <code>ppc64le</code> only)
|
||||
<p>
|
||||
This variable sets the processor level (i.e. Instruction Set Architecture version)
|
||||
for which the compiler will target. The default is <code>power8</code>.
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>GOPPC64=power8</code>: generate ISA v2.07 instructions</li>
|
||||
<li><code>GOPPC64=power9</code>: generate ISA v3.00 instructions</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<li><code>$GOWASM</code> (for <code>wasm</code> only)
|
||||
<p>
|
||||
This variable is a comma separated list of <a href="https://github.com/WebAssembly/proposals">experimental WebAssembly features</a> that the compiled WebAssembly binary is allowed to use.
|
||||
The default is to use no experimental features.
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>GOWASM=satconv</code>: generate <a href="https://github.com/WebAssembly/nontrapping-float-to-int-conversions/blob/master/proposals/nontrapping-float-to-int-conversion/Overview.md">saturating (non-trapping) float-to-int conversions</a></li>
|
||||
<li><code>GOWASM=signext</code>: generate <a href="https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md">sign-extension operators</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -741,11 +618,12 @@ not <code>amd64</code>.
|
||||
<p>
|
||||
If you choose to override the defaults,
|
||||
set these variables in your shell profile (<code>$HOME/.bashrc</code>,
|
||||
<code>$HOME/.profile</code>, or equivalent). The settings might look
|
||||
<code>$HOME/.profile</code>, or equivalent). The settings might look
|
||||
something like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
export GOROOT=$HOME/go
|
||||
export GOARCH=amd64
|
||||
export GOOS=linux
|
||||
</pre>
|
||||
|
||||
173
doc/install.html
173
doc/install.html
@@ -8,16 +8,16 @@
|
||||
<h2 id="download">Download the Go distribution</h2>
|
||||
|
||||
<p>
|
||||
<a href="/dl/" id="start" class="download">
|
||||
<a href="https://golang.org/dl/" id="start" class="download">
|
||||
<span class="big">Download Go</span>
|
||||
<span class="desc">Click here to visit the downloads page</span>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/dl/" target="_blank">Official binary
|
||||
distributions</a> are available for the FreeBSD (release 10-STABLE and above),
|
||||
Linux, macOS (10.11 and above), and Windows operating systems and
|
||||
<a href="https://golang.org/dl/" target="_blank">Official binary
|
||||
distributions</a> are available for the FreeBSD (release 8-STABLE and above),
|
||||
Linux, Mac OS X (10.8 and above), and Windows operating systems and
|
||||
the 32-bit (<code>386</code>) and 64-bit (<code>amd64</code>) x86 processor
|
||||
architectures.
|
||||
</p>
|
||||
@@ -33,7 +33,7 @@ system and architecture, try
|
||||
<h2 id="requirements">System requirements</h2>
|
||||
|
||||
<p>
|
||||
Go <a href="/dl/">binary distributions</a> are available for these supported operating systems and architectures.
|
||||
Go binary distributions are available for these supported operating systems and architectures.
|
||||
Please ensure your system meets these requirements before proceeding.
|
||||
If your OS or architecture is not on the list, you may be able to
|
||||
<a href="/doc/install/source">install from source</a> or
|
||||
@@ -47,17 +47,17 @@ If your OS or architecture is not on the list, you may be able to
|
||||
<th align="center">Notes</th>
|
||||
</tr>
|
||||
<tr><td colspan="3"><hr></td></tr>
|
||||
<tr><td>FreeBSD 10.3 or later</td> <td>amd64, 386</td> <td>Debian GNU/kFreeBSD not supported</td></tr>
|
||||
<tr valign='top'><td>Linux 2.6.23 or later with glibc</td> <td>amd64, 386, arm, arm64,<br>s390x, ppc64le</td> <td>CentOS/RHEL 5.x not supported.<br>Install from source for other libc.</td></tr>
|
||||
<tr><td>macOS 10.11 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>†</sup> that comes with Xcode<sup>‡</sup> for <code>cgo</code> support</td></tr>
|
||||
<tr valign='top'><td>Windows 7, Server 2008R2 or later</td> <td>amd64, 386</td> <td>use MinGW (<code>386</code>) or MinGW-W64 (<code>amd64</code>) gcc<sup>†</sup>.<br>No need for cygwin or msys.</td></tr>
|
||||
<tr><td>FreeBSD 8-STABLE or later</td> <td>amd64</td> <td>Debian GNU/kFreeBSD not supported</td></tr>
|
||||
<tr><td>Linux 2.6.23 or later with glibc</td> <td>amd64, 386, arm</td> <td>CentOS/RHEL 5.x not supported</td></tr>
|
||||
<tr><td>Mac OS X 10.7 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>†</sup> that comes with Xcode<sup>‡</sup> for <code>cgo</code> support</td></tr>
|
||||
<tr><td>Windows XP or later</td> <td>amd64, 386</td> <td>use MinGW gcc<sup>†</sup>. No need for cygwin or msys.</td></tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<sup>†</sup>A C compiler is required only if you plan to use
|
||||
<sup>†</sup><code>gcc</code> is required only if you plan to use
|
||||
<a href="/cmd/cgo">cgo</a>.<br/>
|
||||
<sup>‡</sup>You only need to install the command line tools for
|
||||
<a href="https://developer.apple.com/Xcode/">Xcode</a>. If you have already
|
||||
<a href="http://developer.apple.com/Xcode/">Xcode</a>. If you have already
|
||||
installed Xcode 4.3+, you can install it from the Components tab of the
|
||||
Downloads preferences panel.
|
||||
</p>
|
||||
@@ -74,10 +74,10 @@ first <a href="#uninstall">remove the existing version</a>.
|
||||
|
||||
<div id="tarballInstructions">
|
||||
|
||||
<h3 id="tarball">Linux, macOS, and FreeBSD tarballs</h3>
|
||||
<h3 id="tarball">Linux, Mac OS X, and FreeBSD tarballs</h3>
|
||||
|
||||
<p>
|
||||
<a href="/dl/">Download the archive</a>
|
||||
<a href="https://golang.org/dl/">Download the archive</a>
|
||||
and extract it into <code>/usr/local</code>, creating a Go tree in
|
||||
<code>/usr/local/go</code>. For example:
|
||||
</p>
|
||||
@@ -106,22 +106,39 @@ variable. You can do this by adding this line to your <code>/etc/profile</code>
|
||||
export PATH=$PATH:/usr/local/go/bin
|
||||
</pre>
|
||||
|
||||
<h4 id="tarball_non_standard">Installing to a custom location</h4>
|
||||
|
||||
<p>
|
||||
<b>Note</b>: changes made to a <code>profile</code> file may not apply until the
|
||||
next time you log into your computer.
|
||||
To apply the changes immediately, just run the shell commands directly
|
||||
or execute them from the profile using a command such as
|
||||
<code>source $HOME/.profile</code>.
|
||||
The Go binary distributions assume they will be installed in
|
||||
<code>/usr/local/go</code> (or <code>c:\Go</code> under Windows),
|
||||
but it is possible to install the Go tools to a different location.
|
||||
In this case you must set the <code>GOROOT</code> environment variable
|
||||
to point to the directory in which it was installed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For example, if you installed Go to your home directory you should add the
|
||||
following commands to <code>$HOME/.profile</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
export GOROOT=$HOME/go
|
||||
export PATH=$PATH:$GOROOT/bin
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
<b>Note</b>: <code>GOROOT</code> must be set only when installing to a custom
|
||||
location.
|
||||
</p>
|
||||
|
||||
</div><!-- tarballInstructions -->
|
||||
|
||||
<div id="darwinPackageInstructions">
|
||||
|
||||
<h3 id="macos"><div id="osx"></div>macOS package installer</h3>
|
||||
<h3 id="osx">Mac OS X package installer</h3>
|
||||
|
||||
<p>
|
||||
<a href="/dl/">Download the package file</a>,
|
||||
<a href="https://golang.org/dl/">Download the package file</a>,
|
||||
open it, and follow the prompts to install the Go tools.
|
||||
The package installs the Go distribution to <code>/usr/local/go</code>.
|
||||
</p>
|
||||
@@ -150,7 +167,7 @@ MSI installer that configures your installation automatically.
|
||||
<h4 id="windows_msi">MSI installer</h4>
|
||||
|
||||
<p>
|
||||
Open the <a href="/dl/">MSI file</a>
|
||||
Open the <a href="https://golang.org/dl/">MSI file</a>
|
||||
and follow the prompts to install the Go tools.
|
||||
By default, the installer puts the Go distribution in <code>c:\Go</code>.
|
||||
</p>
|
||||
@@ -168,7 +185,12 @@ command prompts for the change to take effect.
|
||||
<h4 id="windows_zip">Zip archive</h4>
|
||||
|
||||
<p>
|
||||
<a href="/dl/">Download the zip file</a> and extract it into the directory of your choice (we suggest <code>c:\Go</code>).
|
||||
<a href="https://golang.org/dl/">Download the zip file</a> and extract it into the directory of your choice (we suggest <code>c:\Go</code>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you chose a directory other than <code>c:\Go</code>,
|
||||
you must set the <code>GOROOT</code> environment variable to your chosen path.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -192,11 +214,42 @@ Settings" option inside the "System" control panel.
|
||||
<h2 id="testing">Test your installation</h2>
|
||||
|
||||
<p>
|
||||
Check that Go is installed correctly by building a simple program, as follows.
|
||||
Check that Go is installed correctly by setting up a workspace
|
||||
and building a simple program, as follows.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Create a file named <code>hello.go</code> that looks like:
|
||||
Create a directory to contain your <a href="code.html#Workspaces">workspace</a>,
|
||||
<code class="testUnix">$HOME/work</code>
|
||||
<code class="testWindows" style="display: none">C:\work</code>
|
||||
for example, and set the <code>GOPATH</code> environment
|
||||
variable to point to that location.
|
||||
</p>
|
||||
|
||||
<pre class="testUnix">
|
||||
$ <b>export GOPATH=$HOME/work</b>
|
||||
</pre>
|
||||
|
||||
<pre class="testWindows" style="display: none">
|
||||
C:\> <b>set GOPATH=C:\work</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
<span class="testUnix">
|
||||
You should put the above command in your shell startup script
|
||||
(<code>$HOME/.profile</code> for example).
|
||||
</span>
|
||||
<span class="testWindows">
|
||||
On Windows, follow the <a href="#windows_env">instructions above</a> to set the
|
||||
<code>GOPATH</code> environment variable on your system.
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Next, make the directories <code>src/github.com/user/hello</code> inside your
|
||||
workspace (if you use GitHub, substitute your user name for <code>user</code>),
|
||||
and inside the <code>hello</code> directory create a file named <code>hello.go</code>
|
||||
with the following contents:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -205,36 +258,35 @@ package main
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("hello, world\n")
|
||||
fmt.Printf("hello, world\n")
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Then build it with the <code>go</code> tool:
|
||||
Then compile it with the <code>go</code> tool:
|
||||
</p>
|
||||
|
||||
<pre class="testUnix">
|
||||
$ <b>go build hello.go</b>
|
||||
$ <b>go install github.com/user/hello</b>
|
||||
</pre>
|
||||
|
||||
<pre class="testWindows">
|
||||
C:\Users\Gopher\go\src\hello> <b>go build hello.go</b>
|
||||
<pre class="testWindows" style="display: none">
|
||||
C:\> <b>go install github.com/user/hello</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The command above will build an executable named
|
||||
<code class="testUnix">hello</code><code class="testWindows">hello.exe</code>
|
||||
in the current directory alongside your source code.
|
||||
Execute it to see the greeting:
|
||||
The command above will put an executable command named <code>hello</code>
|
||||
(or <code>hello.exe</code>) inside the <code>bin</code> directory of your workspace.
|
||||
Execute the command to see the greeting:
|
||||
</p>
|
||||
|
||||
<pre class="testUnix">
|
||||
$ <b>./hello</b>
|
||||
$ <b>$GOPATH/bin/hello</b>
|
||||
hello, world
|
||||
</pre>
|
||||
|
||||
<pre class="testWindows">
|
||||
C:\Users\Gopher\go\src\hello> <b>hello</b>
|
||||
<pre class="testWindows" style="display: none">
|
||||
C:\> <b>%GOPATH%\bin\hello</b>
|
||||
hello, world
|
||||
</pre>
|
||||
|
||||
@@ -249,45 +301,12 @@ which describes some essential concepts about using the Go tools.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="extra_versions">Installing extra Go versions</h2>
|
||||
|
||||
<p>
|
||||
It may be useful to have multiple Go versions installed on the same machine, for
|
||||
example, to ensure that a package's tests pass on multiple Go versions.
|
||||
Once you have one Go version installed, you can install another (such as 1.10.7)
|
||||
as follows:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go get golang.org/dl/go1.10.7
|
||||
$ go1.10.7 download
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The newly downloaded version can be used like <code>go</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go1.10.7 version
|
||||
go version go1.10.7 linux/amd64
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
All Go versions available via this method are listed on
|
||||
<a href="https://godoc.org/golang.org/dl#pkg-subdirectories">the download page</a>.
|
||||
You can find where each of these extra Go versions is installed by looking
|
||||
at its <code>GOROOT</code>; for example, <code>go1.10.7 env GOROOT</code>.
|
||||
To uninstall a downloaded version, just remove its <code>GOROOT</code> directory
|
||||
and the <code>goX.Y.Z</code> binary.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="uninstall">Uninstalling Go</h2>
|
||||
|
||||
<p>
|
||||
To remove an existing Go installation from your system delete the
|
||||
<code>go</code> directory. This is usually <code>/usr/local/go</code>
|
||||
under Linux, macOS, and FreeBSD or <code>c:\Go</code>
|
||||
under Linux, Mac OS X, and FreeBSD or <code>c:\Go</code>
|
||||
under Windows.
|
||||
</p>
|
||||
|
||||
@@ -296,7 +315,7 @@ You should also remove the Go <code>bin</code> directory from your
|
||||
<code>PATH</code> environment variable.
|
||||
Under Linux and FreeBSD you should edit <code>/etc/profile</code> or
|
||||
<code>$HOME/.profile</code>.
|
||||
If you installed Go with the <a href="#macos">macOS package</a> then you
|
||||
If you installed Go with the <a href="#osx">Mac OS X package</a> then you
|
||||
should remove the <code>/etc/paths.d/go</code> file.
|
||||
Windows users should read the section about <a href="#windows_env">setting
|
||||
environment variables under Windows</a>.
|
||||
@@ -306,10 +325,16 @@ environment variables under Windows</a>.
|
||||
<h2 id="help">Getting help</h2>
|
||||
|
||||
<p>
|
||||
For help, see the <a href="/help/">list of Go mailing lists, forums, and places to chat</a>.
|
||||
For real-time help, ask the helpful gophers in <code>#go-nuts</code> on the
|
||||
<a href="http://freenode.net/">Freenode</a> IRC server.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Report bugs either by running “<b><code>go</code> <code>bug</code></b>”, or
|
||||
manually at the <a href="https://golang.org/issue">Go issue tracker</a>.
|
||||
The official mailing list for discussion of the Go language is
|
||||
<a href="//groups.google.com/group/golang-nuts">Go Nuts</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Report bugs using the
|
||||
<a href="//golang.org/issue">Go issue tracker</a>.
|
||||
</p>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// You can edit this code!
|
||||
// Click here and start typing.
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
@@ -41,9 +41,9 @@ const templateStr = `
|
||||
<br>
|
||||
<br>
|
||||
{{end}}
|
||||
<form action="/" name=f method="GET">
|
||||
<input maxLength=1024 size=70 name=s value="" title="Text to QR Encode">
|
||||
<input type=submit value="Show QR" name=qr>
|
||||
<form action="/" name=f method="GET"><input maxLength=1024 size=70
|
||||
name=s value="" title="Text to QR Encode"><input type=submit
|
||||
value="Show QR" name=qr>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -28,18 +28,11 @@ func (s Sequence) Swap(i, j int) {
|
||||
s[i], s[j] = s[j], s[i]
|
||||
}
|
||||
|
||||
// Copy returns a copy of the Sequence.
|
||||
func (s Sequence) Copy() Sequence {
|
||||
copy := make(Sequence, 0, len(s))
|
||||
return append(copy, s...)
|
||||
}
|
||||
|
||||
// Method for printing - sorts the elements before printing.
|
||||
func (s Sequence) String() string {
|
||||
s = s.Copy() // Make a copy; don't overwrite argument.
|
||||
sort.Sort(s)
|
||||
str := "["
|
||||
for i, elem := range s { // Loop is O(N²); will fix that in next example.
|
||||
for i, elem := range s {
|
||||
if i > 0 {
|
||||
str += " "
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@ func viewRecord(w http.ResponseWriter, r *http.Request) {
|
||||
key := datastore.NewKey(c, "Record", r.FormValue("id"), 0, nil)
|
||||
record := new(Record)
|
||||
if err := datastore.Get(c, key, record); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
http.Error(w, err.Error(), 500)
|
||||
return
|
||||
}
|
||||
if err := viewTemplate.Execute(w, record); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
http.Error(w, err.Error(), 500)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ type appHandler func(http.ResponseWriter, *http.Request) error
|
||||
|
||||
func (fn appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
if err := fn(w, r); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
http.Error(w, err.Error(), 500)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ func Encode() {
|
||||
|
||||
expected := []byte(`{"Name":"Alice","Body":"Hello","Time":1294706395881547000}`)
|
||||
if !reflect.DeepEqual(b, expected) {
|
||||
log.Panicf("Error marshaling %q, expected %q, got %q.", m, expected, b)
|
||||
log.Panicf("Error marshalling %q, expected %q, got %q.", m, expected, b)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ func Decode() {
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(m, expected) {
|
||||
log.Panicf("Error unmarshaling %q, expected %q, got %q.", b, expected, m)
|
||||
log.Panicf("Error unmarshalling %q, expected %q, got %q.", b, expected, m)
|
||||
}
|
||||
|
||||
m = Message{
|
||||
@@ -77,7 +77,7 @@ func PartialDecode() {
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(expected, m) {
|
||||
log.Panicf("Error unmarshaling %q, expected %q, got %q.", b, expected, m)
|
||||
log.Panicf("Error unmarshalling %q, expected %q, got %q.", b, expected, m)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ func Decode() {
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(f, expected) {
|
||||
log.Panicf("Error unmarshaling %q, expected %q, got %q", b, expected, f)
|
||||
log.Panicf("Error unmarshalling %q, expected %q, got %q", b, expected, f)
|
||||
}
|
||||
|
||||
f = map[string]interface{}{
|
||||
|
||||
@@ -36,7 +36,7 @@ func Decode() {
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(expected, m) {
|
||||
log.Panicf("Error unmarshaling %q, expected %q, got %q", b, expected, m)
|
||||
log.Panicf("Error unmarshalling %q, expected %q, got %q", b, expected, m)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import (
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
const usage = `go run run.go [tests]
|
||||
@@ -27,8 +26,6 @@ Tests may be specified without their .go suffix.
|
||||
`
|
||||
|
||||
func main() {
|
||||
start := time.Now()
|
||||
|
||||
flag.Usage = func() {
|
||||
fmt.Fprintf(os.Stderr, usage)
|
||||
flag.PrintDefaults()
|
||||
@@ -73,9 +70,6 @@ func main() {
|
||||
}
|
||||
}
|
||||
os.Remove(tmpdir)
|
||||
if rc == 0 {
|
||||
fmt.Printf("ok\t%s\t%s\n", filepath.Base(os.Args[0]), time.Since(start).Round(time.Millisecond))
|
||||
}
|
||||
os.Exit(rc)
|
||||
}
|
||||
|
||||
@@ -84,7 +78,7 @@ func main() {
|
||||
// and checks that the output matches the regexp want.
|
||||
func test(tmpdir, file, want string) error {
|
||||
// Build the program.
|
||||
prog := filepath.Join(tmpdir, file+".exe")
|
||||
prog := filepath.Join(tmpdir, file)
|
||||
cmd := exec.Command("go", "build", "-o", prog, file+".go")
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
@@ -105,7 +99,7 @@ func test(tmpdir, file, want string) error {
|
||||
|
||||
// Canonicalize output.
|
||||
out = bytes.TrimRight(out, "\n")
|
||||
out = bytes.ReplaceAll(out, []byte{'\n'}, []byte{' '})
|
||||
out = bytes.Replace(out, []byte{'\n'}, []byte{' '}, -1)
|
||||
|
||||
// Check the result.
|
||||
match, err := regexp.Match(want, out)
|
||||
@@ -225,5 +219,12 @@ func fixcgo() {
|
||||
// cgo1 and cgo2 don't run on netbsd, srandom has a different signature
|
||||
skipTest("cgo1")
|
||||
skipTest("cgo2")
|
||||
// cgo3 and cgo4 don't run on netbsd, since cgo cannot handle stdout correctly, see issue #10715.
|
||||
skipTest("cgo3")
|
||||
skipTest("cgo4")
|
||||
case "openbsd", "solaris":
|
||||
// cgo3 and cgo4 don't run on openbsd and solaris, since cgo cannot handle stdout correctly, see issue #10715.
|
||||
skipTest("cgo3")
|
||||
skipTest("cgo4")
|
||||
}
|
||||
}
|
||||
|
||||
152
doc/root.html
Normal file
152
doc/root.html
Normal file
@@ -0,0 +1,152 @@
|
||||
<!--{
|
||||
"Path": "/",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<div class="left">
|
||||
|
||||
<div id="learn">
|
||||
<a class="popout share">Pop-out</a>
|
||||
<div class="rootHeading">Try Go</div>
|
||||
<div class="input">
|
||||
<textarea spellcheck="false" class="code">// You can edit this code!
|
||||
// Click here and start typing.
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, 世界")
|
||||
}</textarea>
|
||||
</div>
|
||||
<div class="output">
|
||||
<pre>
|
||||
Hello, 世界
|
||||
</pre>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<a class="run" href="#" title="Run this code [shift-enter]">Run</a>
|
||||
{{if $.Share}}
|
||||
<a class="share" href="#" title="Share this code">Share</a>
|
||||
{{end}}
|
||||
<a class="tour" href="//tour.golang.org/" title="Learn Go from your browser">Tour</a>
|
||||
</div>
|
||||
<div class="toys">
|
||||
<select>
|
||||
<option value="hello.go">Hello, World!</option>
|
||||
<option value="life.go">Conway's Game of Life</option>
|
||||
<option value="fib.go">Fibonacci Closure</option>
|
||||
<option value="peano.go">Peano Integers</option>
|
||||
<option value="pi.go">Concurrent pi</option>
|
||||
<option value="sieve.go">Concurrent Prime Sieve</option>
|
||||
<option value="solitaire.go">Peg Solitaire Solver</option>
|
||||
<option value="tree.go">Tree Comparison</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
|
||||
<div id="about">
|
||||
Go is an open source programming language that makes it easy to build
|
||||
simple, reliable, and efficient software.
|
||||
</div>
|
||||
|
||||
<div id="gopher"></div>
|
||||
|
||||
<a href="https://golang.org/dl/" id="start">
|
||||
<span class="big">Download Go</span>
|
||||
<span class="desc">
|
||||
Binary distributions available for<br>
|
||||
Linux, Mac OS X, Windows, and more.
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="clear: both"></div>
|
||||
|
||||
<div class="left">
|
||||
|
||||
<div id="video">
|
||||
<div class="rootHeading">Featured video</div>
|
||||
<iframe width="415" height="241" src="//www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
|
||||
<div id="blog">
|
||||
<div class="rootHeading">Featured articles</div>
|
||||
<div class="read"><a href="//blog.golang.org/">Read more</a></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function readableTime(t) {
|
||||
var m = ["January", "February", "March", "April", "May", "June", "July",
|
||||
"August", "September", "October", "November", "December"];
|
||||
var p = t.substring(0, t.indexOf("T")).split("-");
|
||||
var d = new Date(p[0], p[1]-1, p[2]);
|
||||
return d.getDate() + " " + m[d.getMonth()] + " " + d.getFullYear();
|
||||
}
|
||||
|
||||
function feedLoaded(result) {
|
||||
var blog = document.getElementById("blog");
|
||||
var read = blog.getElementsByClassName("read")[0];
|
||||
for (var i = 0; i < result.length && i < 2; i++) {
|
||||
var entry = result[i];
|
||||
var title = document.createElement("a");
|
||||
title.className = "title";
|
||||
title.href = entry.Link;
|
||||
title.innerHTML = entry.Title;
|
||||
blog.insertBefore(title, read);
|
||||
var extract = document.createElement("div");
|
||||
extract.className = "extract";
|
||||
extract.innerHTML = entry.Summary;
|
||||
blog.insertBefore(extract, read);
|
||||
var when = document.createElement("div");
|
||||
when.className = "when";
|
||||
when.innerHTML = "Published " + readableTime(entry.Time);
|
||||
blog.insertBefore(when, read);
|
||||
}
|
||||
}
|
||||
|
||||
window.initFuncs.push(function() {
|
||||
// Set up playground if enabled.
|
||||
if (window.playground) {
|
||||
window.playground({
|
||||
"codeEl": "#learn .code",
|
||||
"outputEl": "#learn .output",
|
||||
"runEl": "#learn .run",
|
||||
"shareEl": "#learn .share",
|
||||
"shareRedirect": "//play.golang.org/p/",
|
||||
"toysEl": "#learn .toys select"
|
||||
});
|
||||
} else {
|
||||
$('#learn').hide()
|
||||
}
|
||||
|
||||
// Load blog feed.
|
||||
$('<script/>').attr('text', 'text/javascript')
|
||||
.attr('src', '//blog.golang.org/.json?jsonp=feedLoaded')
|
||||
.appendTo('body');
|
||||
|
||||
// Set the video at random.
|
||||
var videos = [
|
||||
{h: 241, s: "//www.youtube.com/embed/ytEkHepK08c"}, // Tour of Go
|
||||
{h: 241, s: "//www.youtube.com/embed/f6kdp27TYZs"}, // Concurrency Patterns
|
||||
{h: 233, s: "//player.vimeo.com/video/69237265"} // Simple environment
|
||||
];
|
||||
var v = videos[Math.floor(Math.random()*videos.length)];
|
||||
$('#video iframe').attr('height', v.h).attr('src', v.s);
|
||||
});
|
||||
|
||||
</script>
|
||||
174
doc/security.html
Normal file
174
doc/security.html
Normal file
@@ -0,0 +1,174 @@
|
||||
<!--{
|
||||
"Title": "Go Security Policy",
|
||||
"Path": "/security",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<h2>Implementation</h2>
|
||||
|
||||
<h3>Reporting a Security Bug</h3>
|
||||
|
||||
<p>
|
||||
Please report to us any issues you find.
|
||||
This document explains how to do that and what to expect in return.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
All security bugs in the Go distribution should be reported by email to
|
||||
<a href="mailto:security@golang.org">security@golang.org</a>.
|
||||
This mail is delivered to a small security team.
|
||||
Your email will be acknowledged within 24 hours, and you'll receive a more
|
||||
detailed response to your email within 72 hours indicating the next steps in
|
||||
handling your report.
|
||||
If you would like, you can encrypt your report using our PGP key (listed below).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Please use a descriptive subject line for your report email.
|
||||
After the initial reply to your report, the security team will endeavor to keep
|
||||
you informed of the progress being made towards a fix and full announcement.
|
||||
These updates will be sent at least every five days.
|
||||
In reality, this is more likely to be every 24-48 hours.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you have not received a reply to your email within 48 hours or you have not
|
||||
heard from the security team for the past five days please contact the Go
|
||||
security team directly:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Primary security coordinator: <a href="mailto:adg@golang.org">Andrew Gerrand</a> (<a href="https://drive.google.com/a/google.com/file/d/0B42ZAZN5yFufRldybEVNandRN2c/view">public key</a>).</li>
|
||||
<li>Secondary coordinator: <a href="mailto:agl@golang.org">Adam Langley</a> (<a href="https://www.imperialviolet.org/key.asc">public key</a>).</li>
|
||||
<li>If you receive no response, mail <a href="mailto:golang-dev@googlegroups.com">golang-dev@googlegroups.com</a> or use the <a href="https://groups.google.com/forum/#!forum/golang-dev">golang-dev web interface</a>.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Please note that golang-dev is a public discussion forum.
|
||||
When escalating on this list, please do not disclose the details of the issue.
|
||||
Simply state that you're trying to reach a member of the security team.
|
||||
</p>
|
||||
|
||||
<h3>Flagging Existing Issues as Security-related</h3>
|
||||
|
||||
<p>
|
||||
If you believe that an <a href="https://golang.org/issue">existing issue</a>
|
||||
is security-related, we ask that you send an email to
|
||||
<a href="mailto:security@golang.org">security@golang.org</a>.
|
||||
The email should include the issue ID and a short description of why it should
|
||||
be handled according to this security policy.
|
||||
</p>
|
||||
|
||||
<h3>Disclosure Process</h3>
|
||||
|
||||
<p>The Go project uses the following disclosure process:</p>
|
||||
|
||||
<ol>
|
||||
<li>Once the security report is received it is assigned a primary handler.
|
||||
This person coordinates the fix and release process.</li>
|
||||
<li>The issue is confirmed and a list of affected software is determined.</li>
|
||||
<li>Code is audited to find any potential similar problems.</li>
|
||||
<li>If it is determined, in consultation with the submitter, that a CVE-ID is
|
||||
required, the primary handler obtains one via email to
|
||||
<a href="http://oss-security.openwall.org/wiki/mailing-lists/distros">oss-distros</a>.</li>
|
||||
<li>Fixes are prepared for the two most recent major releases and the head/master
|
||||
revision. These fixes are not yet committed to the public repository.</li>
|
||||
<li>A notification is sent to the
|
||||
<a href="https://groups.google.com/group/golang-announce">golang-announce</a>
|
||||
mailing list to give users time to prepare their systems for the update.</li>
|
||||
<li>Three working days following this notification, the fixes are applied to
|
||||
the <a href="https://go.googlesource.com/go">public repository</a> and a new
|
||||
Go release is issued.</li>
|
||||
<li>On the date that the fixes are applied, announcements are sent to
|
||||
<a href="https://groups.google.com/group/golang-announce">golang-announce</a>,
|
||||
<a href="https://groups.google.com/group/golang-dev">golang-dev</a>, and
|
||||
<a href="https://groups.google.com/group/golang-nuts">golang-nuts</a>.
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
This process can take some time, especially when coordination is required with
|
||||
maintainers of other projects. Every effort will be made to handle the bug in
|
||||
as timely a manner as possible, however it's important that we follow the
|
||||
process described above to ensure that disclosures are handled consistently.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For security issues that include the assignment of a CVE-ID,
|
||||
the issue is listed publicly under the
|
||||
<a href="https://www.cvedetails.com/vulnerability-list/vendor_id-14185/Golang.html">"Golang" product on the CVEDetails website</a>
|
||||
as well as the
|
||||
<a href="https://web.nvd.nist.gov/view/vuln/search">National Vulnerability Disclosure site</a>.
|
||||
</p>
|
||||
|
||||
<h3>Receiving Security Updates</h3>
|
||||
|
||||
<p>
|
||||
The best way to receive security announcements is to subscribe to the
|
||||
<a href="https://groups.google.com/forum/#!forum/golang-announce">golang-announce</a>
|
||||
mailing list. Any messages pertaining to a security issue will be prefixed
|
||||
with <code>[security]</code>.
|
||||
</p>
|
||||
|
||||
<h3>Comments on This Policy</h3>
|
||||
|
||||
<p>
|
||||
If you have any suggestions to improve this policy, please send an email to
|
||||
<a href="mailto:golang-dev@golang.org">golang-dev@golang.org</a> for discussion.
|
||||
</p>
|
||||
|
||||
<h3>PGP Key for <a href="mailto:security@golang.org">security@golang.org</a></h3>
|
||||
|
||||
<pre>
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Comment: GPGTools - https://gpgtools.org
|
||||
|
||||
mQINBFXI1h0BEADZdm05GDFWvjmQKutUVb0cJKS+VR+6XU3g/YQZGC8tnIL6i7te
|
||||
+fPJHfQc2uIw0xeBgZX4Ni/S8yIqsbIjqYeaToX7QFUufJDQwrmlQRDVAvvT5HBT
|
||||
J80JEs7yHRreFoLzB6dnWehWXzWle4gFKeIy+hvLrYquZVvbeEYTnX7fNzZg0+5L
|
||||
ksvj7lnQlJIy1l3sL/7uPr9qsm45/hzd0WjTQS85Ry6Na3tMwRpqGENDh25Blz75
|
||||
8JgK9JmtTJa00my1zzeCXU04CKKEMRbkMLozzudOH4ZLiLWcFiKRpeCn860wC8l3
|
||||
oJcyyObuTSbr9o05ra3On+epjCEFkknGX1WxPv+TV34i0a23AtuVyTCloKb7RYXc
|
||||
7mUaskZpU2rFBqIkzZ4MQJ7RDtGlm5oBy36j2QL63jAZ1cKoT/yvjJNp2ObmWaVF
|
||||
X3tk/nYw2H0YDjTkTCgGtyAOj3Cfqrtsa5L0jG5K2p4RY8mtVgQ5EOh7QxuS+rmN
|
||||
JiA39SWh7O6uFCwkz/OCXzqeh6/nP10HAb9S9IC34QQxm7Fhd0ZXzEv9IlBTIRzk
|
||||
xddSdACPnLE1gJcFHxBd2LTqS/lmAFShCsf8S252kagKJfHRebQJZHCIs6kT9PfE
|
||||
0muq6KRKeDXv01afAUvoB4QW/3chUrtgL2HryyO8ugMu7leVGmoZhFkIrQARAQAB
|
||||
tCZHbyBTZWN1cml0eSBUZWFtIDxzZWN1cml0eUBnb2xhbmcub3JnPokCPQQTAQoA
|
||||
JwUCVcjWHQIbAwUJB4YfgAULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRA6RtGR
|
||||
eVpYOLnDD/9YVTd6DTwdJq6irVfM/ICPlPTXB0JLERqCI1Veptcp56eQoJ0XWGQp
|
||||
tkGlgbvmCzFo0B+65Te7YA4R3oyBCXd6JgyWQQPy5p60FHyuuCPVAReclSWyt9f2
|
||||
Yj/u4DjghKhELOvPiI96egcU3g9jrEEcPjm7JYkc9M2gVSNOnnJvcD7wpQJNCzon
|
||||
51eMZ1ZyfA5UCBTa0SaT9eXg5zwNlYQnB6ZF6TjXezkhLqlTsBuHxoNVf+9vCC0o
|
||||
ZKIM2ovptMx9eEguTDKWaQ7tero7Zs/q5fwk/MDzM/LGJ9aXy2RCtqBxv46vDS7G
|
||||
fCNq+aPD/wyFd6hxQkvkua6hgZwYT+cJWHYA2Yv0LO3BYOJdjfc+j2hjv+mC9lF0
|
||||
UpWhCVJv3hHoFaxnz62GdROzf2wXz6aR9Saj1rYSvqT9jC20VInxqMufXNN2sbpo
|
||||
Kyk6MTbAeepphQpfAWQv+ltWgBiEjuFxYdwv/vmw20996JV7O8nqkeCUW84B6su+
|
||||
Y3bbdP9o3DBtOT0j9LTB/FucmdNCNHoO+EnNBKJd6FoYTGLWi3Rq9DLx2V9tdJHo
|
||||
Bn67dymcl+iyp337HJNY+qS+KCgoqAWlxkzXRiXKb/yluhXdIkqhg4kL8JPAJvfS
|
||||
cs7Zn67Mx04ixJnRMYCDmxtD4xPsFMzM7g8m3PQp+nE7WhujM/ImM7kCDQRVyNYd
|
||||
ARAAlw9H/1ybQs4K3XKA1joII16rta9KS7ew76+agXo0jeSRwMEQfItOxYvfhmo8
|
||||
+ydn5TWsTbifGU8L3+EBTMRRyzWhbaGO0Wizw7BTVJ7n5JW+ndPrcUpp/ilUk6AU
|
||||
VxaO/8/R+9+VJZpoeoLHXYloFGNuX58GLIy1jSBvLsLl/Ki5IOrHvD1GK6TftOl5
|
||||
j8IPC1LSBrwGJO803x7wUdQP/tsKN/QPR8pnBntrEgrQFSI+Q3qrCvVMmXnBlYum
|
||||
jfOBt8pKMgB9/ix+HWN8piQNQiJxD+XjEM6XwUmQqIR7y5GINKWgundCmtYIzVgY
|
||||
9p2Br6UPrTJi12LfKv5s2R6NnxFHv/ad29CpPTeLJRsSqFfqBL969BCpj/isXmQE
|
||||
m4FtziZidARXo12KiGAnPF9otirNHp4+8hwNB3scf7cI53y8nZivO9cwI7BoClY6
|
||||
ZIabjDcJxjK+24emoz3mJ5SHpZpQLSb9o8GbLLfXOq+4uzEX2A30fhrtsQb/x0GM
|
||||
4v3EU1aP2mjuksyYbgldtY64tD35wqAA9mVl5Ux+g1HoUBvLw0h+lzwh370NJw//
|
||||
ITvBQVUtDMB96rfIP4fL5pYl5pmRz+vsuJ0iXzm05qBgKfSqO7To9SWxQPdX89R4
|
||||
u0/XVAlw0Ak9Zceq3W96vseEUTR3aoZCMIPiwfcDaq60rWUAEQEAAYkCJQQYAQoA
|
||||
DwUCVcjWHQIbDAUJB4YfgAAKCRA6RtGReVpYOEg/EADZcIYw4q1jAbDkDy3LQG07
|
||||
AR8QmLp/RDp72RKbCSIYyvyXEnmrhUg98lUG676qTH+Y7dlEX107dLhFuKEYyV8D
|
||||
ZalrFQO/3WpLWdIAmWrj/wq14qii1rgmy96Nh3EqG3CS50HEMGkW1llRx2rgBvGl
|
||||
pgoTcwOfT+h8s0HlZdIS/cv2wXqwPgMWr1PIk3as1fu1OH8n/BjeGQQnNJEaoBV7
|
||||
El2C/hz3oqf2uYQ1QvpU23F1NrstekxukO8o2Y/fqsgMJqAiNJApUCl/dNhK+W57
|
||||
iicjvPirUQk8MUVEHXKhWIzYxon6aEUTx+xyNMBpRJIZlJ61FxtnZhoPiAFtXVPb
|
||||
+95BRJA9npidlVFjqz9QDK/4NSnJ3KaERR9tTDcvq4zqT22Z1Ai5gWQKqogTz5Mk
|
||||
F+nZwVizW0yi33id9qDpAuApp8o6AiyH5Ql1Bo23bvqS2lMrXPIS/QmPPsA76CBs
|
||||
lYjQwwz8abUD1pPdzyYtMKZUMwhicSFOHFDM4oQN16k2KJuntuih8BKVDCzIOq+E
|
||||
KHyeh1BqWplUtFh1ckxZlXW9p9F7TsWjtfcKaY8hkX0Cr4uVjwAFIjLcAxk67ROe
|
||||
huEb3Gt+lwJz6aNnZUU87ukMAxRVR2LL0btdxgc6z8spl66GXro/LUkXmAdyOEMV
|
||||
UDrmjf9pr7o00hC7lCHFzw==
|
||||
=WE0r
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
</pre>
|
||||
@@ -3,7 +3,7 @@ the code and data maintained as part of the IANA Time Zone Database.
|
||||
The IANA asserts that the database is in the public domain.
|
||||
|
||||
For more information, see
|
||||
https://www.iana.org/time-zones
|
||||
http://www.iana.org/time-zones
|
||||
ftp://ftp.iana.org/tz/code/tz-link.htm
|
||||
http://tools.ietf.org/html/rfc6557
|
||||
|
||||
|
||||
@@ -5,35 +5,47 @@
|
||||
|
||||
# This script rebuilds the time zone files using files
|
||||
# downloaded from the ICANN/IANA distribution.
|
||||
# Consult https://www.iana.org/time-zones for the latest versions.
|
||||
# Consult http://www.iana.org/time-zones for the latest versions.
|
||||
|
||||
# Versions to use.
|
||||
CODE=2020a
|
||||
DATA=2020a
|
||||
CODE=2016f
|
||||
DATA=2016f
|
||||
|
||||
set -e
|
||||
rm -rf work
|
||||
mkdir work
|
||||
cd work
|
||||
mkdir zoneinfo
|
||||
curl -L -O https://www.iana.org/time-zones/repository/releases/tzcode$CODE.tar.gz
|
||||
curl -L -O https://www.iana.org/time-zones/repository/releases/tzdata$DATA.tar.gz
|
||||
curl -O http://www.iana.org/time-zones/repository/releases/tzcode$CODE.tar.gz
|
||||
curl -O http://www.iana.org/time-zones/repository/releases/tzdata$DATA.tar.gz
|
||||
tar xzf tzcode$CODE.tar.gz
|
||||
tar xzf tzdata$DATA.tar.gz
|
||||
|
||||
# Turn off 64-bit output in time zone files.
|
||||
# We don't need those until 2037.
|
||||
perl -p -i -e 's/pass <= 2/pass <= 1/' zic.c
|
||||
|
||||
make CFLAGS=-DSTD_INSPIRED AWK=awk TZDIR=zoneinfo posix_only
|
||||
|
||||
# America/Los_Angeles should not be bigger than 1100 bytes.
|
||||
# If it is, we probably failed to disable the 64-bit output, which
|
||||
# triples the size of the files.
|
||||
size=$(ls -l zoneinfo/America/Los_Angeles | awk '{print $5}')
|
||||
if [ $size -gt 1200 ]; then
|
||||
echo 'zone file too large; 64-bit edit failed?' >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
cd zoneinfo
|
||||
rm -f ../../zoneinfo.zip
|
||||
zip -0 -r ../../zoneinfo.zip *
|
||||
cd ../..
|
||||
|
||||
go generate time/tzdata
|
||||
|
||||
echo
|
||||
if [ "$1" = "-work" ]; then
|
||||
if [ "$1" == "-work" ]; then
|
||||
echo Left workspace behind in work/.
|
||||
else
|
||||
rm -rf work
|
||||
fi
|
||||
echo New time zone files in zoneinfo.zip.
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user