Compare commits

..

13 Commits

Author SHA1 Message Date
Rick Hudson
1d4942afe0 [dev.garbage] runtime: determine if an object is public
ROC (request oriented collector) needs to determine
if an object is visible to other goroutines, i.e.
public. In a later CL this will be used by the write
barrier and the publishing logic to distinguish between
local and public objects and act accordingly.

Change-Id: I6a80da9deb21f57e831a2ec04e41477f997a8c33
Reviewed-on: https://go-review.googlesource.com/25056
Reviewed-by: Austin Clements <austin@google.com>
2017-05-25 18:05:53 +00:00
Austin Clements
8b25a00e6d Merge branch 'master' into dev.garbage
Change-Id: I36274cf72b8e1908efc8e375cab7880d7b0b3f43
2017-01-11 11:34:07 -05:00
Austin Clements
42afbd9e63 Merge branch 'master' into dev.garbage
Sync to 1.8 beta 1.

Change-Id: Iddd3773babd8fe50aed791ef7150d0c7c455cc8d
2016-12-05 12:15:50 -05:00
Austin Clements
f9f6c90ed1 [dev.garbage] Merge branch 'master' into dev.garbage
This merges master as of the Go 1.7 release.

Change-Id: I95ac0f96a0837173a2b8d7e8aaadf6fecc1baeaf
2016-08-25 11:55:08 -04:00
Rick Hudson
69161e279e [dev.garbage] runtime: Add GODEBUG=gcroc=n
Add command line boilerplace that turns the ROC algorithm on.
gcroc=0 or not specified:
	does not turn ROC on but some benign code may run.
gcroc=1
	simply turns the algorithm on
gcroc>1
	same as gcroc but with increasing levels of diagnostics
	being turned on. Expect gcroc>1 to not be as performant as
	gcroc=1

Change-Id: I6348b6768f7a3f8c2f69ef01ea20efebf992029e
Reviewed-on: https://go-review.googlesource.com/21368
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-26 13:21:53 +00:00
Austin Clements
fb4c718209 [dev.garbage] Merge branch 'master' into dev.garbage
Change-Id: I8ba4b012d82921f9521f471b1c0b5a1f6149a986
2016-07-19 17:54:41 -04:00
Austin Clements
81b74bf9c5 [dev.garbage] runtime: make _TinySizeClass an int8 to prevent use as spanClass
Currently _TinySizeClass is untyped, which means it can accidentally
be used as a spanClass (not that I would know this from experience or
anything). Make it an int8 to avoid this mix up.

Change-Id: I1e69eccee436ea5aa45e9a9828a013e369e03f1a
Reviewed-on: https://go-review.googlesource.com/24372
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-06-23 16:26:08 +00:00
Austin Clements
edb54c300f [dev.garbage] runtime: eliminate heapBitsSetTypeNoScan
It's no longer necessary to maintain the bitmap of noscan objects
since we now use the span metadata to determine that they're noscan
instead of the bitmap.

The combined effect of segregating noscan spans and the follow-on
optimizations is almost no effect on the go1 benchmarks and a 1.19%
improvement in the garbage benchmark:

name              old time/op  new time/op  delta
XBenchGarbage-12  2.13ms ± 2%  2.11ms ± 1%  -1.19%  (p=0.000 n=19+20)

name                      old time/op    new time/op    delta
BinaryTree17-12              2.42s ± 1%     2.41s ± 1%  -0.50%  (p=0.001 n=20+17)
Fannkuch11-12                2.14s ± 0%     2.12s ± 0%  -0.91%  (p=0.000 n=20+17)
FmtFprintfEmpty-12          45.2ns ± 0%    45.2ns ± 1%    ~     (p=0.677 n=16+19)
FmtFprintfString-12          131ns ± 0%     132ns ± 1%  +0.57%  (p=0.000 n=16+20)
FmtFprintfInt-12             126ns ± 1%     126ns ± 0%    ~     (p=0.078 n=18+16)
FmtFprintfIntInt-12          199ns ± 0%     195ns ± 0%  -2.19%  (p=0.000 n=14+20)
FmtFprintfPrefixedInt-12     196ns ± 1%     196ns ± 0%    ~     (p=0.155 n=19+16)
FmtFprintfFloat-12           254ns ± 0%     253ns ± 0%  -0.50%  (p=0.000 n=14+19)
FmtManyArgs-12               803ns ± 1%     798ns ± 0%  -0.71%  (p=0.000 n=18+19)
GobDecode-12                7.11ms ± 1%    7.07ms ± 1%  -0.50%  (p=0.024 n=18+19)
GobEncode-12                5.87ms ± 0%    5.86ms ± 1%    ~     (p=0.113 n=19+20)
Gzip-12                      218ms ± 1%     218ms ± 1%    ~     (p=0.879 n=19+20)
Gunzip-12                   37.2ms ± 0%    37.3ms ± 0%  +0.14%  (p=0.047 n=19+20)
HTTPClientServer-12         80.5µs ± 6%    82.8µs ± 8%  +2.91%  (p=0.008 n=19+20)
JSONEncode-12               15.4ms ± 1%    15.4ms ± 1%  -0.32%  (p=0.003 n=18+19)
JSONDecode-12               55.1ms ± 1%    53.0ms ± 1%  -3.87%  (p=0.000 n=18+20)
Mandelbrot200-12            4.08ms ± 1%    4.10ms ± 1%  +0.34%  (p=0.001 n=19+17)
GoParse-12                  3.20ms ± 1%    3.21ms ± 1%    ~     (p=0.138 n=19+19)
RegexpMatchEasy0_32-12      70.6ns ± 2%    70.4ns ± 2%    ~     (p=0.343 n=20+20)
RegexpMatchEasy0_1K-12       240ns ± 0%     242ns ± 2%  +0.88%  (p=0.000 n=15+20)
RegexpMatchEasy1_32-12      70.5ns ± 1%    70.2ns ± 3%    ~     (p=0.053 n=18+20)
RegexpMatchEasy1_1K-12       374ns ± 1%     374ns ± 1%    ~     (p=0.705 n=20+19)
RegexpMatchMedium_32-12      108ns ± 1%     108ns ± 1%    ~     (p=0.854 n=20+19)
RegexpMatchMedium_1K-12     33.5µs ± 1%    33.6µs ± 2%    ~     (p=0.897 n=18+20)
RegexpMatchHard_32-12       1.76µs ± 1%    1.75µs ± 1%    ~     (p=0.771 n=18+18)
RegexpMatchHard_1K-12       52.8µs ± 1%    52.8µs ± 1%    ~     (p=0.678 n=17+19)
Revcomp-12                   381ms ± 1%     380ms ± 0%    ~     (p=0.320 n=20+16)
Template-12                 65.6ms ± 1%    65.1ms ± 2%  -0.75%  (p=0.003 n=20+20)
TimeParse-12                 324ns ± 1%     326ns ± 1%  +0.72%  (p=0.000 n=18+18)
TimeFormat-12                342ns ± 0%     343ns ± 1%  +0.22%  (p=0.004 n=15+18)
[Geo mean]                  52.4µs         52.3µs       -0.18%

Change-Id: Ic77faaa15cdac3bfbbb0032dde5c204e05a0fd8e
Reviewed-on: https://go-review.googlesource.com/23702
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-06-15 21:17:15 +00:00
Austin Clements
312aa09996 [dev.garbage] runtime: eliminate heapBits.hasPointers
This is no longer necessary now that we can more efficiently consult
the span's noscan bit.

Change-Id: Id0b00b278533660973f45eb6efa5b00f373d58af
Reviewed-on: https://go-review.googlesource.com/23701
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-06-15 21:17:04 +00:00
Austin Clements
d491e550c3 [dev.garbage] runtime: separate spans of noscan objects
Currently, we mix objects with pointers and objects without pointers
("noscan" objects) together in memory. As a result, for every object
we grey, we have to check that object's heap bits to find out if it's
noscan, which adds to the per-object cost of GC. This also hurts the
TLB footprint of the garbage collector because it decreases the
density of scannable objects at the page level.

This commit improves the situation by using separate spans for noscan
objects. This will allow a much simpler noscan check (in a follow up
CL), eliminate the need to clear the bitmap of noscan objects (in a
follow up CL), and improves TLB footprint by increasing the density of
scannable objects.

This is also a step toward eliminating dead bits, since the current
noscan check depends on checking the dead bit of the first word.

This has no effect on the heap size of the garbage benchmark.

We'll measure the performance change of this after the follow-up
optimizations.

Change-Id: I13bdc4869538ece5649a8d2a41c6605371618e40
Reviewed-on: https://go-review.googlesource.com/23700
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-06-15 21:16:53 +00:00
Austin Clements
641c32dafa [dev.garbage] Merge branch 'master' into dev.garbage
Change-Id: I7ab2afca656e8c145804d9823cd084b8a85bccd7
2016-06-06 10:01:41 -04:00
Austin Clements
2e495a1df6 [dev.garbage] Merge branch 'master' into dev.garbage
Change-Id: I35edefb4464566601850081ecc84dd3535d60ceb
2016-05-16 14:29:53 -04:00
Austin Clements
344476d23c [dev.garbage] Merge branch 'master' into dev.garbage
Change-Id: I2e04fd9e7071efe33ce76f2f10a8dbde53ba90b9
2016-05-09 14:49:54 -04:00
6536 changed files with 320220 additions and 1174416 deletions

View File

@@ -1,3 +0,0 @@
# Code of Conduct
Please read the [Go Community Code of Conduct](https://golang.org/conduct).

View File

@@ -1,36 +1,20 @@
<!-- Please answer these questions before submitting your issue. Thanks! -->
Please answer these questions before submitting your issue. Thanks!
### What version of Go are you using (`go version`)?
<pre>
$ go version
</pre>
### Does this issue reproduce with the latest release?
### 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?
<!--
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?
### What did you see instead?

View File

@@ -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
View File

@@ -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

12
.gitignore vendored
View File

@@ -31,10 +31,9 @@ _testmain.go
/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/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
@@ -44,8 +43,3 @@ _testmain.go
/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.

605
AUTHORS

File diff suppressed because it is too large Load Diff

View File

@@ -4,19 +4,15 @@ 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.
General questions should go to the
[golang-nuts mailing list](https://groups.google.com/group/golang-nuts) or
[other forum](https://golang.org/wiki/Questions) instead of the issue tracker.
The gophers there will answer or ask you to file an issue if you've tripped over a bug.
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?
@@ -26,9 +22,17 @@ Otherwise, when filing an issue, make sure to answer these five questions:
For change proposals, see [Proposing Changes To Go](https://github.com/golang/proposal/).
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).
Also, please do not post patches on the issue tracker.
Unless otherwise noted, the Go source files are distributed under
the BSD-style license found in the LICENSE file.

File diff suppressed because it is too large Load Diff

View File

@@ -4,41 +4,40 @@ Go is an open source programming language that makes it easy to build simple,
reliable, and efficient software.
![Gopher image](doc/gopher/fiveyears.jpg)
*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.

View File

@@ -1,13 +0,0 @@
# Security Policy
## Supported Versions
We support the past two Go releases (for example, Go 1.11.x and Go 1.12.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.

View File

@@ -1 +0,0 @@
go1.13.7

View File

@@ -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.

View File

@@ -1,13 +1,7 @@
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 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), func Fchflags(string, int) error
pkg syscall (darwin-386-cgo), const ImplementsGetwd = false
@@ -19,30 +13,25 @@ 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
@@ -74,7 +63,6 @@ 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
@@ -108,12 +96,6 @@ 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
@@ -122,7 +104,6 @@ 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
@@ -175,7 +156,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
@@ -238,7 +218,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
@@ -301,7 +280,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
@@ -364,98 +342,3 @@ 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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -134,7 +134,7 @@ 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>

View File

@@ -377,11 +377,8 @@ func (w *Watchdog) Start() {
<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>

View File

@@ -8,7 +8,6 @@ import (
"errors"
"html/template"
"io/ioutil"
"log"
"net/http"
"regexp"
)
@@ -99,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)
}

View File

@@ -7,7 +7,6 @@ package main
import (
"html/template"
"io/ioutil"
"log"
"net/http"
)
@@ -50,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)
}

View File

@@ -7,7 +7,6 @@ package main
import (
"html/template"
"io/ioutil"
"log"
"net/http"
"regexp"
)
@@ -88,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)
}

View File

@@ -7,7 +7,6 @@ package main
import (
"html/template"
"io/ioutil"
"log"
"net/http"
)
@@ -62,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)
}

View File

@@ -1,27 +1,36 @@
--- final.go 2017-08-31 13:19:00.422925489 -0700
+++ final-test.go 2017-08-31 13:23:43.381391659 -0700
@@ -8,6 +8,7 @@
"html/template"
"io/ioutil"
"log"
+ "net"
"net/http"
"regexp"
)
@@ -86,5 +87,15 @@
http.HandleFunc("/edit/", makeHandler(editHandler))
http.HandleFunc("/save/", makeHandler(saveHandler))
- log.Fatal(http.ListenAndServe(":8080", nil))
+ 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
}
*** 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
}

View File

@@ -7,7 +7,6 @@ package main
import (
"html/template"
"io/ioutil"
"log"
"net/http"
"regexp"
)
@@ -86,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)
}

View File

@@ -2,7 +2,6 @@ package main
import (
"fmt"
"log"
"net/http"
)
@@ -12,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)
}

View File

@@ -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
@@ -268,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.
@@ -288,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

View File

@@ -7,7 +7,6 @@ package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
@@ -53,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)
}

View File

@@ -7,7 +7,6 @@ package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
@@ -38,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)
}

View File

@@ -7,7 +7,6 @@ package main
import (
"html/template"
"io/ioutil"
"log"
"net/http"
)
@@ -70,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)
}

View File

@@ -7,7 +7,6 @@ package main
import (
"html/template"
"io/ioutil"
"log"
"net/http"
)
@@ -54,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)
}

View File

@@ -20,7 +20,7 @@ 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
if [ "$1" == "-all" ]; then
for fn in *.go; do
go build -o a.out $fn
done

View File

@@ -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,
@@ -492,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.
@@ -510,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:
@@ -590,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>
@@ -755,14 +738,6 @@ The other codes are <code>-&gt;</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>
@@ -777,61 +752,11 @@ Addressing modes:
<ul>
<li>
<code>R0-&gt;16</code>
<br>
<code>R0&gt;&gt;16</code>
<br>
<code>R0&lt;&lt;16</code>
<br>
<code>R0@&gt;16</code>:
These are the same as on the 32-bit ARM.
</li>
<li>
<code>$(8&lt;&lt;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&lt;&lt;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&lt;&lt;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&lt;&lt;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&lt;&lt;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">64-bit PowerPC, a.k.a. ppc64</h3>
<p>
@@ -951,18 +876,6 @@ Addressing modes:
</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>

View File

@@ -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>
@@ -60,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>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>Cover is a program for creating and analyzing the coverage profiles
generated by <code>"go test -coverprofile"</code>.</td>
@@ -74,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>&nbsp;&nbsp;&nbsp;&nbsp;</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>
@@ -93,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>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>Yacc is a version of yacc that generates parsers implemented in Go.</td>
</tr>
</table>
<p>

View File

@@ -44,16 +44,18 @@ control repositories.
<h3 id="Workspaces">Workspaces</h3>
<p>
A workspace is a directory hierarchy with two directories at its root:
A workspace is a directory hierarchy with three directories at its root:
</p>
<ul>
<li><code>src</code> contains Go source files, and
<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 and installs binaries to the <code>bin</code> directory.
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>
@@ -70,6 +72,10 @@ To give you an idea of how a workspace looks in practice, here's an example:
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
@@ -104,10 +110,6 @@ packages and commands. Most Go programmers keep <i>all</i> their Go source code
and dependencies in a single workspace.
</p>
<p>
Note that symbolic links should <b>not</b> be used to link files or directories into your workspace.
</p>
<p>
Commands and libraries are built from different kinds of source packages.
We will discuss the distinction <a href="#PackageNames">later</a>.
@@ -122,12 +124,8 @@ workspace. It defaults to a directory named <code>go</code> inside your home dir
so <code>$HOME/go</code> on Unix,
<code>$home/go</code> on Plan 9,
and <code>%USERPROFILE%\go</code> (usually <code>C:\Users\YourName\go</code>) on Windows.
</p>
<p>
If you would like to work in a different location, you will need to
<a href="https://golang.org/wiki/SettingGOPATH">set <code>GOPATH</code></a>
to the path to that directory.
If you would like to work in a different location, you will need to set
<code>GOPATH</code> to the path to that directory.
(Another common setup is to set <code>GOPATH=$HOME</code>.)
Note that <code>GOPATH</code> must <b>not</b> be the
same path as your Go installation.
@@ -234,7 +232,7 @@ package main
import "fmt"
func main() {
fmt.Println("Hello, world.")
fmt.Printf("Hello, world.\n")
}
</pre>
@@ -268,7 +266,7 @@ 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/go/bin/hello</code>.
<code>$HOME/work/bin/hello</code>.
</p>
<p>
@@ -304,12 +302,12 @@ optional: you do not need to use source control to write Go code.
<pre>
$ <b>cd $GOPATH/src/github.com/user/hello</b>
$ <b>git init</b>
Initialized empty Git repository in /home/user/go/src/github.com/user/hello/.git/
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, 7 insertion(+)
create mode 100644 hello.go
1 file changed, 1 insertion(+)
create mode 100644 hello.go
</pre>
<p>
@@ -368,8 +366,9 @@ $ <b>go build</b>
</pre>
<p>
This won't produce an output file.
Instead it saves the compiled package in the local build cache.
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>
@@ -388,18 +387,24 @@ import (
)
func main() {
fmt.Println(stringutil.Reverse("!oG ,olleH"))
fmt.Printf(stringutil.Reverse("!oG ,olleH"))
}
</pre>
<p>
Install the <code>hello</code> program:
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>
@@ -416,6 +421,10 @@ After the steps above, your workspace should look like this:
<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/
@@ -424,6 +433,22 @@ src/
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>
@@ -564,6 +589,12 @@ tree should now look like this:
<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
@@ -634,7 +665,7 @@ articles about the Go language and its libraries and tools.
<p>
For real-time help, ask the helpful gophers in <code>#go-nuts</code> on the
<a href="https://freenode.net/">Freenode</a> IRC server.
<a href="http://freenode.net/">Freenode</a> IRC server.
</p>
<p>

View File

@@ -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);
};

View File

@@ -13,14 +13,15 @@ ul ul {
}
</style>
<h2 id="about">About</h2>
<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 gender identity and expression, sexual orientation,
disabilities, neurodiversity, physical appearance, body size, ethnicity, nationality,
race, age, religion, or similar personal characteristics.
environment for all, regardless of age, disability, gender, nationality,
ethnicity, religion, sexuality, or similar personal characteristic.
</p>
<p>
@@ -43,9 +44,35 @@ contributors and users from all backgrounds.
</p>
<p>
We believe that healthy debate and disagreement are essential to a healthy project and community.
However, it is never ok to be disrespectful.
We value diverse opinions, but we value respectful behavior more.
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.
</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>
@@ -102,104 +129,131 @@ 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="code">Code of Conduct</h2>
<h2 id="unwelcome_behavior">Unwelcome behavior</h2>
<h3 id="our-pledge">Our Pledge</h3>
<p>In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of
experience, education, socio-economic status, nationality, personal appearance,
race, religion, or sexual identity and orientation.</p>
<h3 id="our-standards">Our Standards</h3>
<p>Examples of behavior that contributes to creating a positive environment
include:</p>
<p>
These actions are explicitly forbidden in Go spaces:
</p>
<ul>
<li>Using welcoming and inclusive language</li>
<li>Being respectful of differing viewpoints and experiences</li>
<li>Gracefully accepting constructive criticism</li>
<li>Focusing on what is best for the community</li>
<li>Showing empathy towards other community members</li>
<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>
<p>Examples of unacceptable behavior by participants include:</p>
<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>The use of sexualized language or imagery and unwelcome sexual attention or
advances</li>
<li>Trolling, insulting/derogatory comments, and personal or political attacks</li>
<li>Public or private harassment</li>
<li>Publishing others&rsquo; private information, such as a physical or electronic
address, without explicit permission</li>
<li>Other conduct which could reasonably be considered inappropriate in a
professional setting</li>
<li>Aditya Mukerjee &lt;dev@chimeracoder.net&gt;
<li>Andrew Gerrand &lt;adg@golang.org&gt;
<li>Dave Cheney &lt;dave@cheney.net&gt;
<li>Jason Buberel &lt;jbuberel@google.com&gt;
<li>Peggy Li &lt;peggyli.224@gmail.com&gt;
<li>Sarah Adams &lt;sadams.codes@gmail.com&gt;
<li>Steve Francia &lt;steve.francia@gmail.com&gt;
<li>Verónica López &lt;gveronicalg@gmail.com&gt;
</ul>
<h3 id="our-responsibilities">Our Responsibilities</h3>
<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>
<p>Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.</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>Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.</p>
<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>
<h3 id="scope">Scope</h3>
<p>This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.</p>
<p>This Code of Conduct also applies outside the project spaces when the Project
Steward has a reasonable belief that an individual&rsquo;s behavior may have a
negative impact on the project or its community.</p>
<h3 id="conflict-resolution"></a>Conflict Resolution</h3>
<p>We do not believe that all conflict is bad; healthy debate and disagreement
often yield positive results. However, it is never okay to be disrespectful or
to engage in behavior that violates the projects code of conduct.</p>
<p>If you see someone violating the code of conduct, you are encouraged to address
the behavior directly with those involved. Many issues can be resolved quickly
and easily, and this gives people more control over the outcome of their
dispute. If you are unable to resolve the matter for any reason, or if the
behavior is threatening or harassing, report it. We are dedicated to providing
an environment where participants feel welcome and safe.</p>
<p id="reporting">Reports should be directed to Cassandra Salisbury, the
Go Project Steward, at <i>conduct@golang.org</i>.
It is the Project Stewards duty to
receive and address reported violations of the code of conduct. They will then
work with a committee consisting of representatives from the Open Source
Programs Office and the Google Open Source Strategy team. If for any reason you
are uncomfortable reaching out the Project Steward, please email
the Google Open Source Programs Office at <i>opensource@google.com</i>.</p>
<p>We will investigate every complaint, but you may not receive a direct response.
We will use our discretion in determining when and how to follow up on reported
incidents, which may range from not taking action to permanent expulsion from
the project and project-sponsored spaces. We will notify the accused of the
report and provide them an opportunity to discuss it before any action is taken.
The identity of the reporter will be omitted from the details of the report
supplied to the accused. In potentially harmful situations, such as ongoing
harassment or threats to anyone&rsquo;s safety, we may take action without notice.</p>
<h3 id="attribution">Attribution</h3>
<p>This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
available at
<a href="https://www.contributor-covenant.org/version/1/4/code-of-conduct.html">https://www.contributor-covenant.org/version/1/4/code-of-conduct.html</a></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>
@@ -209,3 +263,10 @@ available at
<li>Dont 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>

View File

@@ -34,12 +34,6 @@ We encourage all Go users to subscribe to
<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.13">Go 1.13</a> <small>(September 2019)</small></li>
<li><a href="/doc/go1.12">Go 1.12</a> <small>(February 2019)</small></li>
<li><a href="/doc/go1.11">Go 1.11</a> <small>(August 2018)</small></li>
<li><a href="/doc/go1.10">Go 1.10</a> <small>(February 2018)</small></li>
<li><a href="/doc/go1.9">Go 1.9</a> <small>(August 2017)</small></li>
<li><a href="/doc/go1.8">Go 1.8</a> <small>(February 2017)</small></li>
<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>
@@ -62,15 +56,6 @@ Go 1 matures.
<h3 id="source"><a href="https://golang.org/change">Source Code</a></h3>
<p>Check out the Go source code.</p>
<h3 id="discuss"><a href="//groups.google.com/group/golang-nuts">Discussion Mailing List</a></h3>
<p>
A mailing list for general discussion of Go programming.
</p>
<p>
Questions about using Go or announcements relevant to other Go users should be sent to
<a href="//groups.google.com/group/golang-nuts">golang-nuts</a>.
</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>
@@ -78,6 +63,9 @@ 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>
@@ -125,8 +113,8 @@ 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
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%3A%22help+wanted%22">help wanted</a>
<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>

File diff suppressed because it is too large Load Diff

View File

@@ -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/derekparker/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/derekparker/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 (&ge;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 (&gt;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&lt;*testing.T&gt;
</pre>
<p>
That <code>struct</code> <code>hchan&lt;*testing.T&gt;</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&lt;*testing.T&gt;</code> is the runtime-internal representation of a channel. It is currently empty, or gdb would have pretty-printed it's contents.
</p>
<p>

View File

@@ -15,471 +15,19 @@ git checkout <i>release-branch</i>
<h2 id="policy">Release Policy</h2>
<p>
Each major Go release is supported until there are two newer major releases.
For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was
supported until the Go 1.8 release.
We fix critical problems, including <a href="/security">critical security problems</a>,
in supported releases as needed by issuing minor revisions
(for example, Go 1.6.1, Go 1.6.2, and so on).
</p>
<h2 id="go1.13">go1.13 (released 2019/09/03)</h2>
<p>
Go 1.13 is a major release of Go.
Read the <a href="/doc/go1.13">Go 1.13 Release Notes</a> for more information.
</p>
<h3 id="go1.13.minor">Minor revisions</h3>
<p>
go1.13.1 (released 2019/09/25) includes security fixes to the
<code>net/http</code> and <code>net/textproto</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.1+label%3ACherryPickApproved">Go
1.13.1 milestone</a> on our issue tracker for details.
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>
go1.13.2 (released 2019/10/17) includes security fixes to the
<code>crypto/dsa</code> package and the compiler.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.2+label%3ACherryPickApproved">Go
1.13.2 milestone</a> on our issue tracker for details.
</p>
<p>
go1.13.3 (released 2019/10/17) includes fixes to the go command,
the toolchain, the runtime, <code>syscall</code>, <code>net</code>,
<code>net/http</code>, and <code>crypto/ecdsa</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.3+label%3ACherryPickApproved">Go
1.13.3 milestone</a> on our issue tracker for details.
</p>
<p>
go1.13.4 (released 2019/10/31) includes fixes to the <code>net/http</code> and
<code>syscall</code> packages. It also fixes an issue on macOS 10.15 Catalina
where the non-notarized installer and binaries were being
<a href="https://golang.org/issue/34986">rejected by Gatekeeper</a>.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.4+label%3ACherryPickApproved">Go
1.13.4 milestone</a> on our issue tracker for details.
</p>
<p>
go1.13.5 (released 2019/12/04) includes fixes to the go command, the runtime,
the linker, and the <code>net/http</code> package. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.5+label%3ACherryPickApproved">Go
1.13.5 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.12">go1.12 (released 2019/02/25)</h2>
<p>
Go 1.12 is a major release of Go.
Read the <a href="/doc/go1.12">Go 1.12 Release Notes</a> for more information.
</p>
<h3 id="go1.12.minor">Minor revisions</h3>
<p>
go1.12.1 (released 2019/03/14) includes fixes to cgo, the compiler, the go
command, and the <code>fmt</code>, <code>net/smtp</code>, <code>os</code>,
<code>path/filepath</code>, <code>sync</code>, and <code>text/template</code>
packages. See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.1+label%3ACherryPickApproved">Go
1.12.1 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.2 (released 2019/04/05) includes fixes to the compiler, the go
command, the runtime, and the <code>doc</code>, <code>net</code>,
<code>net/http/httputil</code>, and <code>os</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.2+label%3ACherryPickApproved">Go
1.12.2 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.3 (released 2019/04/08) was accidentally released without its
intended fix. It is identical to go1.12.2, except for its version
number. The intended fix is in go1.12.4.
</p>
<p>
go1.12.4 (released 2019/04/11) fixes an issue where using the prebuilt binary
releases on older versions of GNU/Linux
<a href="https://golang.org/issues/31293">led to failures</a>
when linking programs that used cgo.
Only Linux users who hit this issue need to update.
</p>
<p>
go1.12.5 (released 2019/05/06) includes fixes to the compiler, the linker,
the go command, the runtime, and the <code>os</code> package. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.5+label%3ACherryPickApproved">Go
1.12.5 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.6 (released 2019/06/11) includes fixes to the compiler, the linker,
the go command, and the <code>crypto/x509</code>, <code>net/http</code>, and
<code>os</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.6+label%3ACherryPickApproved">Go
1.12.6 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.7 (released 2019/07/08) includes fixes to cgo, the compiler,
and the linker.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.7+label%3ACherryPickApproved">Go
1.12.7 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.8 (released 2019/08/13) includes security fixes to the
<code>net/http</code> and <code>net/url</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.8+label%3ACherryPickApproved">Go
1.12.8 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.9 (released 2019/08/15) includes fixes to the linker,
and the <code>os</code> and <code>math/big</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.9+label%3ACherryPickApproved">Go
1.12.9 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.10 (released 2019/09/25) includes security fixes to the
<code>net/http</code> and <code>net/textproto</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.10+label%3ACherryPickApproved">Go
1.12.10 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.11 (released 2019/10/17) includes security fixes to the
<code>crypto/dsa</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.11+label%3ACherryPickApproved">Go
1.12.11 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.12 (released 2019/10/17) includes fixes to the go command,
runtime, <code>syscall</code> and <code>net</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.12+label%3ACherryPickApproved">Go
1.12.12 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.13 (released 2019/10/31) fixes an issue on macOS 10.15 Catalina
where the non-notarized installer and binaries were being
<a href="https://golang.org/issue/34986">rejected by Gatekeeper</a>.
Only macOS users who hit this issue need to update.
</p>
<p>
go1.12.14 (released 2019/12/04) includes a fix to the runtime. See
the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.14+label%3ACherryPickApproved">Go
1.12.14 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.11">go1.11 (released 2018/08/24)</h2>
<p>
Go 1.11 is a major release of Go.
Read the <a href="/doc/go1.11">Go 1.11 Release Notes</a> for more information.
</p>
<h3 id="go1.11.minor">Minor revisions</h3>
<p>
go1.11.1 (released 2018/10/01) includes fixes to the compiler, documentation, go
command, runtime, and the <code>crypto/x509</code>, <code>encoding/json</code>,
<code>go/types</code>, <code>net</code>, <code>net/http</code>, and
<code>reflect</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.1+label%3ACherryPickApproved">Go
1.11.1 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.2 (released 2018/11/02) includes fixes to the compiler, linker,
documentation, go command, and the <code>database/sql</code> and
<code>go/types</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.2+label%3ACherryPickApproved">Go
1.11.2 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.3 (released 2018/12/12) includes three security fixes to "go get" and
the <code>crypto/x509</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.3+label%3ACherryPickApproved">Go
1.11.3 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.4 (released 2018/12/14) includes fixes to cgo, the compiler, linker,
runtime, documentation, go command, and the <code>net/http</code> and
<code>go/types</code> packages.
It includes a fix to a bug introduced in Go 1.11.3 that broke <code>go</code>
<code>get</code> for import path patterns containing "<code>...</code>".
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.4+label%3ACherryPickApproved">Go
1.11.4 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.5 (released 2019/01/23) includes a security fix to the
<code>crypto/elliptic</code> package. See
the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.5+label%3ACherryPickApproved">Go
1.11.5 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.6 (released 2019/03/14) includes fixes to cgo, the compiler, linker,
runtime, go command, and the <code>crypto/x509</code>, <code>encoding/json</code>,
<code>net</code>, and <code>net/url</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.6+label%3ACherryPickApproved">Go
1.11.6 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.7 (released 2019/04/05) includes fixes to the runtime and the
<code>net</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.7+label%3ACherryPickApproved">Go
1.11.7 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.8 (released 2019/04/08) was accidentally released without its
intended fix. It is identical to go1.11.7, except for its version
number. The intended fix is in go1.11.9.
</p>
<p>
go1.11.9 (released 2019/04/11) fixes an issue where using the prebuilt binary
releases on older versions of GNU/Linux
<a href="https://golang.org/issues/31293">led to failures</a>
when linking programs that used cgo.
Only Linux users who hit this issue need to update.
</p>
<p>
go1.11.10 (released 2019/05/06) includes fixes to the runtime and the linker.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.10+label%3ACherryPickApproved">Go
1.11.10 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.11 (released 2019/06/11) includes a fix to the <code>crypto/x509</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.11+label%3ACherryPickApproved">Go
1.11.11 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.12 (released 2019/07/08) includes fixes to the compiler and the linker.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.12+label%3ACherryPickApproved">Go
1.11.12 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.13 (released 2019/08/13) includes security fixes to the
<code>net/http</code> and <code>net/url</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.13+label%3ACherryPickApproved">Go
1.11.13 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.10">go1.10 (released 2018/02/16)</h2>
<p>
Go 1.10 is a major release of Go.
Read the <a href="/doc/go1.10">Go 1.10 Release Notes</a> for more information.
</p>
<h3 id="go1.10.minor">Minor revisions</h3>
<p>
go1.10.1 (released 2018/03/28) includes fixes to the compiler, runtime, and the
<code>archive/zip</code>, <code>crypto/tls</code>, <code>crypto/x509</code>,
<code>encoding/json</code>, <code>net</code>, <code>net/http</code>, and
<code>net/http/pprof</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.1+label%3ACherryPickApproved">Go
1.10.1 milestone</a> on our issue tracker for details.
</p>
<p>
go1.10.2 (released 2018/05/01) includes fixes to the compiler, linker, and go
command.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.2+label%3ACherryPickApproved">Go
1.10.2 milestone</a> on our issue tracker for details.
</p>
<p>
go1.10.3 (released 2018/06/05) includes fixes to the go command, and the
<code>crypto/tls</code>, <code>crypto/x509</code>, and <code>strings</code> packages.
In particular, it adds <a href="https://go.googlesource.com/go/+/d4e21288e444d3ffd30d1a0737f15ea3fc3b8ad9">
minimal support to the go command for the vgo transition</a>.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.3+label%3ACherryPickApproved">Go
1.10.3 milestone</a> on our issue tracker for details.
</p>
<p>
go1.10.4 (released 2018/08/24) includes fixes to the go command, linker, and the
<code>net/http</code>, <code>mime/multipart</code>, <code>ld/macho</code>,
<code>bytes</code>, and <code>strings</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.4+label%3ACherryPickApproved">Go
1.10.4 milestone</a> on our issue tracker for details.
</p>
<p>
go1.10.5 (released 2018/11/02) includes fixes to the go command, linker, runtime
and the <code>database/sql</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.5+label%3ACherryPickApproved">Go
1.10.5 milestone</a> on our issue tracker for details.
</p>
<p>
go1.10.6 (released 2018/12/12) includes three security fixes to "go get" and
the <code>crypto/x509</code> package.
It contains the same fixes as Go 1.11.3 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.6+label%3ACherryPickApproved">Go
1.10.6 milestone</a> on our issue tracker for details.
</p>
<p>
go1.10.7 (released 2018/12/14) includes a fix to a bug introduced in Go 1.10.6
that broke <code>go</code> <code>get</code> for import path patterns containing
"<code>...</code>".
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.7+label%3ACherryPickApproved">
Go 1.10.7 milestone</a> on our issue tracker for details.
</p>
<p>
go1.10.8 (released 2019/01/23) includes a security fix to the
<code>crypto/elliptic</code> package. See
the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.8+label%3ACherryPickApproved">Go
1.10.8 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.9">go1.9 (released 2017/08/24)</h2>
<p>
Go 1.9 is a major release of Go.
Read the <a href="/doc/go1.9">Go 1.9 Release Notes</a> for more information.
</p>
<h3 id="go1.9.minor">Minor revisions</h3>
<p>
go1.9.1 (released 2017/10/04) includes two security fixes.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.1+label%3ACherryPickApproved">Go
1.9.1 milestone</a> on our issue tracker for details.
</p>
<p>
go1.9.2 (released 2017/10/25) includes fixes to the compiler, linker, runtime,
documentation, <code>go</code> command,
and the <code>crypto/x509</code>, <code>database/sql</code>, <code>log</code>,
and <code>net/smtp</code> packages.
It includes a fix to a bug introduced in Go 1.9.1 that broke <code>go</code> <code>get</code>
of non-Git repositories under certain conditions.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.2+label%3ACherryPickApproved">Go
1.9.2 milestone</a> on our issue tracker for details.
</p>
<p>
go1.9.3 (released 2018/01/22) includes fixes to the compiler, runtime,
and the <code>database/sql</code>, <code>math/big</code>, <code>net/http</code>,
and <code>net/url</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.3+label%3ACherryPickApproved">Go
1.9.3 milestone</a> on our issue tracker for details.
</p>
<p>
go1.9.4 (released 2018/02/07) includes a security fix to “go get”.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.4+label%3ACherryPickApproved">Go
1.9.4</a> milestone on our issue tracker for details.
</p>
<p>
go1.9.5 (released 2018/03/28) includes fixes to the compiler, go command, and
<code>net/http/pprof</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.5+label%3ACherryPickApproved">Go
1.9.5 milestone</a> on our issue tracker for details.
</p>
<p>
go1.9.6 (released 2018/05/01) includes fixes to the compiler and go command.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.6+label%3ACherryPickApproved">Go
1.9.6 milestone</a> on our issue tracker for details.
</p>
<p>
go1.9.7 (released 2018/06/05) includes fixes to the go command, and the
<code>crypto/x509</code>, and <code>strings</code> packages.
In particular, it adds <a href="https://go.googlesource.com/go/+/d4e21288e444d3ffd30d1a0737f15ea3fc3b8ad9">
minimal support to the go command for the vgo transition</a>.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.7+label%3ACherryPickApproved">Go
1.9.7 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.8">go1.8 (released 2017/02/16)</h2>
<p>
Go 1.8 is a major release of Go.
Read the <a href="/doc/go1.8">Go 1.8 Release Notes</a> for more information.
</p>
<h3 id="go1.8.minor">Minor revisions</h3>
<p>
go1.8.1 (released 2017/04/07) includes fixes to the compiler, linker, runtime,
documentation, <code>go</code> command and the <code>crypto/tls</code>,
<code>encoding/xml</code>, <code>image/png</code>, <code>net</code>,
<code>net/http</code>, <code>reflect</code>, <code>text/template</code>,
and <code>time</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.1">Go
1.8.1 milestone</a> on our issue tracker for details.
</p>
<p>
go1.8.2 (released 2017/05/23) includes a security fix to the
<code>crypto/elliptic</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go
1.8.2 milestone</a> on our issue tracker for details.
</p>
<p>
go1.8.3 (released 2017/05/24) includes fixes to the compiler, runtime,
documentation, and the <code>database/sql</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.3">Go
1.8.3 milestone</a> on our issue tracker for details.
</p>
<p>
go1.8.4 (released 2017/10/04) includes two security fixes.
It contains the same fixes as Go 1.9.1 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.4">Go
1.8.4 milestone</a> on our issue tracker for details.
</p>
<p>
go1.8.5 (released 2017/10/25) includes fixes to the compiler, linker, runtime,
documentation, <code>go</code> command,
and the <code>crypto/x509</code> and <code>net/smtp</code> packages.
It includes a fix to a bug introduced in Go 1.8.4 that broke <code>go</code> <code>get</code>
of non-Git repositories under certain conditions.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.5">Go
1.8.5 milestone</a> on our issue tracker for details.
</p>
<p>
go1.8.6 (released 2018/01/22) includes the same fix in <code>math/big</code>
as Go 1.9.3 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.6">Go
1.8.6 milestone</a> on our issue tracker for details.
</p>
<p>
go1.8.7 (released 2018/02/07) includes a security fix to “go get”.
It contains the same fix as Go 1.9.4 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.7">Go
1.8.7</a> milestone on our issue tracker for details.
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>
@@ -521,20 +69,6 @@ See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.4">Go
1.7.4 milestone</a> on our issue tracker for details.
</p>
<p>
go1.7.5 (released 2017/01/26) includes fixes to the compiler, runtime,
and the <code>crypto/x509</code> and <code>time</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.5">Go
1.7.5 milestone</a> on our issue tracker for details.
</p>
<p>
go1.7.6 (released 2017/05/23) includes the same security fix as Go 1.8.2 and
was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go
1.8.2 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.6">go1.6 (released 2016/02/17)</h2>
<p>
@@ -655,7 +189,7 @@ See the <a href="https://github.com/golang/go/commits/go1.3.2">change history</a
</p>
<p>
go1.3.3 (released 2014/09/30) includes further bug fixes to cgo, the runtime package, and the nacl port.
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>
@@ -719,7 +253,7 @@ about the future of Go 1.
</p>
<p>
The go1 release corresponds to
The go1 release corresponds to
<code><a href="weekly.html#2012-03-27">weekly.2012-03-27</a></code>.
</p>
@@ -735,7 +269,7 @@ It also includes several minor code and documentation fixes.
<p>
go1.0.2 (released 2012/06/13) was issued to fix two bugs in the implementation
of maps using struct or array keys:
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.

View File

@@ -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 dont 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 doesnt 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 programs 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 Gos 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>Whats 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>

View File

@@ -1,7 +1,6 @@
<!--{
"Title": "Documentation",
"Path": "/doc/",
"Template": true
"Path": "/doc/"
}-->
<p>
@@ -34,43 +33,28 @@ libraries.
<img class="gopher" src="/doc/gopher/doc.png"/>
<h3 id="go_tour">
{{if $.GoogleCN}}
A Tour of Go
{{else}}
<a href="//tour.golang.org/">A Tour of Go</a>
{{end}}
</h3>
<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 {{if not $.GoogleCN}}<a href="//tour.golang.org/">take the tour
online</a> or{{end}} install it locally with:
learned. You can <a href="//tour.golang.org/">take the tour online</a> or
install it locally with:
</p>
<pre>
$ go get golang.org/x/tour
</pre>
<p>
This will place the <code>tour</code> binary in your workspace's <code>bin</code> directory.
<pre>
$ go get golang.org/x/tour/gotour
</pre>
This will place the <code>gotour</code> binary in your workspace's <code>bin</code> directory.
</p>
<h3 id="code"><a href="code.html">How to write Go code</a></h3>
<p>
{{if not $.GoogleCN}}
Also available as a <a href="//www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>, this
{{else}}
This
{{end}}
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="editors"><a href="editors.html">Editor plugins and IDEs</a></h3>
<p>
A document that summarizes commonly used editor plugins and IDEs with
Go support.
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>
@@ -80,11 +64,6 @@ 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="diagnostics"><a href="/doc/diagnostics.html">Diagnostics</a></h3>
<p>
Summarizes tools and methodologies to diagnose problems in Go programs.
</p>
<h3 id="faq"><a href="/doc/faq">Frequently Asked Questions (FAQ)</a></h3>
<p>
Answers to common questions about Go.
@@ -130,11 +109,9 @@ same variable in a different goroutine.
<h2 id="articles">Articles</h2>
{{if not $.GoogleCN}}
<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>
{{end}}
<h4>Codewalks</h4>
<p>
@@ -147,7 +124,6 @@ Guided tours of Go programs.
<li><a href="/doc/articles/wiki/">Writing Web Applications</a> - building a simple web application.</li>
</ul>
{{if not $.GoogleCN}}
<h4>Language</h4>
<ul>
<li><a href="/blog/json-rpc-tale-of-interfaces">JSON-RPC: a tale of interfaces</a></li>
@@ -168,20 +144,17 @@ Guided tours of Go programs.
<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>
{{end}}
<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="/doc/gdb">Debugging Go Code with GDB</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="/doc/asm">A Quick Guide to Go's Assembler</a> - an introduction to the assembler used by Go.</li>
{{if not $.GoogleCN}}
<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>
{{end}}
<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>
@@ -190,12 +163,12 @@ See the <a href="/wiki/Articles">Articles page</a> at the
<a href="/wiki">Wiki</a> for more Go articles.
</p>
{{if not $.GoogleCN}}
<h2 id="talks">Talks</h2>
<img class="gopher" src="/doc/gopher/talks.png"/>
<h3 id="video_tour_of_go"><a href="https://research.swtch.com/gotour">A Video Tour of Go</a></h3>
<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
@@ -221,7 +194,7 @@ This talk expands on the <i>Go Concurrency Patterns</i> talk to dive deeper into
<p>
See the <a href="/talks">Go Talks site</a> and <a href="/wiki/GoTalks">wiki page</a> for more Go talks.
</p>
{{end}}
<h2 id="nonenglish">Non-English Documentation</h2>

View File

@@ -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=lukehoban.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>

View File

@@ -246,16 +246,14 @@ func Compile(str string) (*Regexp, error) {
<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>.
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 -i 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>
@@ -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 &lt; 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
&amp;{7 -2.35 abc def}
&amp;{a:7 b:-2.35 c:abc def}
&amp;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(&quot;%T\n&quot;, 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) &gt;&gt; 1) // largest int
min := int(^uint(0) >> 1) // largest int
for _, i := range a {
if i &lt; 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 {
@@ -2769,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
@@ -2777,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,
@@ -2797,15 +2792,15 @@ job := &amp;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>
@@ -3595,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.

View File

@@ -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

View File

@@ -9,7 +9,7 @@ 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>
@@ -25,7 +25,7 @@ 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
<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
will include Go support.
@@ -52,26 +52,6 @@ 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 are expected to include a complete implementation
of the Go 1.10 release, depending on release timing. The Go 1.10
runtime has now been fully merged into the GCC development sources,
and concurrent garbage collection is expected to be fully supported in
GCC 8.
</p>
<h2 id="Source_code">Source code</h2>
<p>
@@ -79,7 +59,7 @@ 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="https://gcc.gnu.org/svn.html">instructions for getting the
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
@@ -101,7 +81,7 @@ 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
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,
@@ -156,7 +136,7 @@ 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
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
@@ -180,6 +160,23 @@ 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>
@@ -367,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>
@@ -386,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>
@@ -406,8 +400,8 @@ A slice in Go is a structure. The current definition is
<pre>
struct __go_slice {
void *__values;
intptr_t __count;
intptr_t __capacity;
int __count;
int __capacity;
};
</pre>
@@ -532,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>.

View File

@@ -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>

File diff suppressed because it is too large Load Diff

View File

@@ -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>&nbsp;<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>&nbsp;<code>test</code> command runs
<code>go</code>&nbsp;<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>&nbsp;<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>&nbsp;<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>&nbsp;<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>&nbsp;<code>tool</code>&nbsp;<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>&nbsp;<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>&nbsp;<code>run</code>&nbsp;<code>pkg</code> or <code>go</code>&nbsp;<code>run</code>&nbsp;<code>dir</code>, most importantly <code>go</code>&nbsp;<code>run</code>&nbsp;<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>&nbsp;<code>make([]T,</code>&nbsp;<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&lt;j</code> and <code>j&lt;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>&lt;nil&gt;</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>&nbsp;<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="runtime-again"><dt><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 -->

View File

@@ -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>&lt;nil&gt;</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 -->

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>
@@ -89,7 +89,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>

View File

@@ -12,10 +12,15 @@ 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.8</h2>
<h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.8</h2>
<p><strong>
Go 1.8 is not yet released. These are work-in-progress
release notes. Go 1.8 is expected to be released in February 2017.
</strong></p>
<p>
The latest Go release, version 1.8, arrives six months after <a href="go1.7">Go 1.7</a>.
@@ -88,8 +93,7 @@ On OpenBSD, Go now requires OpenBSD 5.9 or later. <!-- CL 34093 -->
<p>
The Plan 9 port's networking support is now much more complete
and matches the behavior of Unix and Windows with respect to deadlines
and cancelation. For Plan 9 kernel requirements, see the
<a href="https://golang.org/wiki/Plan9">Plan 9 wiki page</a>.
and cancelation.
</p>
<p>
@@ -430,11 +434,11 @@ version of gccgo.
<h3 id="plugin">Plugins</h3>
<p>
Go now provides early support for plugins with a “<code>plugin</code>
build mode for generating plugins written in Go, and a
Go now supports a “<code>plugin</code> build mode for generating
plugins written in Go, and a
new <a href="/pkg/plugin/"><code>plugin</code></a> package for
loading such plugins at run time. Plugin support is currently only
available on Linux. Please report any issues.
loading such plugins at run time. Plugin support is only currently
available on Linux.
</p>
<h2 id="runtime">Runtime</h2>
@@ -794,9 +798,9 @@ Optimizations and minor bug fixes are not listed.
hardware support for AES-GCM is present.
</p>
<p> <!-- CL 27315, CL 35290 -->
<p> <!-- CL 27315 -->
AES-128-CBC cipher suites with SHA-256 are also
now supported, but disabled by default.
now supported.
</p>
</dd>
@@ -804,6 +808,11 @@ Optimizations and minor bug fixes are not listed.
<dl id="crypto_x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
<dd>
<p> <!-- CL 30578 -->
<a href="/pkg/crypto/x509/#SystemCertPool"><code>SystemCertPool</code></a>
is now implemented on Windows.
</p>
<p> <!-- CL 24743 -->
PSS signatures are now supported.
</p>
@@ -854,12 +863,11 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
<p>
The <a href="/pkg/database/sql#IsolationLevel"><code>IsolationLevel</code></a>
can now be set when starting a transaction by setting the isolation level
on <a href="/pkg/database/sql#TxOptions.Isolation"><code>TxOptions.Isolation</code></a> and passing
it to <a href="/pkg/database/sql#DB.BeginTx"><code>DB.BeginTx</code></a>.
on the <code>Context</code> then passing that <code>Context</code> to
<a href="/pkg/database/sql#DB.BeginContext"><code>DB.BeginContext</code></a>.
An error will be returned if an isolation level is selected that the driver
does not support. A read-only attribute may also be set on the transaction
by setting <a href="/pkg/database/sql/#TxOptions.ReadOnly"><code>TxOptions.ReadOnly</code></a>
to true.
with <a href="/pkg/database/sql/#ReadOnlyContext"><code>ReadOnlyContext</code></a>.
</p>
<p>
Queries now expose the SQL column type information for drivers that support it.
@@ -1304,7 +1312,7 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
request must have the new
<a href="/pkg/net/http/#Request"><code>Request.GetBody</code></a>
field defined.
<a href="/pkg/net/http/#NewRequest"><code>NewRequest</code></a>
<a href="pkg/net/http/#NewRequest"><code>NewRequest</code></a>
sets <code>Request.GetBody</code> automatically for common
body types.
</li>
@@ -1609,9 +1617,9 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
June 31 and July 32.
</p>
<p> <!-- CL 33029 --> <!-- CL 34816 -->
<p> <!-- CL 33029 -->
The <code>tzdata</code> database has been updated to version
2016j for systems that don't already have a local time zone
2016i for systems that don't already have a local time zone
database.
</p>
@@ -1641,17 +1649,6 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
and only the overall execution of the test binary would fail.
</p>
<p><!-- CL 32455 -->
The signature of the
<a href="/pkg/testing/#MainStart"><code>MainStart</code></a>
function has changed, as allowed by the documentation. It is an
internal detail and not part of the Go 1 compatibility promise.
If you're not calling <code>MainStart</code> directly but see
errors, that likely means you set the
normally-empty <code>GOROOT</code> environment variable and it
doesn't match the version of your <code>go</code> command's binary.
</p>
</dd>
</dl>

55
doc/go1.8.txt Normal file
View File

@@ -0,0 +1,55 @@
This file lists things yet to be moved into go1.8.html or deemed too
minor to mention. Either way, delete from here when done.
Tools:
go: -buildmode=c-archive now builds PIC on ELF (CL 24180)
go: mobile pkg dir change, recommend using go list in scripts (CL 24930, CL 27929)
go, dist: can set default pkg-config tool using PKG_CONFIG env var (CL 29991)
go: can set secure/insecure GIT schemes using GIT_ALLOW_PROTOCOL env var (CL 30135)
API additions and behavior changes:
cmd/compile, runtime, etc: get rid of constant FP registers (CL 28095)
cmd/compile, runtime: add go:yeswritebarrierrec pragma (CL 30938)
cmd/compile/internal/gc: enable new parser by default (CL 27203)
cmd/compile/internal/syntax: fast Go syntax trees, initial commit (CL 27195)
cmd/compile: add compiler phase timing (CL 24462)
cmd/compile: add inline explainer (CL 22782)
cmd/compile: enable flag-specified dump of specific phase+function (CL 23044)
cmd/internal/obj, cmd/link: darwin dynlink support (CL 29393)
cmd/internal/objfile: add ppc64/ppc64le disassembler support (CL 9682)
cmd/link, cmd/go: delay linking of mingwex and mingw32 until very end (CL 26670)
cmd/link: R_ADDR dynamic relocs for internal PIE (CL 29118)
cmd/link: add trampolines for too far calls in ppc64x (CL 30850)
cmd/link: allow internal PIE linking (CL 28543)
cmd/link: fix -X importpath.name=value when import path needs escaping (CL 31970)
cmd/link: fix -buildmode=pie / -linkshared combination (CL 28996)
cmd/link: for -buildmode=exe pass -no-pie to external linker (CL 33106)
cmd/link: insert trampolines for too-far jumps on ARM (CL 29397)
cmd/link: non-executable stack support for Solaris (CL 24142)
cmd/link: put text at address 0x1000000 on darwin/amd64 (CL 32185)
cmd/link: remove the -shared flag (CL 28852)
cmd/link: split large elf text sections on ppc64x (CL 27790)
cmd/link: trampoline support for external linking on ARM (CL 31143)
cmd/objdump: implement objdump of .o files (CL 24818)
go/build: allow % in ${SRCDIR} expansion for Jenkins (CL 31611)
go/build: do not record go:binary-only-package if build tags not satisfied (CL 31577)
go/build: implement default GOPATH (CL 32019)
runtime/race: update race runtime (CL 32160)
runtime: assume 64kB physical pages on ARM (CL 25021)
runtime: disable stack rescanning by default (CL 31766)
runtime: don't call cgocallback from signal handler (CL 30218)
runtime: fix check for vacuous page boundary rounding (CL 27230)
runtime: fix map iterator concurrent map check (CL 24749)
runtime: fix newextram PC passed to race detector (CL 29712)
runtime: implement unconditional hybrid barrier (CL 31765)
runtime: include pre-panic/throw logs in core dumps (CL 32013)
runtime: limit the number of map overflow buckets (CL 25049)
runtime: pass windows float syscall args via XMM (CL 32173)
runtime: print sigcode on signal crash (CL 32183)
runtime: record current PC for SIGPROF on non-Go thread (CL 30252)
runtime: sleep on CLOCK_MONOTONIC in futexsleep1 on freebsd (CL 30154)

File diff suppressed because it is too large Load Diff

View File

@@ -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>.

View File

@@ -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>

File diff suppressed because it is too large Load Diff

View File

@@ -418,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>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

View File

@@ -1,7 +1,6 @@
<!--{
"Title": "Help",
"Path": "/help/",
"Template": true
"Path": "/help/"
}-->
<div id="manual-nav"></div>
@@ -10,7 +9,6 @@
<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.
@@ -27,23 +25,16 @@ The <a href="https://forum.golangbridge.org/">Go Forum</a> is a 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>
<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 +50,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 +67,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>

View File

@@ -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,7 +33,7 @@ compiler using the GCC back end, see
</p>
<p>
The Go compilers support nine instruction sets.
The Go compilers support eight instruction sets.
There are important differences in the quality of the compilers for the different
architectures.
</p>
@@ -87,12 +87,6 @@ architectures.
<dd>
Supports Linux binaries. New in 1.7 and not as well exercised as other ports.
</dd>
<dt>
<code>wasm</code> (WebAssembly)
</dt>
<dd>
Targets the WebAssembly platform. New in 1.11 and not as well exercised as other ports.
</dd>
</dl>
<p>
@@ -104,7 +98,7 @@ goroutines, such as stacks that grow and shrink on demand.
<p>
The compilers can target the DragonFly BSD, FreeBSD, Linux, NetBSD, OpenBSD,
macOS (Darwin), Plan 9, Solaris and Windows operating systems.
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>
@@ -125,7 +119,7 @@ Go does not support CentOS 6 on these systems.
<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 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>$GOROOT_BOOTSTRAP</code>.
If unset, the default value of <code>GOROOT_BOOTSTRAP</code>
@@ -133,49 +127,30 @@ is <code>$HOME/go1.4</code>.
</p>
<p>
There are many options for the bootstrap toolchain.
There are many options for the bootstrap tool chain.
After obtaining one, set <code>GOROOT_BOOTSTRAP</code> to the
directory containing the unpacked tree.
For example, <code>$GOROOT_BOOTSTRAP/bin/go</code> should be
the <code>go</code> command binary for the bootstrap toolchain.
the <code>go</code> command binary for the bootstrap tool chain.
</p>
<h3 id="bootstrapFromBinaryRelease">Bootstrap toolchain from binary release</h3>
<p>
To use a binary release as a bootstrap toolchain, see
To use a binary release as a bootstrap tool chain, 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
To build a bootstrap tool chain 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>,
<a href="https://storage.googleapis.com/golang/go1.4-bootstrap-20161024.tar.gz">go1.4-bootstrap-20161024.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>).
(Go 1.4 was the last distribution in which the tool chain was written in C.)
</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.
</p>
<h3 id="bootstrapFromCrosscompiledSource">Bootstrap toolchain from cross-compiled source</h3>
<p>
To cross-compile a bootstrap toolchain from source, which is
To cross-compile a bootstrap tool chain 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>.
@@ -196,8 +171,6 @@ 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
@@ -220,7 +193,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>
@@ -241,14 +214,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.4</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>&lt;tag&gt;</i></span>
</pre>
@@ -256,18 +230,6 @@ $ git checkout <span class="versionTag"><i>&lt;tag&gt;</i></span>
Where <code>&lt;tag&gt;</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>
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>&lt;tag&gt;</code>), because you must keep your
go1.4 repository distinct.
<h2 id="head">(Optional) Switch to the master branch</h2>
<p>If you intend to modify the go source code, and
@@ -341,7 +303,7 @@ package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
fmt.Printf("hello, world\n")
}
</pre>
@@ -383,7 +345,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>
@@ -400,11 +370,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
@@ -426,7 +406,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.4</code>.
</p>
<p>
@@ -462,7 +442,6 @@ 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>
@@ -473,93 +452,33 @@ If you want to build the Go tree in one location
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 10.11 and above and iOS),
<code>dragonfly</code>, <code>freebsd</code>, <code>illumos</code>, <code>js</code>,
<code>darwin</code> (Mac OS X 10.8 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).
<code>mipsle</code> (MIPS 32-bit, little-endian), and <code>mips</code> (MIPS 32-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>
</tr>
<tr>
<td></td><td><code>darwin</code></td> <td><code>386</code></td>
</tr>
<tr>
@@ -584,12 +503,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>
@@ -620,9 +533,6 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
<td></td><td><code>linux</code></td> <td><code>mips64le</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>
@@ -641,18 +551,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>
@@ -670,7 +574,6 @@ 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
@@ -680,6 +583,16 @@ 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>
@@ -688,10 +601,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)
@@ -700,9 +612,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
@@ -711,36 +623,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>
@@ -763,6 +645,7 @@ something like this:
</p>
<pre>
export GOROOT=$HOME/go1.X
export GOARCH=amd64
export GOOS=linux
</pre>

View File

@@ -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.10 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.10 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>&#8224;</sup> that comes with Xcode<sup>&#8225;</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>&#8224;</sup>.<br>No need for cygwin or msys.</td></tr>
<tr><td>FreeBSD 8-STABLE or later</td> <td>amd64, 386</td> <td>Debian GNU/kFreeBSD not supported</td></tr>
<tr><td>Linux 2.6.23 or later with glibc</td> <td>amd64, 386, arm, s390x, ppc64le</td> <td>CentOS/RHEL 5.x not supported</td></tr>
<tr><td>Mac OS X 10.8 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>&#8224;</sup> that comes with Xcode<sup>&#8225;</sup> for <code>cgo</code> support</td></tr>
<tr><td>Windows XP or later</td> <td>amd64, 386</td> <td>use MinGW gcc<sup>&#8224;</sup>. No need for cygwin or msys.</td></tr>
</table>
<p>
<sup>&#8224;</sup>A C compiler is required only if you plan to use
<a href="/cmd/cgo">cgo</a>.<br/>
<sup>&#8225;</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
commands like the following to <code>$HOME/.profile</code>:
</p>
<pre>
export GOROOT=$HOME/go1.X
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>
@@ -200,11 +222,12 @@ and building a simple program, as follows.
Create your <a href="code.html#Workspaces">workspace</a> directory,
<code class="testUnix">$HOME/go</code><code class="testWindows">%USERPROFILE%\go</code>.
(If you'd like to use a different directory,
you will need to <a href="https://golang.org/wiki/SettingGOPATH">set the <code>GOPATH</code> environment variable</a>.)
you will need to set the <code>GOPATH</code> environment variable;
see <a href="code.html#Workspaces">How to Write Go Code</a> for details.)
</p>
<p>
Next, make the directory <code class="testUnix">src/hello</code><code class="testWindows">src\hello</code> inside your workspace,
Next, make the directory <code>src/hello</code> inside your workspace,
and in that directory create a file named <code>hello.go</code> that looks like:
</p>
@@ -214,7 +237,7 @@ package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
fmt.Printf("hello, world\n")
}
</pre>
@@ -227,7 +250,7 @@ $ <b>cd $HOME/go/src/hello</b>
$ <b>go build</b>
</pre>
<pre class="testWindows">
<pre class="testWindows" style="display: none">
C:\&gt; <b>cd %USERPROFILE%\go\src\hello</b>
C:\Users\Gopher\go\src\hello&gt; <b>go build</b>
</pre>
@@ -244,7 +267,7 @@ $ <b>./hello</b>
hello, world
</pre>
<pre class="testWindows">
<pre class="testWindows" style="display: none">
C:\Users\Gopher\go\src\hello&gt; <b>hello</b>
hello, world
</pre>
@@ -256,7 +279,7 @@ If you see the "hello, world" message then your Go installation is working.
<p>
You can run <code>go</code> <code>install</code> to install the binary into
your workspace's <code>bin</code> directory
or <code>go</code> <code>clean</code> <code>-i</code> to remove it.
or <code>go</code> <code>clean</code> to remove it.
</p>
<p>
@@ -266,45 +289,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>
@@ -313,7 +303,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>.

View File

@@ -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 += " "
}

View File

@@ -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)
}
}

View File

@@ -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)
}
}

View File

@@ -219,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")
}
}

View File

@@ -6,9 +6,7 @@
<div class="left">
<div id="learn">
{{if not $.GoogleCN}}
<a class="popout share">Pop-out</a>
{{end}}
<div class="rootHeading">Try Go</div>
<div class="input">
<textarea spellcheck="false" class="code">// You can edit this code!
@@ -28,10 +26,10 @@ Hello, 世界
</div>
<div class="buttons">
<a class="run" href="#" title="Run this code [shift-enter]">Run</a>
{{if not $.GoogleCN}}
{{if $.Share}}
<a class="share" href="#" title="Share this code">Share</a>
<a class="tour" href="//tour.golang.org/" title="Learn Go from your browser">Tour</a>
{{end}}
<a class="tour" href="//tour.golang.org/" title="Learn Go from your browser">Tour</a>
</div>
<div class="toys">
<select>
@@ -58,11 +56,11 @@ simple, reliable, and efficient software.
<div id="gopher"></div>
<a href="/dl/" id="start">
<a href="https://golang.org/dl/" id="start">
<span class="big">Download Go</span>
<span class="desc">
Binary distributions available for<br>
Linux, macOS, Windows, and more.
Linux, Mac OS X, Windows, and more.
</span>
</a>
@@ -70,95 +68,85 @@ Linux, macOS, Windows, and more.
<div style="clear: both"></div>
{{if not $.GoogleCN}}
<div class="left">
<div id="video">
<div class="rootHeading">Featured video</div>
<div class="js-frontpage-video" style="--aspect-ratio-padding: 58.07%;"><iframe width="415" height="241" src="//www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe></div>
</div>
<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 id="blog">
<div class="rootHeading">Featured articles</div>
<div class="read"><a href="//blog.golang.org/">Read more</a></div>
</div>
</div>
{{end}}
<div style="clear: both;"></div>
<script>
(function() {
'use strict';
<script type="text/javascript">
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()
}
});
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();
}
{{if not $.GoogleCN}}
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);
}
}
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();
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()
}
window.feedLoaded = function(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);
}
}
// Load blog feed.
$('<script/>').attr('text', 'text/javascript')
.attr('src', '//blog.golang.org/.json?jsonp=feedLoaded')
.appendTo('body');
window.initFuncs.push(function() {
// 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);
});
// 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);
// Compute the aspect ratio (as a percentage) of the video
// using the fixed width 415 and the height of the current video, v.h.
var ar = 100*v.h/415;
$('.js-frontpage-video').attr('style', '--aspect-ratio-padding: ' + ar + '%;');
});
{{end}}
})();
</script>

View File

@@ -20,7 +20,7 @@ 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.
For critical problems, you can encrypt your report using our PGP key (listed below).
If you would like, you can encrypt your report using our PGP key (listed below).
</p>
<p>
@@ -38,7 +38,7 @@ security team directly:
</p>
<ul>
<li>Primary security coordinator: <a href="mailto:filippo@golang.org">Filippo Valsorda</a> (<a href="https://keybase.io/filippo/pgp_keys.asc">public key</a>).</li>
<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>
@@ -70,7 +70,7 @@ This person coordinates the fix and release process.</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="https://oss-security.openwall.org/wiki/mailing-lists/distros">oss-distros</a>.</li>
<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
@@ -118,12 +118,6 @@ If you have any suggestions to improve this policy, please send an email to
<h3>PGP Key for <a href="mailto:security@golang.org">security@golang.org</a></h3>
<p>
We accept PGP-encrypted email, but the majority of the security team
are not regular PGP users so it's somewhat inconvenient. Please only
use PGP for critical security reports.
</p>
<pre>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org

View File

@@ -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

View File

@@ -5,33 +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=2019b
DATA=2019b
CODE=2016j
DATA=2016j
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 ../..
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.

Binary file not shown.

View File

@@ -6,20 +6,6 @@ mobile subrepository:
https://github.com/golang/mobile
To run the standard library tests, enable Cgo and use an appropriate
C compiler from the Android NDK. For example,
CGO_ENABLED=1 \
GOOS=android \
GOARCH=arm64 \
CC_FOR_TARGET=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang \
./all.bash
To run tests on the Android device, add the bin directory to PATH so the
go tool can find the go_android_$GOARCH_exec wrapper generated by
make.bash. For example, to run the go1 benchmarks
export PATH=$GOROOT/bin:$PATH
cd $GOROOT/test/bench/go1/
GOOS=android GOARCH=arm64 go test -bench=. -count=N -timeout=T
To run the standard library tests, see androidtest.bash. Run it as
CC_FOR_TARGET=.../ndk-gcc GOARCH=arm GOARM=7 ./androidtest.bash

39
misc/android/cleaner.go Normal file
View File

@@ -0,0 +1,39 @@
// Copyright 2015 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.
// Cleaner removes anything from /data/local/tmp/goroot not on a builtin list.
// Used by androidtest.bash.
package main
import (
"log"
"os"
"path/filepath"
"strings"
)
func main() {
const goroot = "/data/local/tmp/goroot"
expect := make(map[string]bool)
for _, f := range strings.Split(files, "\n") {
expect[filepath.Join(goroot, f)] = true
}
err := filepath.Walk(goroot, func(path string, info os.FileInfo, err error) error {
if expect[path] {
return nil
}
log.Printf("removing %s", path)
if err := os.RemoveAll(path); err != nil {
return err
}
if info.IsDir() {
return filepath.SkipDir
}
return nil
})
if err != nil {
log.Fatal(err)
}
}

View File

@@ -2,340 +2,131 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
// This program can be used as go_android_GOARCH_exec by the Go tool.
// It executes binaries on an android device using adb.
package main
import (
"bytes"
"errors"
"fmt"
"go/build"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
"os/signal"
"path/filepath"
"runtime"
"strconv"
"strings"
"syscall"
)
func run(args ...string) (string, error) {
cmd := adbCmd(args...)
func run(args ...string) string {
buf := new(bytes.Buffer)
cmd := exec.Command("adb", args...)
cmd.Stdout = io.MultiWriter(os.Stdout, buf)
// If the adb subprocess somehow hangs, go test will kill this wrapper
// and wait for our os.Stderr (and os.Stdout) to close as a result.
// However, if the os.Stderr (or os.Stdout) file descriptors are
// passed on, the hanging adb subprocess will hold them open and
// go test will hang forever.
//
// Avoid that by wrapping stderr, breaking the short circuit and
// forcing cmd.Run to use another pipe and goroutine to pass
// along stderr from adb.
cmd.Stderr = struct{ io.Writer }{os.Stderr}
cmd.Stderr = os.Stderr
log.Printf("adb %s", strings.Join(args, " "))
err := cmd.Run()
if err != nil {
return "", fmt.Errorf("adb %s: %v", strings.Join(args, " "), err)
log.Fatalf("adb %s: %v", strings.Join(args, " "), err)
}
return buf.String(), nil
}
func adb(args ...string) error {
if out, err := adbCmd(args...).CombinedOutput(); err != nil {
fmt.Fprintf(os.Stderr, "adb %s\n%s", strings.Join(args, " "), out)
return err
}
return nil
}
func adbCmd(args ...string) *exec.Cmd {
if flags := os.Getenv("GOANDROID_ADB_FLAGS"); flags != "" {
args = append(strings.Split(flags, " "), args...)
}
return exec.Command("adb", args...)
return buf.String()
}
const (
deviceRoot = "/data/local/tmp/go_android_exec"
deviceGoroot = deviceRoot + "/goroot"
// Directory structure on the target device androidtest.bash assumes.
deviceGoroot = "/data/local/tmp/goroot"
deviceGopath = "/data/local/tmp/gopath"
)
func main() {
log.SetFlags(0)
log.SetPrefix("go_android_exec: ")
exitCode, err := runMain()
if err != nil {
log.Fatal(err)
}
os.Exit(exitCode)
}
func runMain() (int, error) {
// Concurrent use of adb is flaky, so serialize adb commands.
// See https://github.com/golang/go/issues/23795 or
// https://issuetracker.google.com/issues/73230216.
lockPath := filepath.Join(os.TempDir(), "go_android_exec-adb-lock")
lock, err := os.OpenFile(lockPath, os.O_CREATE|os.O_RDWR, 0666)
if err != nil {
return 0, err
}
defer lock.Close()
if err := syscall.Flock(int(lock.Fd()), syscall.LOCK_EX); err != nil {
return 0, err
}
// In case we're booting a device or emulator alongside all.bash, wait for
// it to be ready. adb wait-for-device is not enough, we have to
// wait for sys.boot_completed.
if err := adb("wait-for-device", "exec-out", "while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;"); err != nil {
return 0, err
}
// Done once per make.bash.
if err := adbCopyGoroot(); err != nil {
return 0, err
}
// Prepare a temporary directory that will be cleaned up at the end.
// Binary names can conflict.
// E.g. template.test from the {html,text}/template packages.
binName := filepath.Base(os.Args[1])
deviceGotmp := fmt.Sprintf(deviceRoot+"/%s-%d", binName, os.Getpid())
deviceGopath := deviceGotmp + "/gopath"
defer adb("exec-out", "rm", "-rf", deviceGotmp) // Clean up.
deviceGotmp := fmt.Sprintf("/data/local/tmp/%s-%d",
filepath.Base(os.Args[1]), os.Getpid())
run("shell", "mkdir", "-p", deviceGotmp)
// Determine the package by examining the current working
// directory, which will look something like
// "$GOROOT/src/mime/multipart" or "$GOPATH/src/golang.org/x/mobile".
// We extract everything after the $GOROOT or $GOPATH to run on the
// same relative directory on the target device.
subdir, inGoRoot, err := subdir()
if err != nil {
return 0, err
}
deviceCwd := filepath.Join(deviceGopath, subdir)
if inGoRoot {
deviceCwd = filepath.Join(deviceGoroot, subdir)
} else {
if err := adb("exec-out", "mkdir", "-p", deviceCwd); err != nil {
return 0, err
}
if err := adbCopyTree(deviceCwd, subdir); err != nil {
return 0, err
}
// Copy .go files from the package.
goFiles, err := filepath.Glob("*.go")
if err != nil {
return 0, err
}
if len(goFiles) > 0 {
args := append(append([]string{"push"}, goFiles...), deviceCwd)
if err := adb(args...); err != nil {
return 0, err
}
}
subdir, inGoRoot := subdir()
deviceCwd := filepath.Join(deviceGoroot, subdir)
if !inGoRoot {
deviceCwd = filepath.Join(deviceGopath, subdir)
}
deviceBin := fmt.Sprintf("%s/%s", deviceGotmp, binName)
if err := adb("push", os.Args[1], deviceBin); err != nil {
return 0, err
}
// Binary names can conflict.
// E.g. template.test from the {html,text}/template packages.
binName := filepath.Base(os.Args[1])
deviceBin := fmt.Sprintf("%s/%s-%d", deviceGotmp, binName, os.Getpid())
// Forward SIGQUIT from the go command to show backtraces from
// the binary instead of from this wrapper.
quit := make(chan os.Signal, 1)
signal.Notify(quit, syscall.SIGQUIT)
go func() {
for range quit {
// We don't have the PID of the running process; use the
// binary name instead.
adb("exec-out", "killall -QUIT "+binName)
}
}()
// In light of
// The push of the binary happens in parallel with other tests.
// Unfortunately, a simultaneous call to adb shell hold open
// file descriptors, so it is necessary to push then move to
// avoid a "text file busy" error on execution.
// https://code.google.com/p/android/issues/detail?id=65857
run("push", os.Args[1], deviceBin+"-tmp")
run("shell", "cp '"+deviceBin+"-tmp' '"+deviceBin+"'")
run("shell", "rm '"+deviceBin+"-tmp'")
// The adb shell command will return an exit code of 0 regardless
// of the command run. E.g.
// $ adb shell false
// $ echo $?
// 0
// https://code.google.com/p/android/issues/detail?id=3254
// dont trust the exitcode of adb. Instead, append the exitcode to
// the output and parse it from there.
// So we append the exitcode to the output and parse it from there.
const exitstr = "exitcode="
cmd := `export TMPDIR="` + deviceGotmp + `"` +
`; export GOROOT="` + deviceGoroot + `"` +
`; export GOPATH="` + deviceGopath + `"` +
`; export CGO_ENABLED=0` +
`; export GOPROXY=` + os.Getenv("GOPROXY") +
`; export GOCACHE="` + deviceRoot + `/gocache"` +
`; export PATH=$PATH:"` + deviceGoroot + `/bin"` +
`; cd "` + deviceCwd + `"` +
"; '" + deviceBin + "' " + strings.Join(os.Args[2:], " ") +
"; echo -n " + exitstr + "$?"
output, err := run("exec-out", cmd)
signal.Reset(syscall.SIGQUIT)
close(quit)
if err != nil {
return 0, err
}
output := run("shell", cmd)
run("shell", "rm", "-rf", deviceGotmp) // Clean up.
exitIdx := strings.LastIndex(output, exitstr)
if exitIdx == -1 {
return 0, fmt.Errorf("no exit code: %q", output)
log.Fatalf("no exit code: %q", output)
}
code, err := strconv.Atoi(output[exitIdx+len(exitstr):])
if err != nil {
return 0, fmt.Errorf("bad exit code: %v", err)
log.Fatalf("bad exit code: %v", err)
}
return code, nil
os.Exit(code)
}
// subdir determines the package based on the current working directory,
// and returns the path to the package source relative to $GOROOT (or $GOPATH).
func subdir() (pkgpath string, underGoRoot bool, err error) {
func subdir() (pkgpath string, underGoRoot bool) {
cwd, err := os.Getwd()
if err != nil {
return "", false, err
log.Fatal(err)
}
cwd, err = filepath.EvalSymlinks(cwd)
if err != nil {
return "", false, err
}
goroot, err := filepath.EvalSymlinks(runtime.GOROOT())
if err != nil {
return "", false, err
}
if subdir, err := filepath.Rel(goroot, cwd); err == nil {
if !strings.Contains(subdir, "..") {
return subdir, true, nil
if root := runtime.GOROOT(); strings.HasPrefix(cwd, root) {
subdir, err := filepath.Rel(root, cwd)
if err != nil {
log.Fatal(err)
}
return subdir, true
}
for _, p := range filepath.SplitList(build.Default.GOPATH) {
pabs, err := filepath.EvalSymlinks(p)
if err != nil {
return "", false, err
if !strings.HasPrefix(cwd, p) {
continue
}
if subdir, err := filepath.Rel(pabs, cwd); err == nil {
if !strings.Contains(subdir, "..") {
return subdir, false, nil
}
subdir, err := filepath.Rel(p, cwd)
if err == nil {
return subdir, false
}
}
return "", false, fmt.Errorf("the current path %q is not in either GOROOT(%q) or GOPATH(%q)",
log.Fatalf("the current path %q is not in either GOROOT(%q) or GOPATH(%q)",
cwd, runtime.GOROOT(), build.Default.GOPATH)
}
// adbCopyTree copies testdata, go.mod, go.sum files from subdir
// and from parent directories all the way up to the root of subdir.
// go.mod and go.sum files are needed for the go tool modules queries,
// and the testdata directories for tests. It is common for tests to
// reach out into testdata from parent packages.
func adbCopyTree(deviceCwd, subdir string) error {
dir := ""
for {
for _, path := range []string{"testdata", "go.mod", "go.sum"} {
path := filepath.Join(dir, path)
if _, err := os.Stat(path); err != nil {
continue
}
devicePath := filepath.Join(deviceCwd, dir)
if err := adb("exec-out", "mkdir", "-p", devicePath); err != nil {
return err
}
if err := adb("push", path, devicePath); err != nil {
return err
}
}
if subdir == "." {
break
}
subdir = filepath.Dir(subdir)
dir = filepath.Join(dir, "..")
}
return nil
}
// adbCopyGoroot clears deviceRoot for previous versions of GOROOT, GOPATH
// and temporary data. Then, it copies relevant parts of GOROOT to the device,
// including the go tool built for android.
// A lock file ensures this only happens once, even with concurrent exec
// wrappers.
func adbCopyGoroot() error {
// Also known by cmd/dist. The bootstrap command deletes the file.
statPath := filepath.Join(os.TempDir(), "go_android_exec-adb-sync-status")
stat, err := os.OpenFile(statPath, os.O_CREATE|os.O_RDWR, 0666)
if err != nil {
return err
}
defer stat.Close()
// Serialize check and copying.
if err := syscall.Flock(int(stat.Fd()), syscall.LOCK_EX); err != nil {
return err
}
s, err := ioutil.ReadAll(stat)
if err != nil {
return err
}
if string(s) == "done" {
return nil
}
// Delete GOROOT, GOPATH and any leftover test data.
if err := adb("exec-out", "rm", "-rf", deviceRoot); err != nil {
return err
}
deviceBin := filepath.Join(deviceGoroot, "bin")
if err := adb("exec-out", "mkdir", "-p", deviceBin); err != nil {
return err
}
goroot := runtime.GOROOT()
// Build go for android.
goCmd := filepath.Join(goroot, "bin", "go")
tmpGo, err := ioutil.TempFile("", "go_android_exec-cmd-go-*")
if err != nil {
return err
}
tmpGo.Close()
defer os.Remove(tmpGo.Name())
if out, err := exec.Command(goCmd, "build", "-o", tmpGo.Name(), "cmd/go").CombinedOutput(); err != nil {
return fmt.Errorf("failed to build go tool for device: %s\n%v", out, err)
}
deviceGo := filepath.Join(deviceBin, "go")
if err := adb("push", tmpGo.Name(), deviceGo); err != nil {
return err
}
for _, dir := range []string{"src", "test", "lib", "api"} {
if err := adb("push", filepath.Join(goroot, dir), filepath.Join(deviceGoroot)); err != nil {
return err
}
}
// Copy only the relevant from pkg.
if err := adb("exec-out", "mkdir", "-p", filepath.Join(deviceGoroot, "pkg", "tool")); err != nil {
return err
}
if err := adb("push", filepath.Join(goroot, "pkg", "include"), filepath.Join(deviceGoroot, "pkg")); err != nil {
return err
}
runtimea, err := exec.Command(goCmd, "list", "-f", "{{.Target}}", "runtime").Output()
pkgdir := filepath.Dir(string(runtimea))
if pkgdir == "" {
return errors.New("could not find android pkg dir")
}
if err := adb("push", pkgdir, filepath.Join(deviceGoroot, "pkg")); err != nil {
return err
}
tooldir := filepath.Join(goroot, "pkg", "tool", filepath.Base(pkgdir))
if err := adb("push", tooldir, filepath.Join(deviceGoroot, "pkg", "tool")); err != nil {
return err
}
if _, err := stat.Write([]byte("done")); err != nil {
return err
}
return nil
return "", false
}

18
misc/cgo/errors/err1.go Normal file
View File

@@ -0,0 +1,18 @@
// 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.
package main
/*
#cgo LDFLAGS: -c
void test() {
xxx; // ERROR HERE
}
*/
import "C"
func main() {
C.test()
}

13
misc/cgo/errors/err2.go Normal file
View File

@@ -0,0 +1,13 @@
// 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.
package main
import "C"
func main() {
s := ""
_ = s
C.malloc(s) // ERROR HERE
}

18
misc/cgo/errors/err3.go Normal file
View File

@@ -0,0 +1,18 @@
// Copyright 2014 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
/*
typedef struct foo foo_t;
typedef struct bar bar_t;
foo_t *foop;
*/
import "C"
func main() {
x := (*C.bar_t)(nil)
C.foop = x // ERROR HERE
}

View File

@@ -1,158 +0,0 @@
// Copyright 2017 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 errorstest
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"regexp"
"strconv"
"strings"
"testing"
)
func path(file string) string {
return filepath.Join("testdata", file)
}
func check(t *testing.T, file string) {
t.Run(file, func(t *testing.T) {
t.Parallel()
contents, err := ioutil.ReadFile(path(file))
if err != nil {
t.Fatal(err)
}
var errors []*regexp.Regexp
for i, line := range bytes.Split(contents, []byte("\n")) {
if bytes.HasSuffix(line, []byte("ERROR HERE")) {
re := regexp.MustCompile(regexp.QuoteMeta(fmt.Sprintf("%s:%d:", file, i+1)))
errors = append(errors, re)
continue
}
frags := bytes.SplitAfterN(line, []byte("ERROR HERE: "), 2)
if len(frags) == 1 {
continue
}
re, err := regexp.Compile(string(frags[1]))
if err != nil {
t.Errorf("Invalid regexp after `ERROR HERE: `: %#q", frags[1])
continue
}
errors = append(errors, re)
}
if len(errors) == 0 {
t.Fatalf("cannot find ERROR HERE")
}
expect(t, file, errors)
})
}
func expect(t *testing.T, file string, errors []*regexp.Regexp) {
dir, err := ioutil.TempDir("", filepath.Base(t.Name()))
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(dir)
dst := filepath.Join(dir, strings.TrimSuffix(file, ".go"))
cmd := exec.Command("go", "build", "-gcflags=-L -e", "-o="+dst, path(file)) // TODO(gri) no need for -gcflags=-L if go tool is adjusted
out, err := cmd.CombinedOutput()
if err == nil {
t.Errorf("expected cgo to fail but it succeeded")
}
lines := bytes.Split(out, []byte("\n"))
for _, re := range errors {
found := false
for _, line := range lines {
if re.Match(line) {
t.Logf("found match for %#q: %q", re, line)
found = true
break
}
}
if !found {
t.Errorf("expected error output to contain %#q", re)
}
}
if t.Failed() {
t.Logf("actual output:\n%s", out)
}
}
func sizeofLongDouble(t *testing.T) int {
cmd := exec.Command("go", "run", path("long_double_size.go"))
out, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("%#q: %v:\n%s", strings.Join(cmd.Args, " "), err, out)
}
i, err := strconv.Atoi(strings.TrimSpace(string(out)))
if err != nil {
t.Fatalf("long_double_size.go printed invalid size: %s", out)
}
return i
}
func TestReportsTypeErrors(t *testing.T) {
for _, file := range []string{
"err1.go",
"err2.go",
"issue11097a.go",
"issue11097b.go",
"issue18452.go",
"issue18889.go",
"issue28721.go",
"issue33061.go",
} {
check(t, file)
}
if sizeofLongDouble(t) > 8 {
for _, file := range []string{
"err4.go",
"issue28069.go",
} {
check(t, file)
}
}
}
func TestToleratesOptimizationFlag(t *testing.T) {
for _, cflags := range []string{
"",
"-O",
} {
cflags := cflags
t.Run(cflags, func(t *testing.T) {
t.Parallel()
cmd := exec.Command("go", "build", path("issue14669.go"))
cmd.Env = append(os.Environ(), "CGO_CFLAGS="+cflags)
out, err := cmd.CombinedOutput()
if err != nil {
t.Errorf("%#q: %v:\n%s", strings.Join(cmd.Args, " "), err, out)
}
})
}
}
func TestMallocCrashesOnNil(t *testing.T) {
t.Parallel()
cmd := exec.Command("go", "run", path("malloc.go"))
out, err := cmd.CombinedOutput()
if err == nil {
t.Logf("%#q:\n%s", strings.Join(cmd.Args, " "), out)
t.Fatalf("succeeded unexpectedly")
}
}

View File

@@ -0,0 +1,14 @@
// Copyright 2015 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.
// issue 13129: used to output error about C.unsignedshort with CC=clang
package main
import "C"
func main() {
var x C.ushort
x = int(0) // ERROR HERE
}

View File

@@ -0,0 +1,12 @@
// Copyright 2015 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
// #include <stdio.h>
import "C"
func main() {
_ = C.fopen() // ERROR HERE
}

View File

@@ -0,0 +1,24 @@
// Copyright 2015 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.
// issue 13635: used to output error about C.unsignedchar.
// This test tests all such types.
package pkg
import "C"
func main() {
var (
_ C.uchar = "uc" // ERROR HERE
_ C.schar = "sc" // ERROR HERE
_ C.ushort = "us" // ERROR HERE
_ C.uint = "ui" // ERROR HERE
_ C.ulong = "ul" // ERROR HERE
_ C.longlong = "ll" // ERROR HERE
_ C.ulonglong = "ull" // ERROR HERE
_ C.complexfloat = "cf" // ERROR HERE
_ C.complexdouble = "cd" // ERROR HERE
)
}

View File

@@ -0,0 +1,26 @@
// Copyright 2016 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.
// cgo converts C void* to Go unsafe.Pointer, so despite appearances C
// void** is Go *unsafe.Pointer. This test verifies that we detect the
// problem at build time.
package main
// typedef void v;
// void F(v** p) {}
import "C"
import "unsafe"
type v [0]byte
func f(p **v) {
C.F((**C.v)(unsafe.Pointer(p))) // ERROR HERE
}
func main() {
var p *v
f(&p)
}

View File

@@ -0,0 +1,12 @@
// Copyright 2016 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
// void f(void *p, int x) {}
import "C"
func main() {
_ = C.f(1) // ERROR HERE
}

View File

@@ -0,0 +1,17 @@
// Copyright 2016 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.
// Issue 16591: Test that we detect an invalid call that was being
// hidden by a type conversion inserted by cgo checking.
package p
// void f(int** p) { }
import "C"
type x *C.int
func F(p *x) {
C.f(p) // ERROR HERE
}

View File

@@ -0,0 +1,14 @@
// Copyright 2014 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
/*
void foo() {}
*/
import "C"
func main() {
C.foo = C.foo // ERROR HERE
}

View File

@@ -0,0 +1,17 @@
// Copyright 2014 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
// Issue 8442. Cgo output unhelpful error messages for
// invalid C preambles.
/*
void issue8442foo(UNDEF*); // ERROR HERE
*/
import "C"
func main() {
C.issue8442foo(nil)
}

576
misc/cgo/errors/ptr.go Normal file
View File

@@ -0,0 +1,576 @@
// Copyright 2015 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.
// Tests that cgo detects invalid pointer passing at runtime.
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"sync"
)
// ptrTest is the tests without the boilerplate.
type ptrTest struct {
name string // for reporting
c string // the cgo comment
imports []string // a list of imports
support string // supporting functions
body string // the body of the main function
extra []extra // extra files
fail bool // whether the test should fail
expensive bool // whether the test requires the expensive check
}
type extra struct {
name string
contents string
}
var ptrTests = []ptrTest{
{
// Passing a pointer to a struct that contains a Go pointer.
name: "ptr1",
c: `typedef struct s { int *p; } s; void f(s *ps) {}`,
body: `C.f(&C.s{new(C.int)})`,
fail: true,
},
{
// Passing a pointer to a struct that contains a Go pointer.
name: "ptr2",
c: `typedef struct s { int *p; } s; void f(s *ps) {}`,
body: `p := &C.s{new(C.int)}; C.f(p)`,
fail: true,
},
{
// Passing a pointer to an int field of a Go struct
// that (irrelevantly) contains a Go pointer.
name: "ok1",
c: `struct s { int i; int *p; }; void f(int *p) {}`,
body: `p := &C.struct_s{i: 0, p: new(C.int)}; C.f(&p.i)`,
fail: false,
},
{
// Passing a pointer to a pointer field of a Go struct.
name: "ptr-field",
c: `struct s { int i; int *p; }; void f(int **p) {}`,
body: `p := &C.struct_s{i: 0, p: new(C.int)}; C.f(&p.p)`,
fail: true,
},
{
// Passing a pointer to a pointer field of a Go
// struct, where the field does not contain a Go
// pointer, but another field (irrelevantly) does.
name: "ptr-field-ok",
c: `struct s { int *p1; int *p2; }; void f(int **p) {}`,
body: `p := &C.struct_s{p1: nil, p2: new(C.int)}; C.f(&p.p1)`,
fail: false,
},
{
// Passing the address of a slice with no Go pointers.
name: "slice-ok-1",
c: `void f(void **p) {}`,
imports: []string{"unsafe"},
body: `s := []unsafe.Pointer{nil}; C.f(&s[0])`,
fail: false,
},
{
// Passing the address of a slice with a Go pointer.
name: "slice-ptr-1",
c: `void f(void **p) {}`,
imports: []string{"unsafe"},
body: `i := 0; s := []unsafe.Pointer{unsafe.Pointer(&i)}; C.f(&s[0])`,
fail: true,
},
{
// Passing the address of a slice with a Go pointer,
// where we are passing the address of an element that
// is not a Go pointer.
name: "slice-ptr-2",
c: `void f(void **p) {}`,
imports: []string{"unsafe"},
body: `i := 0; s := []unsafe.Pointer{nil, unsafe.Pointer(&i)}; C.f(&s[0])`,
fail: true,
},
{
// Passing the address of a slice that is an element
// in a struct only looks at the slice.
name: "slice-ok-2",
c: `void f(void **p) {}`,
imports: []string{"unsafe"},
support: `type S struct { p *int; s []unsafe.Pointer }`,
body: `i := 0; p := &S{p:&i, s:[]unsafe.Pointer{nil}}; C.f(&p.s[0])`,
fail: false,
},
{
// Passing the address of a slice of an array that is
// an element in a struct, with a type conversion.
name: "slice-ok-3",
c: `void f(void* p) {}`,
imports: []string{"unsafe"},
support: `type S struct { p *int; a [4]byte }`,
body: `i := 0; p := &S{p:&i}; s := p.a[:]; C.f(unsafe.Pointer(&s[0]))`,
fail: false,
},
{
// Passing the address of a slice of an array that is
// an element in a struct, with a type conversion.
name: "slice-ok-4",
c: `typedef void* PV; void f(PV p) {}`,
imports: []string{"unsafe"},
support: `type S struct { p *int; a [4]byte }`,
body: `i := 0; p := &S{p:&i}; C.f(C.PV(unsafe.Pointer(&p.a[0])))`,
fail: false,
},
{
// Passing the address of a static variable with no
// pointers doesn't matter.
name: "varok",
c: `void f(char** parg) {}`,
support: `var hello = [...]C.char{'h', 'e', 'l', 'l', 'o'}`,
body: `parg := [1]*C.char{&hello[0]}; C.f(&parg[0])`,
fail: false,
},
{
// Passing the address of a static variable with
// pointers does matter.
name: "var",
c: `void f(char*** parg) {}`,
support: `var hello = [...]*C.char{new(C.char)}`,
body: `parg := [1]**C.char{&hello[0]}; C.f(&parg[0])`,
fail: true,
},
{
// Storing a Go pointer into C memory should fail.
name: "barrier",
c: `#include <stdlib.h>
char **f1() { return malloc(sizeof(char*)); }
void f2(char **p) {}`,
body: `p := C.f1(); *p = new(C.char); C.f2(p)`,
fail: true,
expensive: true,
},
{
// Storing a Go pointer into C memory by assigning a
// large value should fail.
name: "barrier-struct",
c: `#include <stdlib.h>
struct s { char *a[10]; };
struct s *f1() { return malloc(sizeof(struct s)); }
void f2(struct s *p) {}`,
body: `p := C.f1(); p.a = [10]*C.char{new(C.char)}; C.f2(p)`,
fail: true,
expensive: true,
},
{
// Storing a Go pointer into C memory using a slice
// copy should fail.
name: "barrier-slice",
c: `#include <stdlib.h>
struct s { char *a[10]; };
struct s *f1() { return malloc(sizeof(struct s)); }
void f2(struct s *p) {}`,
body: `p := C.f1(); copy(p.a[:], []*C.char{new(C.char)}); C.f2(p)`,
fail: true,
expensive: true,
},
{
// A very large value uses a GC program, which is a
// different code path.
name: "barrier-gcprog-array",
c: `#include <stdlib.h>
struct s { char *a[32769]; };
struct s *f1() { return malloc(sizeof(struct s)); }
void f2(struct s *p) {}`,
body: `p := C.f1(); p.a = [32769]*C.char{new(C.char)}; C.f2(p)`,
fail: true,
expensive: true,
},
{
// Similar case, with a source on the heap.
name: "barrier-gcprog-array-heap",
c: `#include <stdlib.h>
struct s { char *a[32769]; };
struct s *f1() { return malloc(sizeof(struct s)); }
void f2(struct s *p) {}
void f3(void *p) {}`,
imports: []string{"unsafe"},
body: `p := C.f1(); n := &[32769]*C.char{new(C.char)}; p.a = *n; C.f2(p); n[0] = nil; C.f3(unsafe.Pointer(n))`,
fail: true,
expensive: true,
},
{
// A GC program with a struct.
name: "barrier-gcprog-struct",
c: `#include <stdlib.h>
struct s { char *a[32769]; };
struct s2 { struct s f; };
struct s2 *f1() { return malloc(sizeof(struct s2)); }
void f2(struct s2 *p) {}`,
body: `p := C.f1(); p.f = C.struct_s{[32769]*C.char{new(C.char)}}; C.f2(p)`,
fail: true,
expensive: true,
},
{
// Similar case, with a source on the heap.
name: "barrier-gcprog-struct-heap",
c: `#include <stdlib.h>
struct s { char *a[32769]; };
struct s2 { struct s f; };
struct s2 *f1() { return malloc(sizeof(struct s2)); }
void f2(struct s2 *p) {}
void f3(void *p) {}`,
imports: []string{"unsafe"},
body: `p := C.f1(); n := &C.struct_s{[32769]*C.char{new(C.char)}}; p.f = *n; C.f2(p); n.a[0] = nil; C.f3(unsafe.Pointer(n))`,
fail: true,
expensive: true,
},
{
// Exported functions may not return Go pointers.
name: "export1",
c: `extern unsigned char *GoFn();`,
support: `//export GoFn
func GoFn() *byte { return new(byte) }`,
body: `C.GoFn()`,
fail: true,
},
{
// Returning a C pointer is fine.
name: "exportok",
c: `#include <stdlib.h>
extern unsigned char *GoFn();`,
support: `//export GoFn
func GoFn() *byte { return (*byte)(C.malloc(1)) }`,
body: `C.GoFn()`,
},
{
// Passing a Go string is fine.
name: "pass-string",
c: `#include <stddef.h>
typedef struct { const char *p; ptrdiff_t n; } gostring;
gostring f(gostring s) { return s; }`,
imports: []string{"unsafe"},
body: `s := "a"; r := C.f(*(*C.gostring)(unsafe.Pointer(&s))); if *(*string)(unsafe.Pointer(&r)) != s { panic(r) }`,
},
{
// Passing a slice of Go strings fails.
name: "pass-string-slice",
c: `void f(void *p) {}`,
imports: []string{"strings", "unsafe"},
support: `type S struct { a [1]string }`,
body: `s := S{a:[1]string{strings.Repeat("a", 2)}}; C.f(unsafe.Pointer(&s.a[0]))`,
fail: true,
},
{
// Exported functions may not return strings.
name: "ret-string",
c: `extern void f();`,
imports: []string{"strings"},
support: `//export GoStr
func GoStr() string { return strings.Repeat("a", 2) }`,
body: `C.f()`,
extra: []extra{
{
"call.c",
`#include <stddef.h>
typedef struct { const char *p; ptrdiff_t n; } gostring;
extern gostring GoStr();
void f() { GoStr(); }`,
},
},
fail: true,
},
{
// Don't check non-pointer data.
// Uses unsafe code to get a pointer we shouldn't check.
// Although we use unsafe, the uintptr represents an integer
// that happens to have the same representation as a pointer;
// that is, we are testing something that is not unsafe.
name: "ptrdata1",
c: `#include <stdlib.h>
void f(void* p) {}`,
imports: []string{"unsafe"},
support: `type S struct { p *int; a [8*8]byte; u uintptr }`,
body: `i := 0; p := &S{u:uintptr(unsafe.Pointer(&i))}; q := (*S)(C.malloc(C.size_t(unsafe.Sizeof(*p)))); *q = *p; C.f(unsafe.Pointer(q))`,
fail: false,
},
{
// Like ptrdata1, but with a type that uses a GC program.
name: "ptrdata2",
c: `#include <stdlib.h>
void f(void* p) {}`,
imports: []string{"unsafe"},
support: `type S struct { p *int; a [32769*8]byte; q *int; u uintptr }`,
body: `i := 0; p := S{u:uintptr(unsafe.Pointer(&i))}; q := (*S)(C.malloc(C.size_t(unsafe.Sizeof(p)))); *q = p; C.f(unsafe.Pointer(q))`,
fail: false,
},
{
// Check deferred pointers when they are used, not
// when the defer statement is run.
name: "defer",
c: `typedef struct s { int *p; } s; void f(s *ps) {}`,
body: `p := &C.s{}; defer C.f(p); p.p = new(C.int)`,
fail: true,
},
{
// Check a pointer to a union if the union has any
// pointer fields.
name: "union1",
c: `typedef union { char **p; unsigned long i; } u; void f(u *pu) {}`,
imports: []string{"unsafe"},
body: `var b C.char; p := &b; C.f((*C.u)(unsafe.Pointer(&p)))`,
fail: true,
},
{
// Don't check a pointer to a union if the union does
// not have any pointer fields.
// Like ptrdata1 above, the uintptr represents an
// integer that happens to have the same
// representation as a pointer.
name: "union2",
c: `typedef union { unsigned long i; } u; void f(u *pu) {}`,
imports: []string{"unsafe"},
body: `var b C.char; p := &b; C.f((*C.u)(unsafe.Pointer(&p)))`,
fail: false,
},
}
func main() {
os.Exit(doTests())
}
func doTests() int {
gopath, err := ioutil.TempDir("", "cgoerrors")
if err != nil {
fmt.Fprintln(os.Stderr, err)
return 2
}
defer os.RemoveAll(gopath)
if err := os.MkdirAll(filepath.Join(gopath, "src"), 0777); err != nil {
fmt.Fprintln(os.Stderr, err)
return 2
}
workers := runtime.NumCPU() + 1
var wg sync.WaitGroup
c := make(chan int)
errs := make(chan int)
for i := 0; i < workers; i++ {
wg.Add(1)
go func() {
worker(gopath, c, errs)
wg.Done()
}()
}
for i := range ptrTests {
c <- i
}
close(c)
go func() {
wg.Wait()
close(errs)
}()
tot := 0
for e := range errs {
tot += e
}
return tot
}
func worker(gopath string, c, errs chan int) {
e := 0
for i := range c {
if !doOne(gopath, i) {
e++
}
}
if e > 0 {
errs <- e
}
}
func doOne(gopath string, i int) bool {
t := &ptrTests[i]
dir := filepath.Join(gopath, "src", fmt.Sprintf("dir%d", i))
if err := os.Mkdir(dir, 0777); err != nil {
fmt.Fprintln(os.Stderr, err)
return false
}
name := filepath.Join(dir, fmt.Sprintf("t%d.go", i))
f, err := os.Create(name)
if err != nil {
fmt.Fprintln(os.Stderr, err)
return false
}
b := bufio.NewWriter(f)
fmt.Fprintln(b, `package main`)
fmt.Fprintln(b)
fmt.Fprintln(b, `/*`)
fmt.Fprintln(b, t.c)
fmt.Fprintln(b, `*/`)
fmt.Fprintln(b, `import "C"`)
fmt.Fprintln(b)
for _, imp := range t.imports {
fmt.Fprintln(b, `import "`+imp+`"`)
}
if len(t.imports) > 0 {
fmt.Fprintln(b)
}
if len(t.support) > 0 {
fmt.Fprintln(b, t.support)
fmt.Fprintln(b)
}
fmt.Fprintln(b, `func main() {`)
fmt.Fprintln(b, t.body)
fmt.Fprintln(b, `}`)
if err := b.Flush(); err != nil {
fmt.Fprintf(os.Stderr, "flushing %s: %v\n", name, err)
return false
}
if err := f.Close(); err != nil {
fmt.Fprintf(os.Stderr, "closing %s: %v\n", name, err)
return false
}
for _, e := range t.extra {
if err := ioutil.WriteFile(filepath.Join(dir, e.name), []byte(e.contents), 0644); err != nil {
fmt.Fprintf(os.Stderr, "writing %s: %v\n", e.name, err)
return false
}
}
ok := true
cmd := exec.Command("go", "build")
cmd.Dir = dir
cmd.Env = addEnv("GOPATH", gopath)
buf, err := cmd.CombinedOutput()
if err != nil {
fmt.Fprintf(os.Stderr, "test %s failed to build: %v\n%s", t.name, err, buf)
return false
}
exe := filepath.Join(dir, filepath.Base(dir))
cmd = exec.Command(exe)
cmd.Dir = dir
if t.expensive {
cmd.Env = cgocheckEnv("1")
buf, err := cmd.CombinedOutput()
if err != nil {
var errbuf bytes.Buffer
if t.fail {
fmt.Fprintf(&errbuf, "test %s marked expensive but failed when not expensive: %v\n", t.name, err)
} else {
fmt.Fprintf(&errbuf, "test %s failed unexpectedly with GODEBUG=cgocheck=1: %v\n", t.name, err)
}
reportTestOutput(&errbuf, t.name, buf)
os.Stderr.Write(errbuf.Bytes())
ok = false
}
cmd = exec.Command(exe)
cmd.Dir = dir
}
if t.expensive {
cmd.Env = cgocheckEnv("2")
}
buf, err = cmd.CombinedOutput()
if t.fail {
if err == nil {
var errbuf bytes.Buffer
fmt.Fprintf(&errbuf, "test %s did not fail as expected\n", t.name)
reportTestOutput(&errbuf, t.name, buf)
os.Stderr.Write(errbuf.Bytes())
ok = false
} else if !bytes.Contains(buf, []byte("Go pointer")) {
var errbuf bytes.Buffer
fmt.Fprintf(&errbuf, "test %s output does not contain expected error (failed with %v)\n", t.name, err)
reportTestOutput(&errbuf, t.name, buf)
os.Stderr.Write(errbuf.Bytes())
ok = false
}
} else {
if err != nil {
var errbuf bytes.Buffer
fmt.Fprintf(&errbuf, "test %s failed unexpectedly: %v\n", t.name, err)
reportTestOutput(&errbuf, t.name, buf)
os.Stderr.Write(errbuf.Bytes())
ok = false
}
if !t.expensive && ok {
// Make sure it passes with the expensive checks.
cmd := exec.Command(exe)
cmd.Dir = dir
cmd.Env = cgocheckEnv("2")
buf, err := cmd.CombinedOutput()
if err != nil {
var errbuf bytes.Buffer
fmt.Fprintf(&errbuf, "test %s failed unexpectedly with expensive checks: %v\n", t.name, err)
reportTestOutput(&errbuf, t.name, buf)
os.Stderr.Write(errbuf.Bytes())
ok = false
}
}
}
if t.fail && ok {
cmd = exec.Command(exe)
cmd.Dir = dir
cmd.Env = cgocheckEnv("0")
buf, err := cmd.CombinedOutput()
if err != nil {
var errbuf bytes.Buffer
fmt.Fprintf(&errbuf, "test %s failed unexpectedly with GODEBUG=cgocheck=0: %v\n", t.name, err)
reportTestOutput(&errbuf, t.name, buf)
os.Stderr.Write(errbuf.Bytes())
ok = false
}
}
return ok
}
func reportTestOutput(w io.Writer, name string, buf []byte) {
fmt.Fprintf(w, "=== test %s output ===\n", name)
fmt.Fprintf(w, "%s", buf)
fmt.Fprintf(w, "=== end of test %s output ===\n", name)
}
func cgocheckEnv(val string) []string {
return addEnv("GODEBUG", "cgocheck="+val)
}
func addEnv(key, val string) []string {
env := []string{key + "=" + val}
look := key + "="
for _, e := range os.Environ() {
if !strings.HasPrefix(e, look) {
env = append(env, e)
}
}
return env
}

View File

@@ -1,633 +0,0 @@
// Copyright 2015 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.
// Tests that cgo detects invalid pointer passing at runtime.
package errorstest
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"sync/atomic"
"testing"
)
var tmp = flag.String("tmp", "", "use `dir` for temporary files and do not clean up")
// ptrTest is the tests without the boilerplate.
type ptrTest struct {
name string // for reporting
c string // the cgo comment
c1 string // cgo comment forced into non-export cgo file
imports []string // a list of imports
support string // supporting functions
body string // the body of the main function
extra []extra // extra files
fail bool // whether the test should fail
expensive bool // whether the test requires the expensive check
}
type extra struct {
name string
contents string
}
var ptrTests = []ptrTest{
{
// Passing a pointer to a struct that contains a Go pointer.
name: "ptr1",
c: `typedef struct s1 { int *p; } s1; void f1(s1 *ps) {}`,
body: `C.f1(&C.s1{new(C.int)})`,
fail: true,
},
{
// Passing a pointer to a struct that contains a Go pointer.
name: "ptr2",
c: `typedef struct s2 { int *p; } s2; void f2(s2 *ps) {}`,
body: `p := &C.s2{new(C.int)}; C.f2(p)`,
fail: true,
},
{
// Passing a pointer to an int field of a Go struct
// that (irrelevantly) contains a Go pointer.
name: "ok1",
c: `struct s3 { int i; int *p; }; void f3(int *p) {}`,
body: `p := &C.struct_s3{i: 0, p: new(C.int)}; C.f3(&p.i)`,
fail: false,
},
{
// Passing a pointer to a pointer field of a Go struct.
name: "ptrfield",
c: `struct s4 { int i; int *p; }; void f4(int **p) {}`,
body: `p := &C.struct_s4{i: 0, p: new(C.int)}; C.f4(&p.p)`,
fail: true,
},
{
// Passing a pointer to a pointer field of a Go
// struct, where the field does not contain a Go
// pointer, but another field (irrelevantly) does.
name: "ptrfieldok",
c: `struct s5 { int *p1; int *p2; }; void f5(int **p) {}`,
body: `p := &C.struct_s5{p1: nil, p2: new(C.int)}; C.f5(&p.p1)`,
fail: false,
},
{
// Passing the address of a slice with no Go pointers.
name: "sliceok1",
c: `void f6(void **p) {}`,
imports: []string{"unsafe"},
body: `s := []unsafe.Pointer{nil}; C.f6(&s[0])`,
fail: false,
},
{
// Passing the address of a slice with a Go pointer.
name: "sliceptr1",
c: `void f7(void **p) {}`,
imports: []string{"unsafe"},
body: `i := 0; s := []unsafe.Pointer{unsafe.Pointer(&i)}; C.f7(&s[0])`,
fail: true,
},
{
// Passing the address of a slice with a Go pointer,
// where we are passing the address of an element that
// is not a Go pointer.
name: "sliceptr2",
c: `void f8(void **p) {}`,
imports: []string{"unsafe"},
body: `i := 0; s := []unsafe.Pointer{nil, unsafe.Pointer(&i)}; C.f8(&s[0])`,
fail: true,
},
{
// Passing the address of a slice that is an element
// in a struct only looks at the slice.
name: "sliceok2",
c: `void f9(void **p) {}`,
imports: []string{"unsafe"},
support: `type S9 struct { p *int; s []unsafe.Pointer }`,
body: `i := 0; p := &S9{p:&i, s:[]unsafe.Pointer{nil}}; C.f9(&p.s[0])`,
fail: false,
},
{
// Passing the address of a slice of an array that is
// an element in a struct, with a type conversion.
name: "sliceok3",
c: `void f10(void* p) {}`,
imports: []string{"unsafe"},
support: `type S10 struct { p *int; a [4]byte }`,
body: `i := 0; p := &S10{p:&i}; s := p.a[:]; C.f10(unsafe.Pointer(&s[0]))`,
fail: false,
},
{
// Passing the address of a slice of an array that is
// an element in a struct, with a type conversion.
name: "sliceok4",
c: `typedef void* PV11; void f11(PV11 p) {}`,
imports: []string{"unsafe"},
support: `type S11 struct { p *int; a [4]byte }`,
body: `i := 0; p := &S11{p:&i}; C.f11(C.PV11(unsafe.Pointer(&p.a[0])))`,
fail: false,
},
{
// Passing the address of a static variable with no
// pointers doesn't matter.
name: "varok",
c: `void f12(char** parg) {}`,
support: `var hello12 = [...]C.char{'h', 'e', 'l', 'l', 'o'}`,
body: `parg := [1]*C.char{&hello12[0]}; C.f12(&parg[0])`,
fail: false,
},
{
// Passing the address of a static variable with
// pointers does matter.
name: "var1",
c: `void f13(char*** parg) {}`,
support: `var hello13 = [...]*C.char{new(C.char)}`,
body: `parg := [1]**C.char{&hello13[0]}; C.f13(&parg[0])`,
fail: true,
},
{
// Storing a Go pointer into C memory should fail.
name: "barrier",
c: `#include <stdlib.h>
char **f14a() { return malloc(sizeof(char*)); }
void f14b(char **p) {}`,
body: `p := C.f14a(); *p = new(C.char); C.f14b(p)`,
fail: true,
expensive: true,
},
{
// Storing a Go pointer into C memory by assigning a
// large value should fail.
name: "barrierstruct",
c: `#include <stdlib.h>
struct s15 { char *a[10]; };
struct s15 *f15() { return malloc(sizeof(struct s15)); }
void f15b(struct s15 *p) {}`,
body: `p := C.f15(); p.a = [10]*C.char{new(C.char)}; C.f15b(p)`,
fail: true,
expensive: true,
},
{
// Storing a Go pointer into C memory using a slice
// copy should fail.
name: "barrierslice",
c: `#include <stdlib.h>
struct s16 { char *a[10]; };
struct s16 *f16() { return malloc(sizeof(struct s16)); }
void f16b(struct s16 *p) {}`,
body: `p := C.f16(); copy(p.a[:], []*C.char{new(C.char)}); C.f16b(p)`,
fail: true,
expensive: true,
},
{
// A very large value uses a GC program, which is a
// different code path.
name: "barriergcprogarray",
c: `#include <stdlib.h>
struct s17 { char *a[32769]; };
struct s17 *f17() { return malloc(sizeof(struct s17)); }
void f17b(struct s17 *p) {}`,
body: `p := C.f17(); p.a = [32769]*C.char{new(C.char)}; C.f17b(p)`,
fail: true,
expensive: true,
},
{
// Similar case, with a source on the heap.
name: "barriergcprogarrayheap",
c: `#include <stdlib.h>
struct s18 { char *a[32769]; };
struct s18 *f18() { return malloc(sizeof(struct s18)); }
void f18b(struct s18 *p) {}
void f18c(void *p) {}`,
imports: []string{"unsafe"},
body: `p := C.f18(); n := &[32769]*C.char{new(C.char)}; p.a = *n; C.f18b(p); n[0] = nil; C.f18c(unsafe.Pointer(n))`,
fail: true,
expensive: true,
},
{
// A GC program with a struct.
name: "barriergcprogstruct",
c: `#include <stdlib.h>
struct s19a { char *a[32769]; };
struct s19b { struct s19a f; };
struct s19b *f19() { return malloc(sizeof(struct s19b)); }
void f19b(struct s19b *p) {}`,
body: `p := C.f19(); p.f = C.struct_s19a{[32769]*C.char{new(C.char)}}; C.f19b(p)`,
fail: true,
expensive: true,
},
{
// Similar case, with a source on the heap.
name: "barriergcprogstructheap",
c: `#include <stdlib.h>
struct s20a { char *a[32769]; };
struct s20b { struct s20a f; };
struct s20b *f20() { return malloc(sizeof(struct s20b)); }
void f20b(struct s20b *p) {}
void f20c(void *p) {}`,
imports: []string{"unsafe"},
body: `p := C.f20(); n := &C.struct_s20a{[32769]*C.char{new(C.char)}}; p.f = *n; C.f20b(p); n.a[0] = nil; C.f20c(unsafe.Pointer(n))`,
fail: true,
expensive: true,
},
{
// Exported functions may not return Go pointers.
name: "export1",
c: `extern unsigned char *GoFn21();`,
support: `//export GoFn21
func GoFn21() *byte { return new(byte) }`,
body: `C.GoFn21()`,
fail: true,
},
{
// Returning a C pointer is fine.
name: "exportok",
c: `#include <stdlib.h>
extern unsigned char *GoFn22();`,
support: `//export GoFn22
func GoFn22() *byte { return (*byte)(C.malloc(1)) }`,
body: `C.GoFn22()`,
},
{
// Passing a Go string is fine.
name: "passstring",
c: `#include <stddef.h>
typedef struct { const char *p; ptrdiff_t n; } gostring23;
gostring23 f23(gostring23 s) { return s; }`,
imports: []string{"unsafe"},
body: `s := "a"; r := C.f23(*(*C.gostring23)(unsafe.Pointer(&s))); if *(*string)(unsafe.Pointer(&r)) != s { panic(r) }`,
},
{
// Passing a slice of Go strings fails.
name: "passstringslice",
c: `void f24(void *p) {}`,
imports: []string{"strings", "unsafe"},
support: `type S24 struct { a [1]string }`,
body: `s := S24{a:[1]string{strings.Repeat("a", 2)}}; C.f24(unsafe.Pointer(&s.a[0]))`,
fail: true,
},
{
// Exported functions may not return strings.
name: "retstring",
c: `extern void f25();`,
imports: []string{"strings"},
support: `//export GoStr25
func GoStr25() string { return strings.Repeat("a", 2) }`,
body: `C.f25()`,
c1: `#include <stddef.h>
typedef struct { const char *p; ptrdiff_t n; } gostring25;
extern gostring25 GoStr25();
void f25() { GoStr25(); }`,
fail: true,
},
{
// Don't check non-pointer data.
// Uses unsafe code to get a pointer we shouldn't check.
// Although we use unsafe, the uintptr represents an integer
// that happens to have the same representation as a pointer;
// that is, we are testing something that is not unsafe.
name: "ptrdata1",
c: `#include <stdlib.h>
void f26(void* p) {}`,
imports: []string{"unsafe"},
support: `type S26 struct { p *int; a [8*8]byte; u uintptr }`,
body: `i := 0; p := &S26{u:uintptr(unsafe.Pointer(&i))}; q := (*S26)(C.malloc(C.size_t(unsafe.Sizeof(*p)))); *q = *p; C.f26(unsafe.Pointer(q))`,
fail: false,
},
{
// Like ptrdata1, but with a type that uses a GC program.
name: "ptrdata2",
c: `#include <stdlib.h>
void f27(void* p) {}`,
imports: []string{"unsafe"},
support: `type S27 struct { p *int; a [32769*8]byte; q *int; u uintptr }`,
body: `i := 0; p := S27{u:uintptr(unsafe.Pointer(&i))}; q := (*S27)(C.malloc(C.size_t(unsafe.Sizeof(p)))); *q = p; C.f27(unsafe.Pointer(q))`,
fail: false,
},
{
// Check deferred pointers when they are used, not
// when the defer statement is run.
name: "defer1",
c: `typedef struct s28 { int *p; } s28; void f28(s28 *ps) {}`,
body: `p := &C.s28{}; defer C.f28(p); p.p = new(C.int)`,
fail: true,
},
{
// Check a pointer to a union if the union has any
// pointer fields.
name: "union1",
c: `typedef union { char **p; unsigned long i; } u29; void f29(u29 *pu) {}`,
imports: []string{"unsafe"},
body: `var b C.char; p := &b; C.f29((*C.u29)(unsafe.Pointer(&p)))`,
fail: true,
},
{
// Don't check a pointer to a union if the union does
// not have any pointer fields.
// Like ptrdata1 above, the uintptr represents an
// integer that happens to have the same
// representation as a pointer.
name: "union2",
c: `typedef union { unsigned long i; } u39; void f39(u39 *pu) {}`,
imports: []string{"unsafe"},
body: `var b C.char; p := &b; C.f39((*C.u39)(unsafe.Pointer(&p)))`,
fail: false,
},
{
// Test preemption while entering a cgo call. Issue #21306.
name: "preemptduringcall",
c: `void f30() {}`,
imports: []string{"runtime", "sync"},
body: `var wg sync.WaitGroup; wg.Add(100); for i := 0; i < 100; i++ { go func(i int) { for j := 0; j < 100; j++ { C.f30(); runtime.GOMAXPROCS(i) }; wg.Done() }(i) }; wg.Wait()`,
fail: false,
},
{
// Test poller deadline with cgocheck=2. Issue #23435.
name: "deadline",
c: `#define US31 10`,
imports: []string{"os", "time"},
body: `r, _, _ := os.Pipe(); r.SetDeadline(time.Now().Add(C.US31 * time.Microsecond))`,
fail: false,
},
{
// Test for double evaluation of channel receive.
name: "chanrecv",
c: `void f32(char** p) {}`,
imports: []string{"time"},
body: `c := make(chan []*C.char, 2); c <- make([]*C.char, 1); go func() { time.Sleep(10 * time.Second); panic("received twice from chan") }(); C.f32(&(<-c)[0]);`,
fail: false,
},
{
// Test that converting the address of a struct field
// to unsafe.Pointer still just checks that field.
// Issue #25941.
name: "structfield",
c: `void f33(void* p) {}`,
imports: []string{"unsafe"},
support: `type S33 struct { p *int; a [8]byte; u uintptr }`,
body: `s := &S33{p: new(int)}; C.f33(unsafe.Pointer(&s.a))`,
fail: false,
},
{
// Test that converting multiple struct field
// addresses to unsafe.Pointer still just checks those
// fields. Issue #25941.
name: "structfield2",
c: `void f34(void* p, int r, void* s) {}`,
imports: []string{"unsafe"},
support: `type S34 struct { a [8]byte; p *int; b int64; }`,
body: `s := &S34{p: new(int)}; C.f34(unsafe.Pointer(&s.a), 32, unsafe.Pointer(&s.b))`,
fail: false,
},
{
// Test that second argument to cgoCheckPointer is
// evaluated when a deferred function is deferred, not
// when it is run.
name: "defer2",
c: `void f35(char **pc) {}`,
support: `type S35a struct { s []*C.char }; type S35b struct { ps *S35a }`,
body: `p := &S35b{&S35a{[]*C.char{nil}}}; defer C.f35(&p.ps.s[0]); p.ps = nil`,
fail: false,
},
{
// Test that indexing into a function call still
// examines only the slice being indexed.
name: "buffer",
c: `void f36(void *p) {}`,
imports: []string{"bytes", "unsafe"},
body: `var b bytes.Buffer; b.WriteString("a"); C.f36(unsafe.Pointer(&b.Bytes()[0]))`,
fail: false,
},
{
// Test that bgsweep releasing a finalizer is OK.
name: "finalizer",
c: `// Nothing to declare.`,
imports: []string{"os"},
support: `func open37() { os.Open(os.Args[0]) }; var G37 [][]byte`,
body: `for i := 0; i < 10000; i++ { G37 = append(G37, make([]byte, 4096)); if i % 100 == 0 { G37 = nil; open37() } }`,
fail: false,
},
{
// Test that converting generated struct to interface is OK.
name: "structof",
c: `// Nothing to declare.`,
imports: []string{"reflect"},
support: `type MyInt38 int; func (i MyInt38) Get() int { return int(i) }; type Getter38 interface { Get() int }`,
body: `t := reflect.StructOf([]reflect.StructField{{Name: "MyInt38", Type: reflect.TypeOf(MyInt38(0)), Anonymous: true}}); v := reflect.New(t).Elem(); v.Interface().(Getter38).Get()`,
fail: false,
},
{
// Test that a converted address of a struct field results
// in a check for just that field and not the whole struct.
name: "structfieldcast",
c: `struct S40i { int i; int* p; }; void f40(struct S40i* p) {}`,
support: `type S40 struct { p *int; a C.struct_S40i }`,
body: `s := &S40{p: new(int)}; C.f40((*C.struct_S40i)(&s.a))`,
fail: false,
},
}
func TestPointerChecks(t *testing.T) {
dir, exe := buildPtrTests(t)
// We (TestPointerChecks) return before the parallel subtest functions do,
// so we can't just defer os.RemoveAll(dir). Instead we have to wait for
// the parallel subtests to finish. This code looks racy but is not:
// the add +1 run in serial before testOne blocks. The -1 run in parallel
// after testOne finishes.
var pending int32
for _, pt := range ptrTests {
pt := pt
t.Run(pt.name, func(t *testing.T) {
atomic.AddInt32(&pending, +1)
defer func() {
if atomic.AddInt32(&pending, -1) == 0 {
os.RemoveAll(dir)
}
}()
testOne(t, pt, exe)
})
}
}
func buildPtrTests(t *testing.T) (dir, exe string) {
var gopath string
if *tmp != "" {
gopath = *tmp
dir = ""
} else {
d, err := ioutil.TempDir("", filepath.Base(t.Name()))
if err != nil {
t.Fatal(err)
}
dir = d
gopath = d
}
src := filepath.Join(gopath, "src", "ptrtest")
if err := os.MkdirAll(src, 0777); err != nil {
t.Fatal(err)
}
if err := ioutil.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest"), 0666); err != nil {
t.Fatal(err)
}
// Prepare two cgo inputs: one for standard cgo and one for //export cgo.
// (The latter cannot have C definitions, only declarations.)
var cgo1, cgo2 bytes.Buffer
fmt.Fprintf(&cgo1, "package main\n\n/*\n")
fmt.Fprintf(&cgo2, "package main\n\n/*\n")
// C code
for _, pt := range ptrTests {
cgo := &cgo1
if strings.Contains(pt.support, "//export") {
cgo = &cgo2
}
fmt.Fprintf(cgo, "%s\n", pt.c)
fmt.Fprintf(&cgo1, "%s\n", pt.c1)
}
fmt.Fprintf(&cgo1, "*/\nimport \"C\"\n\n")
fmt.Fprintf(&cgo2, "*/\nimport \"C\"\n\n")
// Imports
did1 := make(map[string]bool)
did2 := make(map[string]bool)
did1["os"] = true // for ptrTestMain
fmt.Fprintf(&cgo1, "import \"os\"\n")
for _, pt := range ptrTests {
did := did1
cgo := &cgo1
if strings.Contains(pt.support, "//export") {
did = did2
cgo = &cgo2
}
for _, imp := range pt.imports {
if !did[imp] {
did[imp] = true
fmt.Fprintf(cgo, "import %q\n", imp)
}
}
}
// Func support and bodies.
for _, pt := range ptrTests {
cgo := &cgo1
if strings.Contains(pt.support, "//export") {
cgo = &cgo2
}
fmt.Fprintf(cgo, "%s\nfunc %s() {\n%s\n}\n", pt.support, pt.name, pt.body)
}
// Func list and main dispatch.
fmt.Fprintf(&cgo1, "var funcs = map[string]func() {\n")
for _, pt := range ptrTests {
fmt.Fprintf(&cgo1, "\t%q: %s,\n", pt.name, pt.name)
}
fmt.Fprintf(&cgo1, "}\n\n")
fmt.Fprintf(&cgo1, "%s\n", ptrTestMain)
if err := ioutil.WriteFile(filepath.Join(src, "cgo1.go"), cgo1.Bytes(), 0666); err != nil {
t.Fatal(err)
}
if err := ioutil.WriteFile(filepath.Join(src, "cgo2.go"), cgo2.Bytes(), 0666); err != nil {
t.Fatal(err)
}
cmd := exec.Command("go", "build", "-o", "ptrtest.exe")
cmd.Dir = src
cmd.Env = append(os.Environ(), "GOPATH="+gopath)
out, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("go build: %v\n%s", err, out)
}
return dir, filepath.Join(src, "ptrtest.exe")
}
const ptrTestMain = `
func main() {
for _, arg := range os.Args[1:] {
f := funcs[arg]
if f == nil {
panic("missing func "+arg)
}
f()
}
}
`
var csem = make(chan bool, 16)
func testOne(t *testing.T, pt ptrTest, exe string) {
t.Parallel()
// Run the tests in parallel, but don't run too many
// executions in parallel, to avoid overloading the system.
runcmd := func(cgocheck string) ([]byte, error) {
csem <- true
defer func() { <-csem }()
cmd := exec.Command(exe, pt.name)
cmd.Env = append(os.Environ(), "GODEBUG=cgocheck="+cgocheck)
return cmd.CombinedOutput()
}
if pt.expensive {
buf, err := runcmd("1")
if err != nil {
t.Logf("%s", buf)
if pt.fail {
t.Fatalf("test marked expensive, but failed when not expensive: %v", err)
} else {
t.Errorf("failed unexpectedly with GODEBUG=cgocheck=1: %v", err)
}
}
}
cgocheck := ""
if pt.expensive {
cgocheck = "2"
}
buf, err := runcmd(cgocheck)
if pt.fail {
if err == nil {
t.Logf("%s", buf)
t.Fatalf("did not fail as expected")
} else if !bytes.Contains(buf, []byte("Go pointer")) {
t.Logf("%s", buf)
t.Fatalf("did not print expected error (failed with %v)", err)
}
} else {
if err != nil {
t.Logf("%s", buf)
t.Fatalf("failed unexpectedly: %v", err)
}
if !pt.expensive {
// Make sure it passes with the expensive checks.
buf, err := runcmd("2")
if err != nil {
t.Logf("%s", buf)
t.Fatalf("failed unexpectedly with expensive checks: %v", err)
}
}
}
if pt.fail {
buf, err := runcmd("0")
if err != nil {
t.Logf("%s", buf)
t.Fatalf("failed unexpectedly with GODEBUG=cgocheck=0: %v", err)
}
}
}

Some files were not shown because too many files have changed in this diff Show More