mirror of
https://github.com/golang/go.git
synced 2026-01-30 23:52:05 +03:00
Compare commits
13 Commits
go1.10.2
...
dev.garbag
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d4942afe0 | ||
|
|
8b25a00e6d | ||
|
|
42afbd9e63 | ||
|
|
f9f6c90ed1 | ||
|
|
69161e279e | ||
|
|
fb4c718209 | ||
|
|
81b74bf9c5 | ||
|
|
edb54c300f | ||
|
|
312aa09996 | ||
|
|
d491e550c3 | ||
|
|
641c32dafa | ||
|
|
2e495a1df6 | ||
|
|
344476d23c |
3
.github/CODE_OF_CONDUCT.md
vendored
3
.github/CODE_OF_CONDUCT.md
vendored
@@ -1,3 +0,0 @@
|
||||
# Code of Conduct
|
||||
|
||||
Please read the [Go Community Code of Conduct](https://golang.org/conduct).
|
||||
6
.github/ISSUE_TEMPLATE
vendored
6
.github/ISSUE_TEMPLATE
vendored
@@ -1,17 +1,12 @@
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
|
||||
|
||||
### What version of Go are you using (`go version`)?
|
||||
|
||||
|
||||
### Does this issue reproduce with the latest release?
|
||||
|
||||
|
||||
### What operating system and processor architecture are you using (`go env`)?
|
||||
|
||||
|
||||
### 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.
|
||||
@@ -22,3 +17,4 @@ A link on play.golang.org is best.
|
||||
|
||||
### What did you see instead?
|
||||
|
||||
|
||||
|
||||
7
.github/PULL_REQUEST_TEMPLATE
vendored
Normal file
7
.github/PULL_REQUEST_TEMPLATE
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Please do not send pull requests to the golang/* repositories.
|
||||
|
||||
We do, however, take contributions gladly.
|
||||
|
||||
See https://golang.org/doc/contribute.html
|
||||
|
||||
Thanks!
|
||||
14
.github/SUPPORT.md
vendored
14
.github/SUPPORT.md
vendored
@@ -1,14 +0,0 @@
|
||||
Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions.
|
||||
We only use our bug tracker for tracking bugs and tracking proposals going through the [Proposal Process](https://golang.org/s/proposal-process).
|
||||
|
||||
For asking questions, see:
|
||||
|
||||
* [The golang-nuts mailing list](https://groups.google.com/d/forum/golang-nuts)
|
||||
|
||||
* [The Go Forum](https://forum.golangbridge.org/), a web-based forum
|
||||
|
||||
* [Gophers Slack](https://gophers.slack.com), use the [invite app](https://invite.slack.golangbridge.org/) for access
|
||||
|
||||
* [Stack Overflow](http://stackoverflow.com/questions/tagged/go) with questions tagged "go"
|
||||
|
||||
* **IRC** channel #go-nuts on Freenode
|
||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
437
CONTRIBUTORS
437
CONTRIBUTORS
File diff suppressed because it is too large
Load Diff
55
README.md
55
README.md
@@ -4,41 +4,40 @@ Go is an open source programming language that makes it easy to build simple,
|
||||
reliable, and efficient software.
|
||||
|
||||

|
||||
*Gopher image by [Renee French][rf], licensed under [Creative Commons 3.0 Attributions license][cc3-by].*
|
||||
|
||||
For documentation about how to install and use Go,
|
||||
visit https://golang.org/ or load doc/install-source.html
|
||||
in your web browser.
|
||||
|
||||
Our canonical Git repository is located at https://go.googlesource.com/go.
|
||||
There is a mirror of the repository at https://github.com/golang/go.
|
||||
|
||||
Unless otherwise noted, the Go source files are distributed under the
|
||||
BSD-style license found in the LICENSE file.
|
||||
|
||||
### Download and Install
|
||||
|
||||
#### Binary Distributions
|
||||
|
||||
Official binary distributions are available at https://golang.org/dl/.
|
||||
|
||||
After downloading a binary release, visit https://golang.org/doc/install
|
||||
or load doc/install.html 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
|
||||
in your web browser for source installation instructions.
|
||||
|
||||
### Contributing
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
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 (linux-arm), const O_SYNC = 4096
|
||||
pkg os (linux-arm-cgo), const O_SYNC = 4096
|
||||
@@ -344,4 +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"
|
||||
|
||||
627
api/go1.10.txt
627
api/go1.10.txt
@@ -1,627 +0,0 @@
|
||||
pkg archive/tar, const FormatGNU = 8
|
||||
pkg archive/tar, const FormatGNU Format
|
||||
pkg archive/tar, const FormatPAX = 4
|
||||
pkg archive/tar, const FormatPAX Format
|
||||
pkg archive/tar, const FormatUSTAR = 2
|
||||
pkg archive/tar, const FormatUSTAR Format
|
||||
pkg archive/tar, const FormatUnknown = 0
|
||||
pkg archive/tar, const FormatUnknown Format
|
||||
pkg archive/tar, method (Format) String() string
|
||||
pkg archive/tar, type Format int
|
||||
pkg archive/tar, type Header struct, Format Format
|
||||
pkg archive/tar, type Header struct, PAXRecords map[string]string
|
||||
pkg archive/zip, method (*Writer) SetComment(string) error
|
||||
pkg archive/zip, type FileHeader struct, Modified time.Time
|
||||
pkg archive/zip, type FileHeader struct, NonUTF8 bool
|
||||
pkg bufio, method (*Reader) Size() int
|
||||
pkg bufio, method (*Writer) Size() int
|
||||
pkg crypto/tls, const ECDSAWithSHA1 = 515
|
||||
pkg crypto/tls, const ECDSAWithSHA1 SignatureScheme
|
||||
pkg crypto/x509, const CANotAuthorizedForExtKeyUsage = 9
|
||||
pkg crypto/x509, const CANotAuthorizedForExtKeyUsage InvalidReason
|
||||
pkg crypto/x509, const ExtKeyUsageMicrosoftCommercialCodeSigning = 12
|
||||
pkg crypto/x509, const ExtKeyUsageMicrosoftCommercialCodeSigning ExtKeyUsage
|
||||
pkg crypto/x509, const ExtKeyUsageMicrosoftKernelCodeSigning = 13
|
||||
pkg crypto/x509, const ExtKeyUsageMicrosoftKernelCodeSigning ExtKeyUsage
|
||||
pkg crypto/x509, const NameConstraintsWithoutSANs = 6
|
||||
pkg crypto/x509, const NameConstraintsWithoutSANs InvalidReason
|
||||
pkg crypto/x509, const TooManyConstraints = 8
|
||||
pkg crypto/x509, const TooManyConstraints InvalidReason
|
||||
pkg crypto/x509, const UnconstrainedName = 7
|
||||
pkg crypto/x509, const UnconstrainedName InvalidReason
|
||||
pkg crypto/x509, func MarshalPKCS1PublicKey(*rsa.PublicKey) []uint8
|
||||
pkg crypto/x509, func MarshalPKCS8PrivateKey(interface{}) ([]uint8, error)
|
||||
pkg crypto/x509, func ParsePKCS1PublicKey([]uint8) (*rsa.PublicKey, error)
|
||||
pkg crypto/x509, method (PublicKeyAlgorithm) String() string
|
||||
pkg crypto/x509, type Certificate struct, ExcludedEmailAddresses []string
|
||||
pkg crypto/x509, type Certificate struct, ExcludedIPRanges []*net.IPNet
|
||||
pkg crypto/x509, type Certificate struct, ExcludedURIDomains []string
|
||||
pkg crypto/x509, type Certificate struct, PermittedEmailAddresses []string
|
||||
pkg crypto/x509, type Certificate struct, PermittedIPRanges []*net.IPNet
|
||||
pkg crypto/x509, type Certificate struct, PermittedURIDomains []string
|
||||
pkg crypto/x509, type Certificate struct, URIs []*url.URL
|
||||
pkg crypto/x509, type CertificateInvalidError struct, Detail string
|
||||
pkg crypto/x509, type CertificateRequest struct, URIs []*url.URL
|
||||
pkg crypto/x509, type VerifyOptions struct, MaxConstraintComparisions int
|
||||
pkg crypto/x509/pkix, method (Name) String() string
|
||||
pkg crypto/x509/pkix, method (RDNSequence) String() string
|
||||
pkg database/sql, func OpenDB(driver.Connector) *DB
|
||||
pkg database/sql/driver, type Connector interface { Connect, Driver }
|
||||
pkg database/sql/driver, type Connector interface, Connect(context.Context) (Conn, error)
|
||||
pkg database/sql/driver, type Connector interface, Driver() Driver
|
||||
pkg database/sql/driver, type DriverContext interface { OpenConnector }
|
||||
pkg database/sql/driver, type DriverContext interface, OpenConnector(string) (Connector, error)
|
||||
pkg database/sql/driver, type SessionResetter interface { ResetSession }
|
||||
pkg database/sql/driver, type SessionResetter interface, ResetSession(context.Context) error
|
||||
pkg debug/elf, const R_386_16 = 20
|
||||
pkg debug/elf, const R_386_16 R_386
|
||||
pkg debug/elf, const R_386_32PLT = 11
|
||||
pkg debug/elf, const R_386_32PLT R_386
|
||||
pkg debug/elf, const R_386_8 = 22
|
||||
pkg debug/elf, const R_386_8 R_386
|
||||
pkg debug/elf, const R_386_GOT32X = 43
|
||||
pkg debug/elf, const R_386_GOT32X R_386
|
||||
pkg debug/elf, const R_386_IRELATIVE = 42
|
||||
pkg debug/elf, const R_386_IRELATIVE R_386
|
||||
pkg debug/elf, const R_386_PC16 = 21
|
||||
pkg debug/elf, const R_386_PC16 R_386
|
||||
pkg debug/elf, const R_386_PC8 = 23
|
||||
pkg debug/elf, const R_386_PC8 R_386
|
||||
pkg debug/elf, const R_386_SIZE32 = 38
|
||||
pkg debug/elf, const R_386_SIZE32 R_386
|
||||
pkg debug/elf, const R_386_TLS_DESC = 41
|
||||
pkg debug/elf, const R_386_TLS_DESC R_386
|
||||
pkg debug/elf, const R_386_TLS_DESC_CALL = 40
|
||||
pkg debug/elf, const R_386_TLS_DESC_CALL R_386
|
||||
pkg debug/elf, const R_386_TLS_GOTDESC = 39
|
||||
pkg debug/elf, const R_386_TLS_GOTDESC R_386
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOTOFF_LO15 = 310
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOTOFF_LO15 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOTPAGE_LO15 = 313
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOTPAGE_LO15 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_ADR_PREL21 = 512
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_ADR_PREL21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_MOVW_G0_NC = 516
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_MOVW_G0_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_MOVW_G1 = 515
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_MOVW_G1 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_ADR_PAGE21 = 518
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_ADR_PAGE21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_ADR_PREL21 = 517
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_ADR_PREL21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_LDST128_DTPREL_LO12 = 572
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_LDST128_DTPREL_LO12 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC = 573
|
||||
pkg debug/elf, const R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_LDST128_TPREL_LO12 = 570
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_LDST128_TPREL_LO12 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC = 571
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_ARM_ABS32_NOI = 55
|
||||
pkg debug/elf, const R_ARM_ABS32_NOI R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_15_8 = 33
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_15_8 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_23_15 = 34
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_23_15 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_7_0 = 32
|
||||
pkg debug/elf, const R_ARM_ALU_PCREL_7_0 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G0 = 58
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G0_NC = 57
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G0_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G1 = 60
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G1_NC = 59
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G1_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G2 = 61
|
||||
pkg debug/elf, const R_ARM_ALU_PC_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SBREL_19_12_NC = 36
|
||||
pkg debug/elf, const R_ARM_ALU_SBREL_19_12_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SBREL_27_20_CK = 37
|
||||
pkg debug/elf, const R_ARM_ALU_SBREL_27_20_CK R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G0 = 71
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G0_NC = 70
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G0_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G1 = 73
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G1_NC = 72
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G1_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G2 = 74
|
||||
pkg debug/elf, const R_ARM_ALU_SB_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_BASE_ABS = 31
|
||||
pkg debug/elf, const R_ARM_BASE_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_CALL = 28
|
||||
pkg debug/elf, const R_ARM_CALL R_ARM
|
||||
pkg debug/elf, const R_ARM_GOTOFF12 = 98
|
||||
pkg debug/elf, const R_ARM_GOTOFF12 R_ARM
|
||||
pkg debug/elf, const R_ARM_GOTRELAX = 99
|
||||
pkg debug/elf, const R_ARM_GOTRELAX R_ARM
|
||||
pkg debug/elf, const R_ARM_GOT_ABS = 95
|
||||
pkg debug/elf, const R_ARM_GOT_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_GOT_BREL12 = 97
|
||||
pkg debug/elf, const R_ARM_GOT_BREL12 R_ARM
|
||||
pkg debug/elf, const R_ARM_GOT_PREL = 96
|
||||
pkg debug/elf, const R_ARM_GOT_PREL R_ARM
|
||||
pkg debug/elf, const R_ARM_IRELATIVE = 160
|
||||
pkg debug/elf, const R_ARM_IRELATIVE R_ARM
|
||||
pkg debug/elf, const R_ARM_JUMP24 = 29
|
||||
pkg debug/elf, const R_ARM_JUMP24 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G0 = 67
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G1 = 68
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G2 = 69
|
||||
pkg debug/elf, const R_ARM_LDC_PC_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G0 = 81
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G1 = 82
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G2 = 83
|
||||
pkg debug/elf, const R_ARM_LDC_SB_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G0 = 64
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G1 = 65
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G2 = 66
|
||||
pkg debug/elf, const R_ARM_LDRS_PC_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G0 = 78
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G1 = 79
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G2 = 80
|
||||
pkg debug/elf, const R_ARM_LDRS_SB_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_PC_G1 = 62
|
||||
pkg debug/elf, const R_ARM_LDR_PC_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_PC_G2 = 63
|
||||
pkg debug/elf, const R_ARM_LDR_PC_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_SBREL_11_10_NC = 35
|
||||
pkg debug/elf, const R_ARM_LDR_SBREL_11_10_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G0 = 75
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G0 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G1 = 76
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G1 R_ARM
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G2 = 77
|
||||
pkg debug/elf, const R_ARM_LDR_SB_G2 R_ARM
|
||||
pkg debug/elf, const R_ARM_ME_TOO = 128
|
||||
pkg debug/elf, const R_ARM_ME_TOO R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVT_ABS = 44
|
||||
pkg debug/elf, const R_ARM_MOVT_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVT_BREL = 85
|
||||
pkg debug/elf, const R_ARM_MOVT_BREL R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVT_PREL = 46
|
||||
pkg debug/elf, const R_ARM_MOVT_PREL R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVW_ABS_NC = 43
|
||||
pkg debug/elf, const R_ARM_MOVW_ABS_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVW_BREL = 86
|
||||
pkg debug/elf, const R_ARM_MOVW_BREL R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVW_BREL_NC = 84
|
||||
pkg debug/elf, const R_ARM_MOVW_BREL_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_MOVW_PREL_NC = 45
|
||||
pkg debug/elf, const R_ARM_MOVW_PREL_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_PLT32_ABS = 94
|
||||
pkg debug/elf, const R_ARM_PLT32_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_PREL31 = 42
|
||||
pkg debug/elf, const R_ARM_PREL31 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_0 = 112
|
||||
pkg debug/elf, const R_ARM_PRIVATE_0 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_1 = 113
|
||||
pkg debug/elf, const R_ARM_PRIVATE_1 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_10 = 122
|
||||
pkg debug/elf, const R_ARM_PRIVATE_10 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_11 = 123
|
||||
pkg debug/elf, const R_ARM_PRIVATE_11 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_12 = 124
|
||||
pkg debug/elf, const R_ARM_PRIVATE_12 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_13 = 125
|
||||
pkg debug/elf, const R_ARM_PRIVATE_13 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_14 = 126
|
||||
pkg debug/elf, const R_ARM_PRIVATE_14 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_15 = 127
|
||||
pkg debug/elf, const R_ARM_PRIVATE_15 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_2 = 114
|
||||
pkg debug/elf, const R_ARM_PRIVATE_2 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_3 = 115
|
||||
pkg debug/elf, const R_ARM_PRIVATE_3 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_4 = 116
|
||||
pkg debug/elf, const R_ARM_PRIVATE_4 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_5 = 117
|
||||
pkg debug/elf, const R_ARM_PRIVATE_5 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_6 = 118
|
||||
pkg debug/elf, const R_ARM_PRIVATE_6 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_7 = 119
|
||||
pkg debug/elf, const R_ARM_PRIVATE_7 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_8 = 120
|
||||
pkg debug/elf, const R_ARM_PRIVATE_8 R_ARM
|
||||
pkg debug/elf, const R_ARM_PRIVATE_9 = 121
|
||||
pkg debug/elf, const R_ARM_PRIVATE_9 R_ARM
|
||||
pkg debug/elf, const R_ARM_REL32_NOI = 56
|
||||
pkg debug/elf, const R_ARM_REL32_NOI R_ARM
|
||||
pkg debug/elf, const R_ARM_RXPC25 = 249
|
||||
pkg debug/elf, const R_ARM_RXPC25 R_ARM
|
||||
pkg debug/elf, const R_ARM_SBREL31 = 39
|
||||
pkg debug/elf, const R_ARM_SBREL31 R_ARM
|
||||
pkg debug/elf, const R_ARM_TARGET1 = 38
|
||||
pkg debug/elf, const R_ARM_TARGET1 R_ARM
|
||||
pkg debug/elf, const R_ARM_TARGET2 = 41
|
||||
pkg debug/elf, const R_ARM_TARGET2 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G0_NC = 132
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G0_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G1_NC = 133
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G1_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G2_NC = 134
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G2_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G3 = 135
|
||||
pkg debug/elf, const R_ARM_THM_ALU_ABS_G3 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_ALU_PREL_11_0 = 53
|
||||
pkg debug/elf, const R_ARM_THM_ALU_PREL_11_0 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_GOT_BREL12 = 131
|
||||
pkg debug/elf, const R_ARM_THM_GOT_BREL12 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP11 = 102
|
||||
pkg debug/elf, const R_ARM_THM_JUMP11 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP19 = 51
|
||||
pkg debug/elf, const R_ARM_THM_JUMP19 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP24 = 30
|
||||
pkg debug/elf, const R_ARM_THM_JUMP24 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP6 = 52
|
||||
pkg debug/elf, const R_ARM_THM_JUMP6 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_JUMP8 = 103
|
||||
pkg debug/elf, const R_ARM_THM_JUMP8 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_ABS = 48
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_ABS R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_BREL = 88
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_BREL R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_PREL = 50
|
||||
pkg debug/elf, const R_ARM_THM_MOVT_PREL R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_ABS_NC = 47
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_ABS_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_BREL = 89
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_BREL R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_BREL_NC = 87
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_BREL_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_PREL_NC = 49
|
||||
pkg debug/elf, const R_ARM_THM_MOVW_PREL_NC R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_PC12 = 54
|
||||
pkg debug/elf, const R_ARM_THM_PC12 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_TLS_CALL = 93
|
||||
pkg debug/elf, const R_ARM_THM_TLS_CALL R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_TLS_DESCSEQ16 = 129
|
||||
pkg debug/elf, const R_ARM_THM_TLS_DESCSEQ16 R_ARM
|
||||
pkg debug/elf, const R_ARM_THM_TLS_DESCSEQ32 = 130
|
||||
pkg debug/elf, const R_ARM_THM_TLS_DESCSEQ32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_CALL = 91
|
||||
pkg debug/elf, const R_ARM_TLS_CALL R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_DESCSEQ = 92
|
||||
pkg debug/elf, const R_ARM_TLS_DESCSEQ R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_DTPMOD32 = 17
|
||||
pkg debug/elf, const R_ARM_TLS_DTPMOD32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_DTPOFF32 = 18
|
||||
pkg debug/elf, const R_ARM_TLS_DTPOFF32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_GD32 = 104
|
||||
pkg debug/elf, const R_ARM_TLS_GD32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_GOTDESC = 90
|
||||
pkg debug/elf, const R_ARM_TLS_GOTDESC R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_IE12GP = 111
|
||||
pkg debug/elf, const R_ARM_TLS_IE12GP R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_IE32 = 107
|
||||
pkg debug/elf, const R_ARM_TLS_IE32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LDM32 = 105
|
||||
pkg debug/elf, const R_ARM_TLS_LDM32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LDO12 = 109
|
||||
pkg debug/elf, const R_ARM_TLS_LDO12 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LDO32 = 106
|
||||
pkg debug/elf, const R_ARM_TLS_LDO32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LE12 = 110
|
||||
pkg debug/elf, const R_ARM_TLS_LE12 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_LE32 = 108
|
||||
pkg debug/elf, const R_ARM_TLS_LE32 R_ARM
|
||||
pkg debug/elf, const R_ARM_TLS_TPOFF32 = 19
|
||||
pkg debug/elf, const R_ARM_TLS_TPOFF32 R_ARM
|
||||
pkg debug/elf, const R_ARM_V4BX = 40
|
||||
pkg debug/elf, const R_ARM_V4BX R_ARM
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGH = 110
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGH R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHA = 111
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR64_LOCAL = 117
|
||||
pkg debug/elf, const R_PPC64_ADDR64_LOCAL R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGH = 114
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGH R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHA = 115
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ENTRY = 118
|
||||
pkg debug/elf, const R_PPC64_ENTRY R_PPC64
|
||||
pkg debug/elf, const R_PPC64_IRELATIVE = 248
|
||||
pkg debug/elf, const R_PPC64_IRELATIVE R_PPC64
|
||||
pkg debug/elf, const R_PPC64_JMP_IREL = 247
|
||||
pkg debug/elf, const R_PPC64_JMP_IREL R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLT16_LO_DS = 60
|
||||
pkg debug/elf, const R_PPC64_PLT16_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16 = 52
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_DS = 65
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_HA = 55
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_HI = 54
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_LO = 53
|
||||
pkg debug/elf, const R_PPC64_PLTGOT16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_PLTGOT_LO_DS = 66
|
||||
pkg debug/elf, const R_PPC64_PLTGOT_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL16DX_HA = 246
|
||||
pkg debug/elf, const R_PPC64_REL16DX_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL24_NOTOC = 116
|
||||
pkg debug/elf, const R_PPC64_REL24_NOTOC R_PPC64
|
||||
pkg debug/elf, const R_PPC64_SECTOFF_DS = 61
|
||||
pkg debug/elf, const R_PPC64_SECTOFF_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_SECTOFF_LO_DS = 61
|
||||
pkg debug/elf, const R_PPC64_SECTOFF_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TOCSAVE = 109
|
||||
pkg debug/elf, const R_PPC64_TOCSAVE R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGH = 112
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGH R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHA = 113
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHA R_PPC64
|
||||
pkg debug/elf, const R_X86_64_GOT64 = 27
|
||||
pkg debug/elf, const R_X86_64_GOT64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTOFF64 = 25
|
||||
pkg debug/elf, const R_X86_64_GOTOFF64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPC32 = 26
|
||||
pkg debug/elf, const R_X86_64_GOTPC32 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPC32_TLSDESC = 34
|
||||
pkg debug/elf, const R_X86_64_GOTPC32_TLSDESC R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPC64 = 29
|
||||
pkg debug/elf, const R_X86_64_GOTPC64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPCREL64 = 28
|
||||
pkg debug/elf, const R_X86_64_GOTPCREL64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPCRELX = 41
|
||||
pkg debug/elf, const R_X86_64_GOTPCRELX R_X86_64
|
||||
pkg debug/elf, const R_X86_64_GOTPLT64 = 30
|
||||
pkg debug/elf, const R_X86_64_GOTPLT64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_IRELATIVE = 37
|
||||
pkg debug/elf, const R_X86_64_IRELATIVE R_X86_64
|
||||
pkg debug/elf, const R_X86_64_PC32_BND = 39
|
||||
pkg debug/elf, const R_X86_64_PC32_BND R_X86_64
|
||||
pkg debug/elf, const R_X86_64_PC64 = 24
|
||||
pkg debug/elf, const R_X86_64_PC64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_PLT32_BND = 40
|
||||
pkg debug/elf, const R_X86_64_PLT32_BND R_X86_64
|
||||
pkg debug/elf, const R_X86_64_PLTOFF64 = 31
|
||||
pkg debug/elf, const R_X86_64_PLTOFF64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_RELATIVE64 = 38
|
||||
pkg debug/elf, const R_X86_64_RELATIVE64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_REX_GOTPCRELX = 42
|
||||
pkg debug/elf, const R_X86_64_REX_GOTPCRELX R_X86_64
|
||||
pkg debug/elf, const R_X86_64_SIZE32 = 32
|
||||
pkg debug/elf, const R_X86_64_SIZE32 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_SIZE64 = 33
|
||||
pkg debug/elf, const R_X86_64_SIZE64 R_X86_64
|
||||
pkg debug/elf, const R_X86_64_TLSDESC = 36
|
||||
pkg debug/elf, const R_X86_64_TLSDESC R_X86_64
|
||||
pkg debug/elf, const R_X86_64_TLSDESC_CALL = 35
|
||||
pkg debug/elf, const R_X86_64_TLSDESC_CALL R_X86_64
|
||||
pkg debug/macho, const ARM64_RELOC_ADDEND = 10
|
||||
pkg debug/macho, const ARM64_RELOC_ADDEND RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_BRANCH26 = 2
|
||||
pkg debug/macho, const ARM64_RELOC_BRANCH26 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_GOT_LOAD_PAGE21 = 5
|
||||
pkg debug/macho, const ARM64_RELOC_GOT_LOAD_PAGE21 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_GOT_LOAD_PAGEOFF12 = 6
|
||||
pkg debug/macho, const ARM64_RELOC_GOT_LOAD_PAGEOFF12 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_PAGE21 = 3
|
||||
pkg debug/macho, const ARM64_RELOC_PAGE21 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_PAGEOFF12 = 4
|
||||
pkg debug/macho, const ARM64_RELOC_PAGEOFF12 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_POINTER_TO_GOT = 7
|
||||
pkg debug/macho, const ARM64_RELOC_POINTER_TO_GOT RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_SUBTRACTOR = 1
|
||||
pkg debug/macho, const ARM64_RELOC_SUBTRACTOR RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_TLVP_LOAD_PAGE21 = 8
|
||||
pkg debug/macho, const ARM64_RELOC_TLVP_LOAD_PAGE21 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_TLVP_LOAD_PAGEOFF12 = 9
|
||||
pkg debug/macho, const ARM64_RELOC_TLVP_LOAD_PAGEOFF12 RelocTypeARM64
|
||||
pkg debug/macho, const ARM64_RELOC_UNSIGNED = 0
|
||||
pkg debug/macho, const ARM64_RELOC_UNSIGNED RelocTypeARM64
|
||||
pkg debug/macho, const ARM_RELOC_BR24 = 5
|
||||
pkg debug/macho, const ARM_RELOC_BR24 RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_HALF = 8
|
||||
pkg debug/macho, const ARM_RELOC_HALF RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_HALF_SECTDIFF = 9
|
||||
pkg debug/macho, const ARM_RELOC_HALF_SECTDIFF RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_LOCAL_SECTDIFF = 3
|
||||
pkg debug/macho, const ARM_RELOC_LOCAL_SECTDIFF RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_PAIR = 1
|
||||
pkg debug/macho, const ARM_RELOC_PAIR RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_PB_LA_PTR = 4
|
||||
pkg debug/macho, const ARM_RELOC_PB_LA_PTR RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_SECTDIFF = 2
|
||||
pkg debug/macho, const ARM_RELOC_SECTDIFF RelocTypeARM
|
||||
pkg debug/macho, const ARM_RELOC_VANILLA = 0
|
||||
pkg debug/macho, const ARM_RELOC_VANILLA RelocTypeARM
|
||||
pkg debug/macho, const ARM_THUMB_32BIT_BRANCH = 7
|
||||
pkg debug/macho, const ARM_THUMB_32BIT_BRANCH RelocTypeARM
|
||||
pkg debug/macho, const ARM_THUMB_RELOC_BR22 = 6
|
||||
pkg debug/macho, const ARM_THUMB_RELOC_BR22 RelocTypeARM
|
||||
pkg debug/macho, const FlagAllModsBound = 4096
|
||||
pkg debug/macho, const FlagAllModsBound uint32
|
||||
pkg debug/macho, const FlagAllowStackExecution = 131072
|
||||
pkg debug/macho, const FlagAllowStackExecution uint32
|
||||
pkg debug/macho, const FlagAppExtensionSafe = 33554432
|
||||
pkg debug/macho, const FlagAppExtensionSafe uint32
|
||||
pkg debug/macho, const FlagBindAtLoad = 8
|
||||
pkg debug/macho, const FlagBindAtLoad uint32
|
||||
pkg debug/macho, const FlagBindsToWeak = 65536
|
||||
pkg debug/macho, const FlagBindsToWeak uint32
|
||||
pkg debug/macho, const FlagCanonical = 16384
|
||||
pkg debug/macho, const FlagCanonical uint32
|
||||
pkg debug/macho, const FlagDeadStrippableDylib = 4194304
|
||||
pkg debug/macho, const FlagDeadStrippableDylib uint32
|
||||
pkg debug/macho, const FlagDyldLink = 4
|
||||
pkg debug/macho, const FlagDyldLink uint32
|
||||
pkg debug/macho, const FlagForceFlat = 256
|
||||
pkg debug/macho, const FlagForceFlat uint32
|
||||
pkg debug/macho, const FlagHasTLVDescriptors = 8388608
|
||||
pkg debug/macho, const FlagHasTLVDescriptors uint32
|
||||
pkg debug/macho, const FlagIncrLink = 2
|
||||
pkg debug/macho, const FlagIncrLink uint32
|
||||
pkg debug/macho, const FlagLazyInit = 64
|
||||
pkg debug/macho, const FlagLazyInit uint32
|
||||
pkg debug/macho, const FlagNoFixPrebinding = 1024
|
||||
pkg debug/macho, const FlagNoFixPrebinding uint32
|
||||
pkg debug/macho, const FlagNoHeapExecution = 16777216
|
||||
pkg debug/macho, const FlagNoHeapExecution uint32
|
||||
pkg debug/macho, const FlagNoMultiDefs = 512
|
||||
pkg debug/macho, const FlagNoMultiDefs uint32
|
||||
pkg debug/macho, const FlagNoReexportedDylibs = 1048576
|
||||
pkg debug/macho, const FlagNoReexportedDylibs uint32
|
||||
pkg debug/macho, const FlagNoUndefs = 1
|
||||
pkg debug/macho, const FlagNoUndefs uint32
|
||||
pkg debug/macho, const FlagPIE = 2097152
|
||||
pkg debug/macho, const FlagPIE uint32
|
||||
pkg debug/macho, const FlagPrebindable = 2048
|
||||
pkg debug/macho, const FlagPrebindable uint32
|
||||
pkg debug/macho, const FlagPrebound = 16
|
||||
pkg debug/macho, const FlagPrebound uint32
|
||||
pkg debug/macho, const FlagRootSafe = 262144
|
||||
pkg debug/macho, const FlagRootSafe uint32
|
||||
pkg debug/macho, const FlagSetuidSafe = 524288
|
||||
pkg debug/macho, const FlagSetuidSafe uint32
|
||||
pkg debug/macho, const FlagSplitSegs = 32
|
||||
pkg debug/macho, const FlagSplitSegs uint32
|
||||
pkg debug/macho, const FlagSubsectionsViaSymbols = 8192
|
||||
pkg debug/macho, const FlagSubsectionsViaSymbols uint32
|
||||
pkg debug/macho, const FlagTwoLevel = 128
|
||||
pkg debug/macho, const FlagTwoLevel uint32
|
||||
pkg debug/macho, const FlagWeakDefines = 32768
|
||||
pkg debug/macho, const FlagWeakDefines uint32
|
||||
pkg debug/macho, const GENERIC_RELOC_LOCAL_SECTDIFF = 4
|
||||
pkg debug/macho, const GENERIC_RELOC_LOCAL_SECTDIFF RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_PAIR = 1
|
||||
pkg debug/macho, const GENERIC_RELOC_PAIR RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_PB_LA_PTR = 3
|
||||
pkg debug/macho, const GENERIC_RELOC_PB_LA_PTR RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_SECTDIFF = 2
|
||||
pkg debug/macho, const GENERIC_RELOC_SECTDIFF RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_TLV = 5
|
||||
pkg debug/macho, const GENERIC_RELOC_TLV RelocTypeGeneric
|
||||
pkg debug/macho, const GENERIC_RELOC_VANILLA = 0
|
||||
pkg debug/macho, const GENERIC_RELOC_VANILLA RelocTypeGeneric
|
||||
pkg debug/macho, const LoadCmdRpath = 2147483676
|
||||
pkg debug/macho, const LoadCmdRpath LoadCmd
|
||||
pkg debug/macho, const X86_64_RELOC_BRANCH = 2
|
||||
pkg debug/macho, const X86_64_RELOC_BRANCH RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_GOT = 4
|
||||
pkg debug/macho, const X86_64_RELOC_GOT RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_GOT_LOAD = 3
|
||||
pkg debug/macho, const X86_64_RELOC_GOT_LOAD RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED = 1
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_1 = 6
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_1 RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_2 = 7
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_2 RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_4 = 8
|
||||
pkg debug/macho, const X86_64_RELOC_SIGNED_4 RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_SUBTRACTOR = 5
|
||||
pkg debug/macho, const X86_64_RELOC_SUBTRACTOR RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_TLV = 9
|
||||
pkg debug/macho, const X86_64_RELOC_TLV RelocTypeX86_64
|
||||
pkg debug/macho, const X86_64_RELOC_UNSIGNED = 0
|
||||
pkg debug/macho, const X86_64_RELOC_UNSIGNED RelocTypeX86_64
|
||||
pkg debug/macho, method (RelocTypeARM) GoString() string
|
||||
pkg debug/macho, method (RelocTypeARM) String() string
|
||||
pkg debug/macho, method (RelocTypeARM64) GoString() string
|
||||
pkg debug/macho, method (RelocTypeARM64) String() string
|
||||
pkg debug/macho, method (RelocTypeGeneric) GoString() string
|
||||
pkg debug/macho, method (RelocTypeGeneric) String() string
|
||||
pkg debug/macho, method (RelocTypeX86_64) GoString() string
|
||||
pkg debug/macho, method (RelocTypeX86_64) String() string
|
||||
pkg debug/macho, method (Rpath) Raw() []uint8
|
||||
pkg debug/macho, method (Type) GoString() string
|
||||
pkg debug/macho, method (Type) String() string
|
||||
pkg debug/macho, type Reloc struct
|
||||
pkg debug/macho, type Reloc struct, Addr uint32
|
||||
pkg debug/macho, type Reloc struct, Extern bool
|
||||
pkg debug/macho, type Reloc struct, Len uint8
|
||||
pkg debug/macho, type Reloc struct, Pcrel bool
|
||||
pkg debug/macho, type Reloc struct, Scattered bool
|
||||
pkg debug/macho, type Reloc struct, Type uint8
|
||||
pkg debug/macho, type Reloc struct, Value uint32
|
||||
pkg debug/macho, type RelocTypeARM int
|
||||
pkg debug/macho, type RelocTypeARM64 int
|
||||
pkg debug/macho, type RelocTypeGeneric int
|
||||
pkg debug/macho, type RelocTypeX86_64 int
|
||||
pkg debug/macho, type Rpath struct
|
||||
pkg debug/macho, type Rpath struct, Path string
|
||||
pkg debug/macho, type Rpath struct, embedded LoadBytes
|
||||
pkg debug/macho, type RpathCmd struct
|
||||
pkg debug/macho, type RpathCmd struct, Cmd LoadCmd
|
||||
pkg debug/macho, type RpathCmd struct, Len uint32
|
||||
pkg debug/macho, type RpathCmd struct, Path uint32
|
||||
pkg debug/macho, type Section struct, Relocs []Reloc
|
||||
pkg encoding/asn1, const TagNumericString = 18
|
||||
pkg encoding/asn1, const TagNumericString ideal-int
|
||||
pkg encoding/asn1, func MarshalWithParams(interface{}, string) ([]uint8, error)
|
||||
pkg encoding/csv, type ParseError struct, StartLine int
|
||||
pkg encoding/hex, func NewDecoder(io.Reader) io.Reader
|
||||
pkg encoding/hex, func NewEncoder(io.Writer) io.Writer
|
||||
pkg encoding/json, method (*Decoder) DisallowUnknownFields()
|
||||
pkg encoding/xml, func NewTokenDecoder(TokenReader) *Decoder
|
||||
pkg encoding/xml, type TokenReader interface { Token }
|
||||
pkg encoding/xml, type TokenReader interface, Token() (Token, error)
|
||||
pkg flag, method (*FlagSet) ErrorHandling() ErrorHandling
|
||||
pkg flag, method (*FlagSet) Name() string
|
||||
pkg flag, method (*FlagSet) Output() io.Writer
|
||||
pkg html/template, type Srcset string
|
||||
pkg math, func Erfcinv(float64) float64
|
||||
pkg math, func Erfinv(float64) float64
|
||||
pkg math, func Round(float64) float64
|
||||
pkg math, func RoundToEven(float64) float64
|
||||
pkg math/big, const MaxBase = 62
|
||||
pkg math/big, method (*Float) Sqrt(*Float) *Float
|
||||
pkg math/big, method (*Int) CmpAbs(*Int) int
|
||||
pkg math/rand, func Shuffle(int, func(int, int))
|
||||
pkg math/rand, method (*Rand) Shuffle(int, func(int, int))
|
||||
pkg net, method (*TCPListener) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, method (*UnixListener) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net/smtp, method (*Client) Noop() error
|
||||
pkg os, func IsTimeout(error) bool
|
||||
pkg os, method (*File) SetDeadline(time.Time) error
|
||||
pkg os, method (*File) SetReadDeadline(time.Time) error
|
||||
pkg os, method (*File) SetWriteDeadline(time.Time) error
|
||||
pkg os, method (*PathError) Timeout() bool
|
||||
pkg os, method (*SyscallError) Timeout() bool
|
||||
pkg os, var ErrNoDeadline error
|
||||
pkg strings, method (*Builder) Grow(int)
|
||||
pkg strings, method (*Builder) Len() int
|
||||
pkg strings, method (*Builder) Reset()
|
||||
pkg strings, method (*Builder) String() string
|
||||
pkg strings, method (*Builder) Write([]uint8) (int, error)
|
||||
pkg strings, method (*Builder) WriteByte(uint8) error
|
||||
pkg strings, method (*Builder) WriteRune(int32) (int, error)
|
||||
pkg strings, method (*Builder) WriteString(string) (int, error)
|
||||
pkg strings, type Builder struct
|
||||
pkg syscall (freebsd-386), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-386), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-386-cgo), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-386-cgo), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-amd64), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-amd64), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-arm), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_UTIMENSAT = 547
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_UTIMENSAT ideal-int
|
||||
pkg syscall (windows-386), func CreateProcessAsUser(Token, *uint16, *uint16, *SecurityAttributes, *SecurityAttributes, bool, uint32, *uint16, *uint16, *StartupInfo, *ProcessInformation) error
|
||||
pkg syscall (windows-386), type SysProcAttr struct, Token Token
|
||||
pkg syscall (windows-amd64), func CreateProcessAsUser(Token, *uint16, *uint16, *SecurityAttributes, *SecurityAttributes, bool, uint32, *uint16, *uint16, *StartupInfo, *ProcessInformation) error
|
||||
pkg syscall (windows-amd64), type SysProcAttr struct, Token Token
|
||||
pkg time, func LoadLocationFromTZData(string, []uint8) (*Location, error)
|
||||
pkg unicode, const Version = "10.0.0"
|
||||
pkg unicode, var Masaram_Gondi *RangeTable
|
||||
pkg unicode, var Nushu *RangeTable
|
||||
pkg unicode, var Regional_Indicator *RangeTable
|
||||
pkg unicode, var Soyombo *RangeTable
|
||||
pkg unicode, var Zanabazar_Square *RangeTable
|
||||
169
api/go1.9.txt
169
api/go1.9.txt
@@ -1,169 +0,0 @@
|
||||
pkg crypto, const BLAKE2b_256 = 17
|
||||
pkg crypto, const BLAKE2b_256 Hash
|
||||
pkg crypto, const BLAKE2b_384 = 18
|
||||
pkg crypto, const BLAKE2b_384 Hash
|
||||
pkg crypto, const BLAKE2b_512 = 19
|
||||
pkg crypto, const BLAKE2b_512 Hash
|
||||
pkg crypto, const BLAKE2s_256 = 16
|
||||
pkg crypto, const BLAKE2s_256 Hash
|
||||
pkg crypto/x509, type Certificate struct, ExcludedDNSDomains []string
|
||||
pkg database/sql, method (*Conn) BeginTx(context.Context, *TxOptions) (*Tx, error)
|
||||
pkg database/sql, method (*Conn) Close() error
|
||||
pkg database/sql, method (*Conn) ExecContext(context.Context, string, ...interface{}) (Result, error)
|
||||
pkg database/sql, method (*Conn) PingContext(context.Context) error
|
||||
pkg database/sql, method (*Conn) PrepareContext(context.Context, string) (*Stmt, error)
|
||||
pkg database/sql, method (*Conn) QueryContext(context.Context, string, ...interface{}) (*Rows, error)
|
||||
pkg database/sql, method (*Conn) QueryRowContext(context.Context, string, ...interface{}) *Row
|
||||
pkg database/sql, method (*DB) Conn(context.Context) (*Conn, error)
|
||||
pkg database/sql, type Conn struct
|
||||
pkg database/sql, type Out struct
|
||||
pkg database/sql, type Out struct, Dest interface{}
|
||||
pkg database/sql, type Out struct, In bool
|
||||
pkg database/sql, var ErrConnDone error
|
||||
pkg database/sql/driver, type NamedValueChecker interface { CheckNamedValue }
|
||||
pkg database/sql/driver, type NamedValueChecker interface, CheckNamedValue(*NamedValue) error
|
||||
pkg database/sql/driver, var ErrRemoveArgument error
|
||||
pkg encoding/asn1, const TagNull = 5
|
||||
pkg encoding/asn1, const TagNull ideal-int
|
||||
pkg encoding/asn1, var NullBytes []uint8
|
||||
pkg encoding/asn1, var NullRawValue RawValue
|
||||
pkg encoding/base32, const NoPadding = -1
|
||||
pkg encoding/base32, const NoPadding int32
|
||||
pkg encoding/base32, const StdPadding = 61
|
||||
pkg encoding/base32, const StdPadding int32
|
||||
pkg encoding/base32, method (Encoding) WithPadding(int32) *Encoding
|
||||
pkg encoding/csv, type Reader struct, ReuseRecord bool
|
||||
pkg encoding/json, func Valid([]uint8) bool
|
||||
pkg go/ast, type TypeSpec struct, Assign token.Pos
|
||||
pkg go/types, func SizesFor(string, string) Sizes
|
||||
pkg go/types, method (*TypeName) IsAlias() bool
|
||||
pkg hash/fnv, func New128() hash.Hash
|
||||
pkg hash/fnv, func New128a() hash.Hash
|
||||
pkg html/template, const ErrPredefinedEscaper = 11
|
||||
pkg html/template, const ErrPredefinedEscaper ErrorCode
|
||||
pkg image/png, type Encoder struct, BufferPool EncoderBufferPool
|
||||
pkg image/png, type EncoderBuffer struct
|
||||
pkg image/png, type EncoderBufferPool interface { Get, Put }
|
||||
pkg image/png, type EncoderBufferPool interface, Get() *EncoderBuffer
|
||||
pkg image/png, type EncoderBufferPool interface, Put(*EncoderBuffer)
|
||||
pkg math/big, method (*Int) IsInt64() bool
|
||||
pkg math/big, method (*Int) IsUint64() bool
|
||||
pkg math/big, type Word uint
|
||||
pkg math/bits, const UintSize = 64
|
||||
pkg math/bits, const UintSize ideal-int
|
||||
pkg math/bits, func LeadingZeros(uint) int
|
||||
pkg math/bits, func LeadingZeros16(uint16) int
|
||||
pkg math/bits, func LeadingZeros32(uint32) int
|
||||
pkg math/bits, func LeadingZeros64(uint64) int
|
||||
pkg math/bits, func LeadingZeros8(uint8) int
|
||||
pkg math/bits, func Len(uint) int
|
||||
pkg math/bits, func Len16(uint16) int
|
||||
pkg math/bits, func Len32(uint32) int
|
||||
pkg math/bits, func Len64(uint64) int
|
||||
pkg math/bits, func Len8(uint8) int
|
||||
pkg math/bits, func OnesCount(uint) int
|
||||
pkg math/bits, func OnesCount16(uint16) int
|
||||
pkg math/bits, func OnesCount32(uint32) int
|
||||
pkg math/bits, func OnesCount64(uint64) int
|
||||
pkg math/bits, func OnesCount8(uint8) int
|
||||
pkg math/bits, func Reverse(uint) uint
|
||||
pkg math/bits, func Reverse16(uint16) uint16
|
||||
pkg math/bits, func Reverse32(uint32) uint32
|
||||
pkg math/bits, func Reverse64(uint64) uint64
|
||||
pkg math/bits, func Reverse8(uint8) uint8
|
||||
pkg math/bits, func ReverseBytes(uint) uint
|
||||
pkg math/bits, func ReverseBytes16(uint16) uint16
|
||||
pkg math/bits, func ReverseBytes32(uint32) uint32
|
||||
pkg math/bits, func ReverseBytes64(uint64) uint64
|
||||
pkg math/bits, func RotateLeft(uint, int) uint
|
||||
pkg math/bits, func RotateLeft16(uint16, int) uint16
|
||||
pkg math/bits, func RotateLeft32(uint32, int) uint32
|
||||
pkg math/bits, func RotateLeft64(uint64, int) uint64
|
||||
pkg math/bits, func RotateLeft8(uint8, int) uint8
|
||||
pkg math/bits, func TrailingZeros(uint) int
|
||||
pkg math/bits, func TrailingZeros16(uint16) int
|
||||
pkg math/bits, func TrailingZeros32(uint32) int
|
||||
pkg math/bits, func TrailingZeros64(uint64) int
|
||||
pkg math/bits, func TrailingZeros8(uint8) int
|
||||
pkg mime, var ErrInvalidMediaParameter error
|
||||
pkg mime/multipart, type FileHeader struct, Size int64
|
||||
pkg mime/multipart, var ErrMessageTooLarge error
|
||||
pkg net, method (*IPConn) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, method (*TCPConn) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, method (*UDPConn) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, method (*UnixConn) SyscallConn() (syscall.RawConn, error)
|
||||
pkg net, type Resolver struct, Dial func(context.Context, string, string) (Conn, error)
|
||||
pkg net, type Resolver struct, StrictErrors bool
|
||||
pkg net/http, func ServeTLS(net.Listener, Handler, string, string) error
|
||||
pkg net/http, method (*Server) RegisterOnShutdown(func())
|
||||
pkg net/http, method (*Server) ServeTLS(net.Listener, string, string) error
|
||||
pkg net/http/fcgi, func ProcessEnv(*http.Request) map[string]string
|
||||
pkg net/http/httptest, method (*Server) Certificate() *x509.Certificate
|
||||
pkg net/http/httptest, method (*Server) Client() *http.Client
|
||||
pkg reflect, func MakeMapWithSize(Type, int) Value
|
||||
pkg runtime/pprof, func Do(context.Context, LabelSet, func(context.Context))
|
||||
pkg runtime/pprof, func ForLabels(context.Context, func(string, string) bool)
|
||||
pkg runtime/pprof, func Label(context.Context, string) (string, bool)
|
||||
pkg runtime/pprof, func Labels(...string) LabelSet
|
||||
pkg runtime/pprof, func SetGoroutineLabels(context.Context)
|
||||
pkg runtime/pprof, func WithLabels(context.Context, LabelSet) context.Context
|
||||
pkg runtime/pprof, type LabelSet struct
|
||||
pkg sync, method (*Map) Delete(interface{})
|
||||
pkg sync, method (*Map) Load(interface{}) (interface{}, bool)
|
||||
pkg sync, method (*Map) LoadOrStore(interface{}, interface{}) (interface{}, bool)
|
||||
pkg sync, method (*Map) Range(func(interface{}, interface{}) bool)
|
||||
pkg sync, method (*Map) Store(interface{}, interface{})
|
||||
pkg sync, type Map struct
|
||||
pkg syscall (darwin-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (darwin-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (darwin-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (darwin-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-386-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-386), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-amd64-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-amd64), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-arm-cgo), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-arm-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (freebsd-arm), func Pipe2([]int, int) error
|
||||
pkg syscall (freebsd-arm), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-386-cgo), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-386), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-amd64-cgo), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-amd64), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-arm-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-arm-cgo), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (linux-arm), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (linux-arm), type SysProcAttr struct, AmbientCaps []uintptr
|
||||
pkg syscall (netbsd-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-arm-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (netbsd-arm), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (openbsd-386-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (openbsd-386), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (openbsd-amd64-cgo), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (openbsd-amd64), type Credential struct, NoSetGroups bool
|
||||
pkg syscall (windows-386), const WSAECONNABORTED = 10053
|
||||
pkg syscall (windows-386), const WSAECONNABORTED Errno
|
||||
pkg syscall (windows-amd64), const WSAECONNABORTED = 10053
|
||||
pkg syscall (windows-amd64), const WSAECONNABORTED Errno
|
||||
pkg syscall, type Conn interface { SyscallConn }
|
||||
pkg syscall, type Conn interface, SyscallConn() (RawConn, error)
|
||||
pkg syscall, type RawConn interface { Control, Read, Write }
|
||||
pkg syscall, type RawConn interface, Control(func(uintptr)) error
|
||||
pkg syscall, type RawConn interface, Read(func(uintptr) bool) error
|
||||
pkg syscall, type RawConn interface, Write(func(uintptr) bool) error
|
||||
pkg testing, method (*B) Helper()
|
||||
pkg testing, method (*T) Helper()
|
||||
pkg testing, type TB interface, Helper()
|
||||
pkg time, method (Duration) Round(Duration) Duration
|
||||
pkg time, method (Duration) Truncate(Duration) Duration
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
10
doc/asm.html
10
doc/asm.html
@@ -29,7 +29,7 @@ Instead, the compiler operates on a kind of semi-abstract instruction set,
|
||||
and instruction selection occurs partly after code generation.
|
||||
The assembler works on the semi-abstract form, so
|
||||
when you see an instruction like <code>MOV</code>
|
||||
what the toolchain actually generates for that operation might
|
||||
what the tool chain actually generates for that operation might
|
||||
not be a move instruction at all, perhaps a clear or load.
|
||||
Or it might correspond exactly to the machine instruction with that name.
|
||||
In general, machine-specific operations tend to appear as themselves, while more general concepts like
|
||||
@@ -139,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>
|
||||
|
||||
@@ -876,12 +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>
|
||||
|
||||
<h3 id="unsupported_opcodes">Unsupported opcodes</h3>
|
||||
|
||||
<p>
|
||||
|
||||
10
doc/cmd.html
10
doc/cmd.html
@@ -22,7 +22,7 @@ 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>pprof</code>, are accessible only through
|
||||
Some of the commands, such as <code>yacc</code>, are accessible only through
|
||||
the go <code>tool</code> subcommand.
|
||||
</p>
|
||||
|
||||
@@ -62,7 +62,7 @@ details.
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/cover/">cover</a></td>
|
||||
<td><a href="//godoc.org/golang.org/x/tools/cmd/cover/">cover</a></td>
|
||||
<td> </td>
|
||||
<td>Cover is a program for creating and analyzing the coverage profiles
|
||||
generated by <code>"go test -coverprofile"</code>.</td>
|
||||
@@ -95,6 +95,12 @@ gofmt</a> command with more general options.</td>
|
||||
calls whose arguments do not align with the format string.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/yacc/">yacc</a></td>
|
||||
<td> </td>
|
||||
<td>Yacc is a version of yacc that generates parsers implemented in Go.</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -124,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.
|
||||
@@ -270,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>
|
||||
|
||||
@@ -148,26 +148,29 @@ These actions are explicitly forbidden in Go spaces:
|
||||
|
||||
<p>
|
||||
The Go spaces are not free speech venues; they are for discussion about Go.
|
||||
Each of these spaces have their own moderators.
|
||||
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 a reported conflict cannot be resolved amicably, the CoC Working Group
|
||||
may make a recommendation to the relevant forum moderators.
|
||||
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>
|
||||
CoC Working Group members and forum moderators are held to a higher standard than other community members.
|
||||
If a working group member or 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.
|
||||
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 working group member or moderator actions must be handled
|
||||
using the reporting process below.
|
||||
Complaints about moderator actions must be handled using the reporting process
|
||||
below.
|
||||
</p>
|
||||
|
||||
<h2 id="reporting">Reporting issues</h2>
|
||||
@@ -182,7 +185,10 @@ satisfaction of all parties. They are:
|
||||
<ul>
|
||||
<li>Aditya Mukerjee <dev@chimeracoder.net>
|
||||
<li>Andrew Gerrand <adg@golang.org>
|
||||
<li>Dave Cheney <dave@cheney.net>
|
||||
<li>Jason Buberel <jbuberel@google.com>
|
||||
<li>Peggy Li <peggyli.224@gmail.com>
|
||||
<li>Sarah Adams <sadams.codes@gmail.com>
|
||||
<li>Steve Francia <steve.francia@gmail.com>
|
||||
<li>Verónica López <gveronicalg@gmail.com>
|
||||
</ul>
|
||||
@@ -195,10 +201,13 @@ particular individual or group.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Mail <a href="mailto:conduct@golang.org">conduct@golang.org</a>.
|
||||
<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
|
||||
@@ -220,8 +229,11 @@ particular individual or group.
|
||||
<li>The Working Group will reach a decision as to how to act. These may include:
|
||||
<ul>
|
||||
<li>Nothing.
|
||||
<li>Passing the report along to the offender.
|
||||
<li>A recommendation of action to the relevant forum moderators.
|
||||
<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.
|
||||
@@ -234,6 +246,7 @@ particular individual or group.
|
||||
conflicts in the most harmonious way possible.</b>
|
||||
We hope that in most cases issues may be resolved through polite discussion and
|
||||
mutual agreement.
|
||||
Bannings and other forceful measures are to be employed only as a last resort.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -34,9 +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.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>
|
||||
@@ -118,6 +115,6 @@ guidelines</a> for information on design, testing, and our code review process.
|
||||
<p>
|
||||
Check <a href="//golang.org/issue">the tracker</a> for
|
||||
open issues that interest you. Those labeled
|
||||
<a href="https://github.com/golang/go/issues?q=is%3Aopen+is%3Aissue+label%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>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<!--{
|
||||
"Title": "Contribution Guide"
|
||||
"Title": "Contribution Guidelines"
|
||||
}-->
|
||||
|
||||
<h2 id="Introduction">Introduction</h2>
|
||||
|
||||
<p>
|
||||
The Go project welcomes all contributors. The process of contributing
|
||||
to the Go project may be different than many projects you are used to.
|
||||
This document is intended as a guide to help you through the contribution
|
||||
process. This guide assumes you have a basic understanding of Git and Go.
|
||||
This document explains how to contribute changes to the Go project.
|
||||
It assumes you have followed the
|
||||
<a href="/doc/install/source">installation instructions</a> and
|
||||
have <a href="code.html">written and tested your code</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -18,99 +20,127 @@ see <a href="gccgo_contribute.html">Contributing to gccgo</a>.)
|
||||
Sensitive security-related issues should be reported to <a href="mailto:security@golang.org">security@golang.org</a>.
|
||||
</p>
|
||||
|
||||
<h1 id="contributor">Becoming a contributor</h1>
|
||||
<h2 id="Design">Discuss your design</h2>
|
||||
|
||||
<p>
|
||||
Before you can contribute to the Go project you need to setup a few prerequisites.
|
||||
The Go project uses <a href="https://www.gerritcodereview.com/">Gerrit</a>, an open
|
||||
source online tool, to perform all code reviews.
|
||||
Gerrit uses your email address as a unique identifier.
|
||||
The Go project contributing flow is currently configured to work only with Google Accounts.
|
||||
You must go through the following process <em>prior to contributing</em>.
|
||||
You only need to do this once per Google Account.
|
||||
The project welcomes submissions but please let everyone know what
|
||||
you're working on if you want to change or add to the Go repositories.
|
||||
</p>
|
||||
|
||||
<h2 id="go-contrib-init">Automatically set up & diagnose your development environment</h2>
|
||||
<p>
|
||||
The <code>go-contrib-init</code> tool configures and debugs your Go
|
||||
development environment, automatically performing many of the steps
|
||||
on this page, or telling you what you need to do next. If you wish
|
||||
to use it, run:
|
||||
Before undertaking to write something new for the Go project,
|
||||
please <a href="https://golang.org/issue/new">file an issue</a>
|
||||
(or claim an <a href="https://golang.org/issues">existing issue</a>).
|
||||
Significant changes must go through the
|
||||
<a href="https://golang.org/s/proposal-process">change proposal process</a>
|
||||
before they can be accepted.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This process gives everyone a chance to validate the design,
|
||||
helps prevent duplication of effort,
|
||||
and ensures that the idea fits inside the goals for the language and tools.
|
||||
It also checks that the design is sound before code is written;
|
||||
the code review tool is not the place for high-level discussions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When planning work, please note that the Go project follows a
|
||||
<a href="https://golang.org/wiki/Go-Release-Cycle">six-month
|
||||
development cycle</a>. The latter half of each cycle is a three-month
|
||||
feature freeze during which only bug fixes and doc updates are accepted.
|
||||
New work cannot be submitted during a feature freeze.
|
||||
</p>
|
||||
|
||||
<h2 id="Testing">Testing redux</h2>
|
||||
|
||||
<p>
|
||||
You've <a href="code.html">written and tested your code</a>, but
|
||||
before sending code out for review, run all the tests for the whole
|
||||
tree to make sure the changes don't break other packages or programs:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go get -u golang.org/x/tools/cmd/go-contrib-init
|
||||
$ cd /code/to/edit
|
||||
$ go-contrib-init
|
||||
$ cd go/src
|
||||
$ ./all.bash
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The tool will either set things up, tell you that everything is
|
||||
configured, or tell you what steps you need to do manually.
|
||||
</p>
|
||||
|
||||
<h2 id="auth">Configure Git to use Gerrit</h2>
|
||||
<p>
|
||||
You'll need a web browser and a command line terminal.
|
||||
You should already have Git installed.
|
||||
(To build under Windows use <code>all.bat</code>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Gerrit uses Google Accounts for authentication.
|
||||
If you don't have a Google Account, you can create an account which
|
||||
After running for a while, the command should print
|
||||
"<code>ALL</code> <code>TESTS</code> <code>PASSED</code>".
|
||||
</p>
|
||||
|
||||
<h2 id="Code_review">Code review</h2>
|
||||
|
||||
<p>
|
||||
Changes to Go must be reviewed before they are accepted,
|
||||
no matter who makes the change.
|
||||
A custom git command called <code>git-codereview</code>,
|
||||
discussed below, helps manage the code review process through a Google-hosted
|
||||
<a href="https://go-review.googlesource.com/">instance</a> of the code review
|
||||
system called <a href="https://www.gerritcodereview.com/">Gerrit</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="auth">Set up authentication for code review</h3>
|
||||
|
||||
<p>
|
||||
Gerrit uses Google Accounts for authentication. If you don't have
|
||||
a Google Account, you can create an account which
|
||||
<a href="https://www.google.com/accounts/NewAccount">includes
|
||||
a new Gmail email account</a> or create an account associated
|
||||
<a href="https://accounts.google.com/SignUpWithoutGmail">with your existing
|
||||
email address</a>.
|
||||
</p>
|
||||
|
||||
<h3>Step 1: Sign in to googlesource and generate a password</h3>
|
||||
<p>
|
||||
The email address associated with the Google Account you use will be recorded in
|
||||
the <a href="https://go.googlesource.com/go/+log/">change log</a>
|
||||
and in the <a href="/CONTRIBUTORS">contributors file</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Visit <a href="https://go.googlesource.com">go.googlesource.com</a>
|
||||
To set up your account in Gerrit, visit
|
||||
<a href="https://go.googlesource.com">go.googlesource.com</a>
|
||||
and click on "Generate Password" in the page's top right menu bar.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You will be redirected to accounts.google.com to sign in.
|
||||
</p>
|
||||
|
||||
<h3>Step 2: Run the provided script</h3>
|
||||
<p>
|
||||
After signing in, you are taken to a page on go.googlesource.com with the title "Configure Git".
|
||||
This page contains a personalized script which when run locally will configure git
|
||||
to have your unique authentication key.
|
||||
This key is paired with one generated server side similar to how ssh keys work.
|
||||
Once signed in, you are returned back to go.googlesource.com to "Configure Git".
|
||||
Follow the instructions on the page.
|
||||
(If you are on a Windows computer, you should instead follow the instructions
|
||||
in the yellow box to run the command.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Copy and run this script locally in your command line terminal.
|
||||
(On a Windows computer using cmd you should instead follow the instructions
|
||||
in the yellow box to run the command. If you are using git-bash use the same
|
||||
script as *nix.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Your secret authentication token is now in a <code>.gitcookies</code> file
|
||||
Your secret authentication token is now in a <code>.gitcookie</code> file
|
||||
and Git is configured to use this file.
|
||||
</p>
|
||||
|
||||
<h3 id="gerrit">Step 3: Register with Gerrit</h3>
|
||||
<h3 id="gerrit">Register with Gerrit</h3>
|
||||
|
||||
<p>
|
||||
Now that you have your authentication token, you need to register your
|
||||
account with Gerrit.
|
||||
To do this, visit <a href="https://go-review.googlesource.com/login/">
|
||||
go-review.googlesource.com/login/</a>.
|
||||
Sign in using the same Google Account you used above.
|
||||
Now that you have your authentication token,
|
||||
you need to register your account with Gerrit.
|
||||
To do this, visit
|
||||
<a href="https://go-review.googlesource.com/login/">
|
||||
go-review.googlesource.com/login/</a>. You will immediately be redirected
|
||||
to Google Accounts. Sign in using the same Google Account you used above.
|
||||
That is all that is required.
|
||||
</p>
|
||||
|
||||
<h2 id="cla">Contributor License Agreement</h2>
|
||||
|
||||
<h3 id="which_cla">Which CLA</h3>
|
||||
<p>
|
||||
Before sending your first change to the Go project
|
||||
you must have completed one of the following two CLAs.
|
||||
Which CLA you should sign depends on who owns the copyright to your work.
|
||||
</p>
|
||||
<h3 id="cla">Contributor License Agreement</h3>
|
||||
|
||||
<p>Gerrit serves as the gatekeeper and uses your e-mail address as the key.
|
||||
To send your first change to the Go project from a given address,
|
||||
you must have completed one of the contributor license agreements:
|
||||
<ul>
|
||||
<li>
|
||||
If you are the copyright holder, you will need to agree to the
|
||||
@@ -121,49 +151,37 @@ contributor license agreement</a>, which can be completed online.
|
||||
If your organization is the copyright holder, the organization
|
||||
will need to agree to the
|
||||
<a href="https://developers.google.com/open-source/cla/corporate">corporate
|
||||
contributor license agreement</a>.<br>
|
||||
contributor license agreement</a>.
|
||||
(If the copyright holder for your code has already completed the
|
||||
agreement in connection with another Google open source project,
|
||||
it does not need to be completed again.)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<i>If the copyright holder for your contribution has already completed the
|
||||
agreement in connection with another Google open source project,
|
||||
it does not need to be completed again.</i>
|
||||
</p>
|
||||
|
||||
<h3 id="signing_cla">Completing the CLA</h3>
|
||||
|
||||
<p>
|
||||
You can see your currently signed agreements and sign new ones through the Gerrit
|
||||
interface.
|
||||
To do this, <a href="https://go-review.googlesource.com/login/">Log into Gerrit</a>,
|
||||
then visit the <a href="https://go-review.googlesource.com/settings/agreements">Agreements</a>
|
||||
page.
|
||||
If you do not have a signed agreement listed there, you can create one
|
||||
by clicking "New Contributor Agreement" and following the steps.
|
||||
You can use the links above to create and sign the contributor license agreement
|
||||
or you can show your current agreements and create new ones through the Gerrit
|
||||
interface. <a href="https://go-review.googlesource.com/login/">Log into Gerrit</a>,
|
||||
click your name in the upper-right, choose "Settings", then select "Agreements"
|
||||
from the topics on the left. If you do not have a signed agreement listed here,
|
||||
you can create one by clicking "New Contributor Agreement" and following the steps.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If the copyright holder for the code you are submitting changes — for example,
|
||||
if you start contributing code on behalf of a new company — please send email
|
||||
to golang-dev and let us know, so that we can make sure an appropriate agreement is
|
||||
completed and update the <code>AUTHORS</code> file.
|
||||
This rigmarole only needs to be done for your first submission for each email address.
|
||||
</p>
|
||||
|
||||
<span id="Code_review"></span>
|
||||
<h1 id="prepare_dev_env">Preparing a Development Environment for Contributing</h1>
|
||||
|
||||
<h2 id="git-codereview">Setting up Git for submission to Gerrit</h2>
|
||||
<p>
|
||||
Changes to Go must be reviewed before they are accepted, no matter who makes the change.
|
||||
A custom git command called <code>git-codereview</code>, discussed below,
|
||||
helps manage the code review process through a Google-hosted
|
||||
<a href="https://go-review.googlesource.com/">instance</a> of Gerrit.
|
||||
If the copyright holder for the code you are submitting changes—for example,
|
||||
if you start contributing code on behalf of a new company—please send email
|
||||
to let us know, so that we can make sure an appropriate agreement is completed
|
||||
and update the <code>AUTHORS</code> file.
|
||||
</p>
|
||||
|
||||
<h3 id="git-codereview_install">Install the git-codereview command</h3>
|
||||
<h3 id="git-codereview">Install the git-codereview command</h3>
|
||||
|
||||
<p>
|
||||
Install the <code>git-codereview</code> command by running,
|
||||
Now install the <code>git-codereview</code> command by running,
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -183,29 +201,25 @@ $ git codereview help
|
||||
prints help text, not an error.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
On Windows, when using git-bash you must make sure that
|
||||
<code>git-codereview.exe</code> is in your git exec-path.
|
||||
Run <code>git --exec-path</code> to discover the right location then create a
|
||||
symbolic link or simply copy the executable from $GOPATH/bin to this directory.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Note to Git aficionados:</b>
|
||||
The <code>git-codereview</code> command is not required to
|
||||
upload and manage Gerrit code reviews.
|
||||
For those who prefer plain Git, the text below gives the Git equivalent of
|
||||
each git-codereview command.
|
||||
upload and manage Gerrit code reviews. For those who prefer plain Git, the text
|
||||
below gives the Git equivalent of each git-codereview command.
|
||||
</p>
|
||||
|
||||
<p>If you do use plain
|
||||
Git, note that you still need the commit hooks that the git-codereview command
|
||||
configures; those hooks add a Gerrit <code>Change-Id</code> line to the commit
|
||||
message and check that all Go source files have been formatted with gofmt. Even
|
||||
if you intend to use plain Git for daily work, install the hooks in a new Git
|
||||
checkout by running <code>git-codereview</code> <code>hooks</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you do use plain Git, note that you still need the commit hooks that the
|
||||
git-codereview command configures; those hooks add a Gerrit
|
||||
<code>Change-Id</code> line to the commit message and check that all Go source
|
||||
files have been formatted with gofmt.
|
||||
Even if you intend to use plain Git for
|
||||
daily work, install the hooks in a new Git checkout by running
|
||||
<code>git-codereview</code> <code>hooks</code>.
|
||||
The workflow described below assumes a single change per branch.
|
||||
It is also possible to prepare a sequence of (usually related) changes in a single branch.
|
||||
See the <a href="https://golang.org/x/review/git-codereview">git-codereview documentation</a> for details.
|
||||
</p>
|
||||
|
||||
<h3 id="git-config">Set up git aliases</h3>
|
||||
@@ -250,8 +264,7 @@ To install them, copy this text into your Git configuration file
|
||||
sync = codereview sync
|
||||
</pre>
|
||||
|
||||
<span id="help"></span>
|
||||
<h3 id="understanding_git-codereview">Understanding the git-codereview command</h3>
|
||||
<h3 id="help">Understanding the git-codereview command</h3>
|
||||
|
||||
<p>After installing the <code>git-codereview</code> command, you can run</p>
|
||||
|
||||
@@ -264,79 +277,11 @@ to learn more about its commands.
|
||||
You can also read the <a href="https://godoc.org/golang.org/x/review/git-codereview">command documentation</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<h1 id="making_a_contribution">Making a Contribution</h1>
|
||||
|
||||
<h2 id="Design">Discuss your design</h2>
|
||||
|
||||
<p>
|
||||
The project welcomes submissions but please let everyone know what
|
||||
you're working on if you want to change or add to the Go repositories.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Before undertaking to write something new for the Go project,
|
||||
please <a href="https://golang.org/issue/new">file an issue</a>
|
||||
(or claim an <a href="https://golang.org/issues">existing issue</a>).
|
||||
Significant changes must go through the
|
||||
<a href="https://golang.org/s/proposal-process">change proposal process</a>
|
||||
before they can be accepted.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This process gives everyone a chance to validate the design,
|
||||
helps prevent duplication of effort,
|
||||
and ensures that the idea fits inside the goals for the language and tools.
|
||||
It also checks that the design is sound before code is written;
|
||||
the code review tool is not the place for high-level discussions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When planning work, please note that the Go project follows a <a
|
||||
href="https://golang.org/wiki/Go-Release-Cycle">six-month development cycle</a>.
|
||||
The latter half of each cycle is a three-month feature freeze during
|
||||
which only bug fixes and doc updates are accepted. New contributions can be
|
||||
sent during a feature freeze but will not be accepted until the freeze thaws.
|
||||
</p>
|
||||
|
||||
<h3 id="scratch">Not sure what change to make?</h3>
|
||||
|
||||
<p>
|
||||
If you want to become familiar with Gerrit and the contribution process,
|
||||
but aren't sure what you'd like to contribute just yet, you can use the <a
|
||||
href="https://go.googlesource.com/scratch">scratch repository</a> to practice
|
||||
making a change.
|
||||
</p>
|
||||
|
||||
<h2 id="making_a_change">Making a change</h2>
|
||||
|
||||
<h3 id="checkout_go">Getting Go Source</h3>
|
||||
<p>
|
||||
First you need to have a local copy of the source checked out from the correct
|
||||
repository.
|
||||
As Go builds Go you will also likely need to have a working version
|
||||
of Go installed (some documentation changes may not need this).
|
||||
This should be a recent version of Go and can be obtained via any package or
|
||||
binary distribution or you can build it from source.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You should checkout the Go source repo anywhere you want as long as it's
|
||||
outside of your $GOPATH.
|
||||
Go to a directory where you want the source to appear and run the following
|
||||
command in a terminal.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/go
|
||||
$ cd go
|
||||
</pre>
|
||||
|
||||
<h3 id="master">Contributing to the main Go tree</h3>
|
||||
<h3 id="master">Switch to the master branch</h3>
|
||||
|
||||
<p>
|
||||
Most Go installations use a release branch, but new changes should
|
||||
only be made based on the master branch. <br>
|
||||
only be made based on the master branch.
|
||||
(They may be applied later to a release branch as part of the release process,
|
||||
but most contributors won't do this themselves.)
|
||||
Before making a change, make sure you start on the master branch:
|
||||
@@ -352,61 +297,10 @@ $ git sync
|
||||
<code>git</code> <code>pull</code> <code>-r</code>.)
|
||||
</p>
|
||||
|
||||
<h3 id="subrepos">Contributing to subrepositories (golang.org/x/...)</h3>
|
||||
|
||||
<p>
|
||||
If you are contributing a change to a subrepository, obtain the
|
||||
Go package using <code>go get</code>. For example, to contribute
|
||||
to <code>golang.org/x/oauth2</code>, check out the code by running:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go get -d golang.org/x/oauth2/...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Then, change your directory to the package's source directory
|
||||
(<code>$GOPATH/src/golang.org/x/oauth2</code>).
|
||||
</p>
|
||||
|
||||
<h3 id="change">Make your changes</h3>
|
||||
|
||||
<p>
|
||||
The entire checked-out tree is editable.
|
||||
Make your changes as you see fit ensuring that you create appropriate
|
||||
tests along with your changes. Test your changes as you go.
|
||||
</p>
|
||||
|
||||
<h3 id="copyright">Copyright</h3>
|
||||
|
||||
<p>
|
||||
Files in the Go repository don't list author names, both to avoid clutter
|
||||
and to avoid having to keep the lists up to date.
|
||||
Instead, your name will appear in the
|
||||
<a href="https://golang.org/change">change log</a> and in the <a
|
||||
href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file and perhaps the <a
|
||||
href="/AUTHORS"><code>AUTHORS</code></a> file.
|
||||
These files are automatically generated from the commit logs periodically.
|
||||
The <a href="/AUTHORS"><code>AUTHORS</code></a> file defines who “The Go
|
||||
Authors”—the copyright holders—are.
|
||||
</p>
|
||||
|
||||
<p>New files that you contribute should use the standard copyright header:</p>
|
||||
|
||||
<pre>
|
||||
// Copyright 2018 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.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Files in the repository are copyright the year they are added.
|
||||
Do not update the copyright year on files that you change.
|
||||
</p>
|
||||
|
||||
<h3 id="commit_changes">Commit your changes</h3>
|
||||
<h3 id="change">Make a change</h3>
|
||||
|
||||
<p>
|
||||
The entire checked-out tree is writable.
|
||||
Once you have edited files, you must tell Git that they have been modified.
|
||||
You must also tell Git about any files that are added, removed, or renamed files.
|
||||
These operations are done with the usual Git commands,
|
||||
@@ -417,26 +311,16 @@ and
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Once you have the changes queued up, you will want to commit them.
|
||||
In the Go contribution workflow this is done with a <code>git</code>
|
||||
<code>change</code> command, which creates a local branch and commits the changes
|
||||
directly to that local branch.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The workflow described here assumes a single change per branch.
|
||||
It is also possible to prepare a sequence of (usually related) changes in a single branch.
|
||||
See the <a href="https://golang.org/x/review/git-codereview">git-codereview documentation</a> for details.
|
||||
</p>
|
||||
If you wish to checkpoint your work, or are ready to send the code out for review, run</p>
|
||||
|
||||
<pre>
|
||||
$ git change <i><branch></i>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
from any directory in your Go repository to commit the changes so far.
|
||||
The name <i><branch></i> is an arbitrary one you choose to identify the
|
||||
local branch containing your changes and will not be used elsewhere.
|
||||
This is an offline operation and nothing will be sent to the server yet.
|
||||
local branch containing your changes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -447,11 +331,9 @@ then <code>git</code> <code>commit</code>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
As the <code>git</code> <code>commit</code> is the final step, Git will open an
|
||||
editor to ask for a commit message. (It uses the editor named by
|
||||
the <code>$EDITOR</code> environment variable,
|
||||
Git will open a change description file in your editor.
|
||||
(It uses the editor named by the <code>$EDITOR</code> environment variable,
|
||||
<code>vi</code> by default.)
|
||||
|
||||
The file will look like:
|
||||
</p>
|
||||
|
||||
@@ -470,7 +352,7 @@ At the beginning of this file is a blank line; replace it
|
||||
with a thorough description of your change.
|
||||
The first line of the change description is conventionally a one-line
|
||||
summary of the change, prefixed by the primary affected package,
|
||||
and is used as the subject for code review email.
|
||||
and is used as the subject for code review mail.
|
||||
It should complete the sentence "This change modifies Go to _____."
|
||||
The rest of the description elaborates and should provide context for the
|
||||
change and explain what it does.
|
||||
@@ -505,7 +387,7 @@ Fixes #159
|
||||
|
||||
<p>
|
||||
The commented section of the file lists all the modified files in your client.
|
||||
It is best to keep unrelated changes in different commits,
|
||||
It is best to keep unrelated changes in different change lists,
|
||||
so if you see a file listed that should not be included, abort
|
||||
the command and move that file to a different branch.
|
||||
</p>
|
||||
@@ -513,7 +395,7 @@ the command and move that file to a different branch.
|
||||
<p>
|
||||
The special notation "Fixes #159" associates the change with issue 159 in the
|
||||
<a href="https://golang.org/issue/159">Go issue tracker</a>.
|
||||
When this change is eventually applied, the issue
|
||||
When this change is eventually submitted, the issue
|
||||
tracker will automatically mark the issue as fixed.
|
||||
(There are several such conventions, described in detail in the
|
||||
<a href="https://help.github.com/articles/closing-issues-via-commit-messages/">GitHub Issue Tracker documentation</a>.)
|
||||
@@ -524,13 +406,6 @@ Once you have finished writing the commit message,
|
||||
save the file and exit the editor.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You must have the $EDITOR environment variable set properly and working properly (exiting cleanly)
|
||||
for this operation to succeed.
|
||||
If you run into any issues at this step, it's likely your editor isn't exiting cleanly.
|
||||
Try setting a different editor in your $EDITOR environment variable.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you wish to do more editing, re-stage your changes using
|
||||
<code>git</code> <code>add</code>, and then run
|
||||
@@ -541,8 +416,8 @@ $ git change
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
to update the change description and incorporate the staged changes.
|
||||
The change description contains a <code>Change-Id</code> line near the bottom,
|
||||
to update the change description and incorporate the staged changes. The
|
||||
change description contains a <code>Change-Id</code> line near the bottom,
|
||||
added by a Git commit hook during the initial
|
||||
<code>git</code> <code>change</code>.
|
||||
That line is used by Gerrit to match successive uploads of the same change.
|
||||
@@ -554,44 +429,35 @@ Do not edit or delete it.
|
||||
runs <code>git</code> <code>commit</code> <code>--amend</code>.)
|
||||
</p>
|
||||
|
||||
<h3 id="Testing">Testing</h3>
|
||||
<h3 id="mail">Mail the change for review</h3>
|
||||
|
||||
<p>
|
||||
You've <a href="code.html">written and tested your code</a>, but
|
||||
before sending code out for review, run all the tests for the whole
|
||||
tree to make sure the changes don't break other packages or programs:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ cd go/src
|
||||
$ ./all.bash
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
(To build under Windows use <code>all.bat</code>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
After running for a while, the command should print
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
"ALL TESTS PASSED".
|
||||
</pre>
|
||||
|
||||
<h3 id="mail">Send the change for review</h3>
|
||||
|
||||
<p>
|
||||
Once the change is ready, send it for review.
|
||||
This is similar to a <code>git push</code> in a GitHub style workflow.
|
||||
This is done via the mail alias setup earlier which despite its name, doesn't
|
||||
directly mail anything, it simply sends the change to Gerrit via git push.
|
||||
Once the change is ready, mail it out for review:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git mail
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
You can specify a reviewer or CC interested parties
|
||||
using the <code>-r</code> or <code>-cc</code> options.
|
||||
Both accept a comma-separated list of email addresses:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Unless explicitly told otherwise, such as in the discussion leading
|
||||
up to sending in the change list, it's better not to specify a reviewer.
|
||||
All changes are automatically CC'ed to the
|
||||
<a href="https://groups.google.com/group/golang-codereviews">golang-codereviews@googlegroups.com</a>
|
||||
mailing list. If this is your first ever change, there may be a moderation
|
||||
delay before it appears on the mailing list, to prevent spam.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
(In Git terms, <code>git</code> <code>mail</code> pushes the local committed
|
||||
changes to Gerrit using <code>git</code> <code>push</code> <code>origin</code>
|
||||
@@ -600,7 +466,7 @@ changes to Gerrit using <code>git</code> <code>push</code> <code>origin</code>
|
||||
|
||||
<p>
|
||||
If your change relates to an open issue, please add a comment to the issue
|
||||
announcing your proposed fix, including a link to your change.
|
||||
announcing your proposed fix, including a link to your CL.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -613,76 +479,7 @@ remote: New Changes:
|
||||
remote: https://go-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments
|
||||
</pre>
|
||||
|
||||
<h3>Troubleshooting</h3>
|
||||
|
||||
<p>
|
||||
The most common way that the <code>git mail</code> command fails is because the
|
||||
email address used has not gone through the setup above.
|
||||
<br>
|
||||
If you see something like...
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
remote: Processing changes: refs: 1, done
|
||||
remote:
|
||||
remote: ERROR: In commit ab13517fa29487dcf8b0d48916c51639426c5ee9
|
||||
remote: ERROR: author email address XXXXXXXXXXXXXXXXXXX
|
||||
remote: ERROR: does not match your user account.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
You need to either add the email address listed to the CLA or set this repo to use
|
||||
another email address already approved.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
First let's change the email address for this repo so this doesn't happen again.
|
||||
You can change your email address for this repo with the following command:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git config user.email email@address.com
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Then change the previous commit to use this alternative email address.
|
||||
You can do that with:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git commit --amend --author="Author Name <email@address.com>"
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Finally try to resend with:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git mail
|
||||
</pre>
|
||||
|
||||
<h3 id="cc">Specifying a reviewer / CCing others</h3>
|
||||
|
||||
<p>
|
||||
Unless explicitly told otherwise, such as in the discussion leading
|
||||
up to sending in the change, it's better not to specify a reviewer.
|
||||
All changes are automatically CC'ed to the
|
||||
<a href="https://groups.google.com/group/golang-codereviews">golang-codereviews@googlegroups.com</a>
|
||||
mailing list. If this is your first ever change, there may be a moderation
|
||||
delay before it appears on the mailing list, to prevent spam.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You can specify a reviewer or CC interested parties
|
||||
using the <code>-r</code> or <code>-cc</code> options.
|
||||
Both accept a comma-separated list of email addresses:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com
|
||||
</pre>
|
||||
|
||||
<h2 id="review">Going through the review process</h2>
|
||||
<h3 id="review">Reviewing code</h3>
|
||||
|
||||
<p>
|
||||
Running <code>git</code> <code>mail</code> will send an email to you and the
|
||||
@@ -690,30 +487,22 @@ reviewers asking them to visit the issue's URL and make comments on the change.
|
||||
When done, the reviewer adds comments through the Gerrit user interface
|
||||
and clicks "Reply" to send comments back.
|
||||
You will receive a mail notification when this happens.
|
||||
You may reply through the web interface or
|
||||
<a href="https://gerrit-review.googlesource.com/Documentation/intro-user.html#reply-by-email">via email</a>.
|
||||
You must reply through the web interface.
|
||||
(Unlike with the old Rietveld review system, replying by mail has no effect.)
|
||||
</p>
|
||||
|
||||
<h3 id="revise">Revise and resend</h3>
|
||||
<h3 id="revise">Revise and upload</h3>
|
||||
|
||||
<p>
|
||||
The Go contribution workflow is optimized for iterative revisions based on
|
||||
feedback.
|
||||
It is rare that an initial contribution will be ready to be applied as is.
|
||||
As you revise your contribution and resend Gerrit will retain a history of
|
||||
all the changes and comments made in the single URL.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You may respond to review comments through the web interface or
|
||||
<a href="https://gerrit-review.googlesource.com/Documentation/intro-user.html#reply-by-email">via email</a>.
|
||||
You must respond to review comments through the web interface.
|
||||
(Unlike with the old Rietveld review system, responding by mail has no effect.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When you have revised the code and are ready for another round of review,
|
||||
stage those changes and use <code>git</code> <code>change</code> to update the
|
||||
commit.
|
||||
To send the updated change for another round of review,
|
||||
To send the update change list for another round of review,
|
||||
run <code>git</code> <code>mail</code> again.
|
||||
</p>
|
||||
|
||||
@@ -745,8 +534,6 @@ $ git sync
|
||||
<code>git</code> <code>pull</code> <code>-r</code>.)
|
||||
</p>
|
||||
|
||||
<h3 id="resolving_conflicts">Resolving Conflicts</h3>
|
||||
|
||||
<p>
|
||||
If files you were editing have changed, Git does its best to merge the
|
||||
remote changes into your local changes.
|
||||
@@ -822,8 +609,8 @@ might turn up:
|
||||
<p>
|
||||
Git doesn't show it, but suppose the original text that both edits
|
||||
started with was 1e8; you changed it to 1e10 and the other change to 1e9,
|
||||
so the correct answer might now be 1e10.
|
||||
First, edit the section to remove the markers and leave the correct code:
|
||||
so the correct answer might now be 1e10. First, edit the section
|
||||
to remove the markers and leave the correct code:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -852,13 +639,10 @@ restore the change commit.
|
||||
<h3 id="download">Reviewing code by others</h3>
|
||||
|
||||
<p>
|
||||
As part of the review process reviewers can propose changes directly (in the
|
||||
GitHub workflow this would be someone else attaching commits to a pull request).
|
||||
|
||||
You can import these changes proposed by someone else into your local Git repository.
|
||||
You can import a change proposed by someone else into your local Git repository.
|
||||
On the Gerrit review page, click the "Download ▼" link in the upper right
|
||||
corner, copy the "Checkout" command and run it from your local Git repo. It
|
||||
should look something like this:
|
||||
corner, copy the "Checkout" command and run it from your local Git repo.
|
||||
It should look something like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -869,11 +653,11 @@ $ git fetch https://go.googlesource.com/review refs/changes/21/1221/1 &&
|
||||
To revert, change back to the branch you were working in.
|
||||
</p>
|
||||
|
||||
<h2 id="submit">Apply the change to the master branch</h2>
|
||||
<h3 id="submit">Submit the change after the review</h3>
|
||||
|
||||
<p>
|
||||
After the code has been <code>LGTM</code>'ed, an approver may
|
||||
apply it to the master branch using the Gerrit UI.
|
||||
submit it to the master branch using the Gerrit UI.
|
||||
There is a "Submit" button on the web page for the change
|
||||
that appears once the change is approved (marked +2).
|
||||
</p>
|
||||
@@ -885,13 +669,41 @@ and the code review will be updated with a link to the change
|
||||
in the repository.
|
||||
Since the method used to integrate the changes is "Cherry Pick",
|
||||
the commit hashes in the repository will be changed by
|
||||
the "Submit" operation.
|
||||
the submit operation.
|
||||
</p>
|
||||
|
||||
<h2 id="more">More information</h2>
|
||||
<h3 id="more">More information</h3>
|
||||
|
||||
<p>
|
||||
In addition to the information here, the Go community maintains a <a
|
||||
href="https://golang.org/wiki/CodeReview">CodeReview</a> wiki page.
|
||||
In addition to the information here, the Go community maintains a <a href="https://golang.org/wiki/CodeReview">CodeReview</a> wiki page.
|
||||
Feel free to contribute to this page as you learn the review process.
|
||||
</p>
|
||||
|
||||
<h2 id="copyright">Copyright</h2>
|
||||
|
||||
<p>Files in the Go repository don't list author names,
|
||||
both to avoid clutter and to avoid having to keep the lists up to date.
|
||||
Instead, your name will appear in the
|
||||
<a href="https://golang.org/change">change log</a>
|
||||
and in the <a href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file
|
||||
and perhaps the <a href="/AUTHORS"><code>AUTHORS</code></a> file.
|
||||
</p>
|
||||
|
||||
<p>The <a href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file
|
||||
defines who the Go contributors—the people—are;
|
||||
the <a href="/AUTHORS"><code>AUTHORS</code></a> file defines
|
||||
who “The Go Authors”—the copyright holders—are.
|
||||
These files will be periodically updated based on the commit logs.
|
||||
|
||||
<p>Code that you contribute should use the standard copyright header:</p>
|
||||
|
||||
<pre>
|
||||
// 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.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Files in the repository are copyright the year they are added. It is not
|
||||
necessary to update the copyright year on files that you change.
|
||||
</p>
|
||||
|
||||
@@ -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="http://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, Mac OS X, FreeBSD or NetBSD, the resulting binaries contain DWARFv4
|
||||
debugging information that recent versions (≥7.5) of the GDB debugger can
|
||||
on Linux, Mac OS X, FreeBSD or NetBSD, the resulting binaries contain DWARFv3
|
||||
debugging information that recent versions (>7.1) of the GDB debugger can
|
||||
use to inspect a live process or a core dump.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Pass the <code>'-w'</code> flag to the linker to omit the debug information
|
||||
(for example, <code>go</code> <code>build</code> <code>-ldflags=-w</code> <code>prog.go</code>).
|
||||
(for example, <code>go build -ldflags "-w" prog.go</code>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The code generated by the <code>gc</code> compiler includes inlining of
|
||||
function invocations and registerization of variables. These optimizations
|
||||
can sometimes make debugging with <code>gdb</code> harder.
|
||||
If you find that you need to disable these optimizations,
|
||||
build your program using <code>go</code> <code>build</code> <code>-gcflags=all="-N -l"</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you want to use gdb to inspect a core dump, you can trigger a dump
|
||||
on a program crash, on systems that permit it, by setting
|
||||
<code>GOTRACEBACK=crash</code> in the environment (see the
|
||||
<a href="/pkg/runtime/#hdr-Environment_Variables"> runtime package
|
||||
documentation</a> for more info).
|
||||
can sometimes make debugging with <code>gdb</code> harder. To disable them
|
||||
when debugging, pass the flags <code>-gcflags "-N -l"</code> to the
|
||||
<a href="/cmd/go"><code>go</code></a> command used to build the code being
|
||||
debugged.
|
||||
</p>
|
||||
|
||||
<h3 id="Common_Operations">Common Operations</h3>
|
||||
@@ -119,7 +85,7 @@ Show the name, type and location of global variables:
|
||||
|
||||
<p>
|
||||
A recent extension mechanism to GDB allows it to load extension scripts for a
|
||||
given binary. The toolchain uses this to extend GDB with a handful of
|
||||
given binary. The tool chain uses this to extend GDB with a handful of
|
||||
commands to inspect internals of the runtime code (such as goroutines) and to
|
||||
pretty print the built-in map, slice and channel types.
|
||||
</p>
|
||||
@@ -164,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>
|
||||
|
||||
@@ -187,7 +153,7 @@ the form <code>pkg.(*MyType).Meth</code>.
|
||||
<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>
|
||||
|
||||
@@ -213,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>
|
||||
|
||||
@@ -378,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>
|
||||
@@ -411,9 +377,7 @@ $3 = struct hchan<*testing.T>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
That <code>struct</code> <code>hchan<*testing.T></code> is the
|
||||
runtime-internal representation of a channel. It is currently empty,
|
||||
or gdb would have pretty-printed its contents.
|
||||
That <code>struct hchan<*testing.T></code> is the runtime-internal representation of a channel. It is currently empty, or gdb would have pretty-printed it's contents.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -15,155 +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.8 is supported until Go 1.10 is released,
|
||||
and Go 1.9 is supported until Go 1.11 is released.
|
||||
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.9.1, Go 1.9.2, and so on).
|
||||
</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">Go
|
||||
1.10.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.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">Go
|
||||
1.10.2 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">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">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">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">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">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">Go
|
||||
1.9.6 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 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>
|
||||
@@ -205,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>
|
||||
@@ -339,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>
|
||||
|
||||
@@ -403,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>
|
||||
|
||||
@@ -419,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.
|
||||
|
||||
@@ -1,458 +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/pprof.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/pprof.md">go tool pprof</a></code>.
|
||||
Read <a href="https://blog.golang.org/profiling-go-programs">Profiling Go programs</a>
|
||||
to see them in action.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/pprof-text.png">
|
||||
<br>
|
||||
<small>Listing of the most expensive calls as text.</small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/pprof-dot.png">
|
||||
<br>
|
||||
<small>Visualization of the most expensive calls as a graph.</small>
|
||||
</p>
|
||||
|
||||
<p>Weblist view displays the expensive parts of the source line by line in
|
||||
an HTML page. In the following example, 530ms is spent in the
|
||||
<code>runtime.concatstrings</code> and cost of each line is presented
|
||||
in the listing.</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/pprof-weblist.png">
|
||||
<br>
|
||||
<small>Visualization of the most expensive calls as weblist.</small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Another way to visualize profile data is a <a href="http://www.brendangregg.com/flamegraphs.html">flame graph</a>.
|
||||
Flame graphs allow you to move in a specific ancestry path, so you can zoom
|
||||
in/out of specific sections of code.
|
||||
The <a href="https://github.com/google/pprof">upstream pprof</a>
|
||||
has support for flame graphs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/flame.png">
|
||||
<br>
|
||||
<small>Flame graphs offers visualization to spot the most expensive code-paths.</small>
|
||||
</p>
|
||||
|
||||
<p><strong>Am I restricted to the built-in profiles?</strong></p>
|
||||
|
||||
<p>
|
||||
Additionally to what is provided by the runtime, Go users can create
|
||||
their custom profiles via <a href="/pkg/runtime/pprof/#Profile">pprof.Profile</a>
|
||||
and use the existing tools to examine them.
|
||||
</p>
|
||||
|
||||
<p><strong>Can I serve the profiler handlers (/debug/pprof/...) on a different path and port?</strong></p>
|
||||
|
||||
<p>
|
||||
Yes. The <code>net/http/pprof</code> package registers its handlers to the default
|
||||
mux by default, but you can also register them yourself by using the handlers
|
||||
exported from the package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For example, the following example will serve the pprof.Profile
|
||||
handler on :7777 at /custom_debug_path/profile:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
)
|
||||
|
||||
func main() {
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/custom_debug_path/profile", pprof.Profile)
|
||||
log.Fatal(http.ListenAndServe(":7777", mux))
|
||||
}
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<h2 id="tracing">Tracing</h2>
|
||||
|
||||
<p>
|
||||
Tracing is a way to instrument code to analyze latency throughout the
|
||||
lifecycle of a chain of calls. Go provides
|
||||
<a href="https://godoc.org/golang.org/x/net/trace">golang.org/x/net/trace</a>
|
||||
package as a minimal tracing backend per Go node and provides a minimal
|
||||
instrumentation library with a simple dashboard. Go also provides
|
||||
an execution tracer to trace the runtime events within an interval.
|
||||
</p>
|
||||
|
||||
<p>Tracing enables us to:</p>
|
||||
|
||||
<ul>
|
||||
<li>Instrument and analyze application latency in a Go process.</li>
|
||||
<li>Measure the cost of specific calls in a long chain of calls.</li>
|
||||
<li>Figure out the utilization and performance improvements.
|
||||
Bottlenecks are not always obvious without tracing data.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
In monolithic systems, it's relatively easy to collect diagnostic data
|
||||
from the building blocks of a program. All modules live within one
|
||||
process and share common resources to report logs, errors, and other
|
||||
diagnostic information. Once your system grows beyond a single process and
|
||||
starts to become distributed, it becomes harder to follow a call starting
|
||||
from the front-end web server to all of its back-ends until a response is
|
||||
returned back to the user. This is where distributed tracing plays a big
|
||||
role to instrument and analyze your production systems.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed tracing is a way to instrument code to analyze latency throughout
|
||||
the lifecycle of a user request. When a system is distributed and when
|
||||
conventional profiling and debugging tools don’t scale, you might want
|
||||
to use distributed tracing tools to analyze the performance of your user
|
||||
requests and RPCs.
|
||||
</p>
|
||||
|
||||
<p>Distributed tracing enables us to:</p>
|
||||
|
||||
<ul>
|
||||
<li>Instrument and profile application latency in a large system.</li>
|
||||
<li>Track all RPCs within the lifecycle of a user request and see integration issues
|
||||
that are only visible in production.</li>
|
||||
<li>Figure out performance improvements that can be applied to our systems.
|
||||
Many bottlenecks are not obvious before the collection of tracing data.</li>
|
||||
</ul>
|
||||
|
||||
<p>The Go ecosystem provides various distributed tracing libraries per tracing system
|
||||
and backend-agnostic ones.</p>
|
||||
|
||||
|
||||
<p><strong>Is there a way to automatically intercept each function call and create traces?</strong></p>
|
||||
|
||||
<p>
|
||||
Go doesn’t provide a way to automatically intercept every function call and create
|
||||
trace spans. You need to manually instrument your code to create, end, and annotate spans.
|
||||
</p>
|
||||
|
||||
<p><strong>How should I propagate trace headers in Go libraries?</strong></p>
|
||||
|
||||
<p>
|
||||
You can propagate trace identifiers and tags in the
|
||||
<a href="/pkg/context#Context"><code>context.Context</code></a>.
|
||||
There is no canonical trace key or common representation of trace headers
|
||||
in the industry yet. Each tracing provider is responsible for providing propagation
|
||||
utilities in their Go libraries.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>What other low-level events from the standard library or
|
||||
runtime can be included in a trace?</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The standard library and runtime are trying to expose several additional APIs
|
||||
to notify on low level internal events. For example,
|
||||
<a href="/pkg/net/http/httptrace#ClientTrace"><code>httptrace.ClientTrace</code></a>
|
||||
provides APIs to follow low-level events in the life cycle of an outgoing request.
|
||||
There is an ongoing effort to retrieve low-level runtime events from
|
||||
the runtime execution tracer and allow users to define and record their user events.
|
||||
</p>
|
||||
|
||||
<h2 id="debugging">Debugging</h2>
|
||||
|
||||
<p>
|
||||
Debugging is the process of identifying why a program misbehaves.
|
||||
Debuggers allow us to understand a program’s execution flow and current state.
|
||||
There are several styles of debugging; this section will only focus on attaching
|
||||
a debugger to a program and core dump debugging.
|
||||
</p>
|
||||
|
||||
<p>Go users mostly use the following debuggers:</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/derekparker/delve">Delve</a>:
|
||||
Delve is a debugger for the Go programming language. It has
|
||||
support for Go’s runtime concepts and built-in types. Delve is
|
||||
trying to be a fully featured reliable debugger for Go programs.
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://golang.org/doc/gdb">GDB</a>:
|
||||
Go provides GDB support via the standard Go compiler and Gccgo.
|
||||
The stack management, threading, and runtime contain aspects that differ
|
||||
enough from the execution model GDB expects that they can confuse the
|
||||
debugger, even when the program is compiled with gccgo. Even though
|
||||
GDB can be used to debug Go programs, it is not ideal and may
|
||||
create confusion.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p><strong>How well do debuggers work with Go programs?</strong></p>
|
||||
|
||||
<p>
|
||||
The <code>gc</code> compiler performs optimizations such as
|
||||
function inlining and variable registerization. These optimizations
|
||||
sometimes make debugging with debuggers harder. There is an ongoing
|
||||
effort to improve the quality of the DWARF information generated for
|
||||
optimized binaries. Until those improvements are available, we recommend
|
||||
disabling optimizations when building the code being debugged. The following
|
||||
command builds a package with no compiler optimizations:
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
$ go build -gcflags=all="-N -l"
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
As part of the improvement effort, Go 1.10 introduced a new compiler
|
||||
flag <code>-dwarflocationlists</code>. The flag causes the compiler to
|
||||
add location lists that helps debuggers work with optimized binaries.
|
||||
The following command builds a package with optimizations but with
|
||||
the DWARF location lists:
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
$ go build -gcflags="-dwarflocationlists=true"
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<p><strong>What’s the recommended debugger user interface?</strong></p>
|
||||
|
||||
<p>
|
||||
Even though both delve and gdb provides CLIs, most editor integrations
|
||||
and IDEs provides debugging-specific user interfaces.
|
||||
</p>
|
||||
|
||||
<p><strong>Is it possible to do postmortem debugging with Go programs?</strong></p>
|
||||
|
||||
<p>
|
||||
A core dump file is a file that contains the memory dump of a running
|
||||
process and its process status. It is primarily used for post-mortem
|
||||
debugging of a program and to understand its state
|
||||
while it is still running. These two cases make debugging of core
|
||||
dumps a good diagnostic aid to postmortem and analyze production
|
||||
services. It is possible to obtain core files from Go programs and
|
||||
use delve or gdb to debug, see the
|
||||
<a href="https://golang.org/wiki/CoreDumpDebugging">core dump debugging</a>
|
||||
page for a step-by-step guide.
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime statistics and events</h2>
|
||||
|
||||
<p>
|
||||
The runtime provides stats and reporting of internal events for
|
||||
users to diagnose performance and utilization problems at the
|
||||
runtime level.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Users can monitor these stats to better understand the overall
|
||||
health and performance of Go programs.
|
||||
Some frequently monitored stats and states:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><code><a href="/pkg/runtime/#ReadMemStats">runtime.ReadMemStats</a></code>
|
||||
reports the metrics related to heap
|
||||
allocation and garbage collection. Memory stats are useful for
|
||||
monitoring how much memory resources a process is consuming,
|
||||
whether the process can utilize memory well, and to catch
|
||||
memory leaks.</li>
|
||||
<li><code><a href="/pkg/runtime/debug/#ReadGCStats">debug.ReadGCStats</a></code>
|
||||
reads statistics about garbage collection.
|
||||
It is useful to see how much of the resources are spent on GC pauses.
|
||||
It also reports a timeline of garbage collector pauses and pause time percentiles.</li>
|
||||
<li><code><a href="/pkg/runtime/debug/#Stack">debug.Stack</a></code>
|
||||
returns the current stack trace. Stack trace
|
||||
is useful to see how many goroutines are currently running,
|
||||
what they are doing, and whether they are blocked or not.</li>
|
||||
<li><code><a href="/pkg/runtime/debug/#WriteHeapDump">debug.WriteHeapDump</a></code>
|
||||
suspends the execution of all goroutines
|
||||
and allows you to dump the heap to a file. A heap dump is a
|
||||
snapshot of a Go process' memory at a given time. It contains all
|
||||
allocated objects as well as goroutines, finalizers, and more.</li>
|
||||
<li><code><a href="/pkg/runtime#NumGoroutine">runtime.NumGoroutine</a></code>
|
||||
returns the number of current goroutines.
|
||||
The value can be monitored to see whether enough goroutines are
|
||||
utilized, or to detect goroutine leaks.</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="execution-tracer">Execution tracer</h3>
|
||||
|
||||
<p>Go comes with a runtime execution tracer to capture a wide range
|
||||
of runtime events. Scheduling, syscall, garbage collections,
|
||||
heap size, and other events are collected by runtime and available
|
||||
for visualization by the go tool trace. Execution tracer is a tool
|
||||
to detect latency and utilization problems. You can examine how well
|
||||
the CPU is utilized, and when networking or syscalls are a cause of
|
||||
preemption for the goroutines.</p>
|
||||
|
||||
<p>Tracer is useful to:</p>
|
||||
<ul>
|
||||
<li>Understand how your goroutines execute.</li>
|
||||
<li>Understand some of the core runtime events such as GC runs.</li>
|
||||
<li>Identify poorly parallelized execution.</li>
|
||||
</ul>
|
||||
|
||||
<p>However, it is not great for identifying hot spots such as
|
||||
analyzing the cause of excessive memory or CPU usage.
|
||||
Use profiling tools instead first to address them.</p>
|
||||
|
||||
<p>
|
||||
<img width="800" src="https://storage.googleapis.com/golangorg-assets/tracer-lock.png">
|
||||
</p>
|
||||
|
||||
<p>Above, the go tool trace visualization shows the execution started
|
||||
fine, and then it became serialized. It suggests that there might
|
||||
be lock contention for a shared resource that creates a bottleneck.</p>
|
||||
|
||||
<p>See <a href="https://golang.org/cmd/trace/"><code>go</code> <code>tool</code> <code>trace</code></a>
|
||||
to collect and analyze runtime traces.
|
||||
</p>
|
||||
|
||||
<h3 id="godebug">GODEBUG</h3>
|
||||
|
||||
<p>Runtime also emits events and information if
|
||||
<a href="https://golang.org/pkg/runtime/#hdr-Environment_Variables">GODEBUG</a>
|
||||
environmental variable is set accordingly.</p>
|
||||
|
||||
<ul>
|
||||
<li>GODEBUG=gctrace=1 prints garbage collector events at
|
||||
each collection, summarizing the amount of memory collected
|
||||
and the length of the pause.</li>
|
||||
<li>GODEBUG=schedtrace=X prints scheduling events every X milliseconds.</li>
|
||||
</ul>
|
||||
@@ -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>
|
||||
<p>
|
||||
<pre>
|
||||
$ go get golang.org/x/tour/gotour
|
||||
</pre>
|
||||
<p>
|
||||
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,7 +163,7 @@ 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"/>
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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="http://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 comphensive
|
||||
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>
|
||||
@@ -1431,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>
|
||||
@@ -1519,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,
|
||||
@@ -1578,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>
|
||||
@@ -1831,7 +1833,7 @@ for a min function that chooses the least of a list of integers:
|
||||
</p>
|
||||
<pre>
|
||||
func Min(a ...int) int {
|
||||
min := int(^uint(0) >> 1) // largest int
|
||||
min := int(^uint(0) >> 1) // largest int
|
||||
for _, i := range a {
|
||||
if i < min {
|
||||
min = i
|
||||
@@ -2790,7 +2792,7 @@ job := &Job{command, log.New(os.Stderr, "Job: ", log.Ldate)}
|
||||
<p>
|
||||
If we need to refer to an embedded field directly, the type name of the field,
|
||||
ignoring the package qualifier, serves as a field name, as it did
|
||||
in the <code>Read</code> method of our <code>ReadWriter</code> struct.
|
||||
in the <code>Read</code> method of our <code>ReaderWriter</code> struct.
|
||||
Here, if we needed to access the
|
||||
<code>*log.Logger</code> of a <code>Job</code> variable <code>job</code>,
|
||||
we would write <code>job.Logger</code>,
|
||||
|
||||
@@ -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>
|
||||
@@ -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>.
|
||||
|
||||
@@ -166,7 +166,7 @@ providing a complete Go 1.1 implementation.
|
||||
<h3 id="gc_flag">Command-line flag parsing</h3>
|
||||
|
||||
<p>
|
||||
In the gc toolchain, the compilers and linkers now use the
|
||||
In the gc tool chain, the compilers and linkers now use the
|
||||
same command-line flag parsing rules as the Go flag package, a departure
|
||||
from the traditional Unix flag parsing. This may affect scripts that invoke
|
||||
the tool directly.
|
||||
@@ -305,7 +305,7 @@ The race detector is documented in <a href="/doc/articles/race_detector.html">a
|
||||
<p>
|
||||
Due to the change of the <a href="#int"><code>int</code></a> to 64 bits and
|
||||
a new internal <a href="//golang.org/s/go11func">representation of functions</a>,
|
||||
the arrangement of function arguments on the stack has changed in the gc toolchain.
|
||||
the arrangement of function arguments on the stack has changed in the gc tool chain.
|
||||
Functions written in assembly will need to be revised at least
|
||||
to adjust frame pointer offsets.
|
||||
</p>
|
||||
@@ -395,7 +395,7 @@ Run <code>go help test</code> for more information.
|
||||
The <a href="/cmd/fix/"><code>fix</code></a> command, usually run as
|
||||
<code>go fix</code>, no longer applies fixes to update code from
|
||||
before Go 1 to use Go 1 APIs.
|
||||
To update pre-Go 1 code to Go 1.1, use a Go 1.0 toolchain
|
||||
To update pre-Go 1 code to Go 1.1, use a Go 1.0 tool chain
|
||||
to convert the code to Go 1.0 first.
|
||||
</p>
|
||||
|
||||
@@ -427,7 +427,7 @@ To build a file only with Go 1.0.x, use the converse constraint:
|
||||
<h3 id="platforms">Additional platforms</h3>
|
||||
|
||||
<p>
|
||||
The Go 1.1 toolchain adds experimental support for <code>freebsd/arm</code>,
|
||||
The Go 1.1 tool chain adds experimental support for <code>freebsd/arm</code>,
|
||||
<code>netbsd/386</code>, <code>netbsd/amd64</code>, <code>netbsd/arm</code>,
|
||||
<code>openbsd/386</code> and <code>openbsd/amd64</code> platforms.
|
||||
</p>
|
||||
|
||||
1448
doc/go1.10.html
1448
doc/go1.10.html
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -15,7 +15,12 @@ Do not send CLs removing the interior tags from such phrases.
|
||||
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
55
doc/go1.8.txt
Normal 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)
|
||||
1024
doc/go1.9.html
1024
doc/go1.9.html
File diff suppressed because it is too large
Load Diff
@@ -775,7 +775,7 @@ to turn a string into an error. It replaces the old <code>os.NewError</code>.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/go1.go" `/ErrSyntax/`}}
|
||||
|
||||
|
||||
<p>
|
||||
<em>Updating</em>:
|
||||
Running <code>go</code> <code>fix</code> will update almost all code affected by the change.
|
||||
@@ -1827,7 +1827,7 @@ for full details.
|
||||
<tr><td>Uitob(x, b)</td> <td>FormatUint(uint64(x), b)</td></tr>
|
||||
<tr><td>Uitob64(x, b)</td> <td>FormatUint(x, b)</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
<p>
|
||||
<em>Updating</em>:
|
||||
Running <code>go</code> <code>fix</code> will update almost all code affected by the change.
|
||||
@@ -1841,7 +1841,7 @@ a cast that must be added by hand; the <code>go</code> <code>fix</code> tool wil
|
||||
<h3 id="templates">The template packages</h3>
|
||||
|
||||
<p>
|
||||
The <code>template</code> and <code>exp/template/html</code> packages have moved to
|
||||
The <code>template</code> and <code>exp/template/html</code> packages have moved to
|
||||
<a href="/pkg/text/template/"><code>text/template</code></a> and
|
||||
<a href="/pkg/html/template/"><code>html/template</code></a>.
|
||||
More significant, the interface to these packages has been simplified.
|
||||
@@ -2035,4 +2035,4 @@ They are available for many combinations of architecture and operating system
|
||||
Installation details are described on the
|
||||
<a href="/doc/install">Getting Started</a> page, while
|
||||
the distributions themselves are listed on the
|
||||
<a href="/dl/">downloads page</a>.
|
||||
<a href="https://golang.org/dl/">downloads page</a>.
|
||||
|
||||
@@ -190,8 +190,8 @@ For details and background, see
|
||||
<h2 id="tools">Tools</h2>
|
||||
|
||||
<p>
|
||||
Finally, the Go toolchain (compilers, linkers, build tools, and so
|
||||
on) is under active development and may change behavior. This
|
||||
Finally, the Go tool chain (compilers, linkers, build tools, and so
|
||||
on) are under active development and may change behavior. This
|
||||
means, for instance, that scripts that depend on the location and
|
||||
properties of the tools may be broken by a point release.
|
||||
</p>
|
||||
|
||||
@@ -479,15 +479,6 @@ as when hosting an untrusted program, the implementation could interlock
|
||||
map access.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Map access is unsafe only when updates are occurring.
|
||||
As long as all goroutines are only reading—looking up elements in the map,
|
||||
including iterating through it using a
|
||||
<code>for</code> <code>range</code> loop—and not changing the map
|
||||
by assigning to elements or doing deletions,
|
||||
it is safe for them to access the map concurrently without synchronization.
|
||||
</p>
|
||||
|
||||
<h3 id="language_changes">
|
||||
Will you accept my language change?</h3>
|
||||
|
||||
@@ -1149,7 +1140,7 @@ program is one tool to help automate this process.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The Go 1.5 release added a facility to the
|
||||
The Go 1.5 release includes an experimental facility to the
|
||||
<a href="https://golang.org/cmd/go">go</a> command
|
||||
that makes it easier to manage external dependencies by "vendoring"
|
||||
them into a special directory near the package that depends upon them.
|
||||
@@ -1157,13 +1148,6 @@ See the <a href="https://golang.org/s/go15vendor">design
|
||||
document</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Work is underway on an experimental package management tool,
|
||||
<a href="https://github.com/golang/dep"><code>dep</code></a>, to learn
|
||||
more about how tooling can help package management. More information can be found in
|
||||
<a href="https://github.com/golang/dep/blob/master/docs/FAQ.md">the <code>dep</code> FAQ</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="Pointers">Pointers and Allocation</h2>
|
||||
|
||||
<h3 id="pass_by_value">
|
||||
@@ -1485,53 +1469,6 @@ For more detail on this topic see the talk entitled,
|
||||
<a href="//blog.golang.org/2013/01/concurrency-is-not-parallelism.html">Concurrency
|
||||
is not Parallelism</a>.
|
||||
|
||||
<h3 id="no_goroutine_id">
|
||||
Why is there no goroutine ID?</h3>
|
||||
|
||||
<p>
|
||||
Goroutines do not have names; they are just anonymous workers.
|
||||
They expose no unique identifier, name, or data structure to the programmer.
|
||||
Some people are surprised by this, expecting the <code>go</code>
|
||||
statement to return some item that can be used to access and control
|
||||
the goroutine later.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The fundamental reason goroutines are anonymous is so that
|
||||
the full Go language is available when programming concurrent code.
|
||||
By contrast, the usage patterns that develop when threads and goroutines are
|
||||
named can restrict what a library using them can do.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Here is an illustration of the difficulties.
|
||||
Once one names a goroutine and constructs a model around
|
||||
it, it becomes special, and one is tempted to associate all computation
|
||||
with that goroutine, ignoring the possibility
|
||||
of using multiple, possibly shared goroutines for the processing.
|
||||
If the <code>net/http</code> package associated per-request
|
||||
state with a goroutine,
|
||||
clients would be unable to use more goroutines
|
||||
when serving a request.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Moreover, experience with libraries such as those for graphics systems
|
||||
that require all processing to occur on the "main thread"
|
||||
has shown how awkward and limiting the approach can be when
|
||||
deployed in a concurrent language.
|
||||
The very existence of a special thread or goroutine forces
|
||||
the programmer to distort the program to avoid crashes
|
||||
and other problems caused by inadvertently operating
|
||||
on the wrong thread.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For those cases where a particular goroutine is truly special,
|
||||
the language provides features such as channels that can be
|
||||
used in flexible ways to interact with it.
|
||||
</p>
|
||||
|
||||
<h2 id="Functions_methods">Functions and Methods</h2>
|
||||
|
||||
<h3 id="different_method_sets">
|
||||
@@ -1851,7 +1788,7 @@ supported by recent modifications to the gold linker.
|
||||
Why is my trivial program such a large binary?</h3>
|
||||
|
||||
<p>
|
||||
The linker in the <code>gc</code> toolchain
|
||||
The linker in the <code>gc</code> tool chain
|
||||
creates statically-linked binaries by default. All Go binaries therefore include the Go
|
||||
run-time, along with the run-time type information necessary to support dynamic
|
||||
type checks, reflection, and even panic-time stack traces.
|
||||
|
||||
568
doc/go_spec.html
568
doc/go_spec.html
File diff suppressed because it is too large
Load Diff
@@ -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.
|
||||
@@ -33,12 +31,10 @@ forum for Go programmers.
|
||||
<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>
|
||||
@@ -63,13 +59,6 @@ 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>
|
||||
@@ -78,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>
|
||||
|
||||
@@ -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
|
||||
@@ -119,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>
|
||||
@@ -127,34 +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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
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>.
|
||||
@@ -222,7 +218,7 @@ To build without <code>cgo</code>, set the environment variable
|
||||
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.9</code>, for example):</p>
|
||||
(<code class="versionTag">go1.7.4</code>, for example):</p>
|
||||
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/go
|
||||
@@ -410,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>
|
||||
@@ -446,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>
|
||||
@@ -457,14 +452,12 @@ 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><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
|
||||
@@ -475,9 +468,8 @@ 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), and
|
||||
<code>s390x</code> (IBM System z 64-bit, big-endian).
|
||||
<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>
|
||||
@@ -541,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>
|
||||
@@ -585,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
|
||||
@@ -604,7 +592,6 @@ 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>
|
||||
|
||||
<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)
|
||||
@@ -614,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)
|
||||
@@ -626,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
|
||||
@@ -637,17 +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)
|
||||
<p>
|
||||
This sets whether to use floating point instructions.
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>GOMIPS=hardfloat</code>: use floating point instructions (the default)</li>
|
||||
<li><code>GOMIPS=softfloat</code>: use soft floating point</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
<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),
|
||||
<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.
|
||||
@@ -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,10 +47,10 @@ 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.8 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>†</sup> that comes with Xcode<sup>‡</sup> for <code>cgo</code> support</td></tr>
|
||||
<tr><td>Windows XP SP2 or later</td> <td>amd64, 386</td> <td>use MinGW gcc<sup>†</sup>. 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>†</sup> that comes with Xcode<sup>‡</sup> for <code>cgo</code> support</td></tr>
|
||||
<tr><td>Windows XP or later</td> <td>amd64, 386</td> <td>use MinGW gcc<sup>†</sup>. No need for cygwin or msys.</td></tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
@@ -77,7 +77,7 @@ first <a href="#uninstall">remove the existing version</a>.
|
||||
<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>
|
||||
@@ -138,7 +138,7 @@ location.
|
||||
<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>
|
||||
@@ -167,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>
|
||||
@@ -185,7 +185,7 @@ 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>
|
||||
@@ -222,7 +222,8 @@ 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>
|
||||
@@ -249,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:\> <b>cd %USERPROFILE%\go\src\hello</b>
|
||||
C:\Users\Gopher\go\src\hello> <b>go build</b>
|
||||
</pre>
|
||||
@@ -266,7 +267,7 @@ $ <b>./hello</b>
|
||||
hello, world
|
||||
</pre>
|
||||
|
||||
<pre class="testWindows">
|
||||
<pre class="testWindows" style="display: none">
|
||||
C:\Users\Gopher\go\src\hello> <b>hello</b>
|
||||
hello, world
|
||||
</pre>
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
146
doc/root.html
146
doc/root.html
@@ -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,7 +56,7 @@ 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>
|
||||
@@ -70,91 +68,85 @@ Linux, Mac OS X, Windows, and more.
|
||||
|
||||
<div style="clear: both"></div>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<div class="left">
|
||||
<div id="video">
|
||||
<div class="rootHeading">Featured video</div>
|
||||
<iframe width="415" height="241" src="//www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
|
||||
<div 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);
|
||||
});
|
||||
|
||||
{{end}}
|
||||
})();
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
@@ -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
|
||||
|
||||
@@ -8,16 +8,16 @@
|
||||
# Consult http://www.iana.org/time-zones for the latest versions.
|
||||
|
||||
# Versions to use.
|
||||
CODE=2017c
|
||||
DATA=2017c
|
||||
CODE=2016j
|
||||
DATA=2016j
|
||||
|
||||
set -e
|
||||
rm -rf work
|
||||
mkdir work
|
||||
cd work
|
||||
mkdir zoneinfo
|
||||
curl -L -O http://www.iana.org/time-zones/repository/releases/tzcode$CODE.tar.gz
|
||||
curl -L -O http://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
|
||||
|
||||
@@ -42,7 +42,7 @@ 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
|
||||
|
||||
Binary file not shown.
@@ -21,22 +21,10 @@ import (
|
||||
)
|
||||
|
||||
func run(args ...string) string {
|
||||
if flags := os.Getenv("GOANDROID_ADB_FLAGS"); flags != "" {
|
||||
args = append(strings.Split(flags, " "), args...)
|
||||
}
|
||||
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 {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package main
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -L/nonexist
|
||||
#cgo LDFLAGS: -c
|
||||
|
||||
void test() {
|
||||
xxx; // ERROR HERE
|
||||
@@ -1,161 +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("src", 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", "-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",
|
||||
"err3.go",
|
||||
"issue7757.go",
|
||||
"issue8442.go",
|
||||
"issue11097a.go",
|
||||
"issue11097b.go",
|
||||
"issue13129.go",
|
||||
"issue13423.go",
|
||||
"issue13467.go",
|
||||
"issue13635.go",
|
||||
"issue13830.go",
|
||||
"issue16116.go",
|
||||
"issue16591.go",
|
||||
"issue18452.go",
|
||||
"issue18889.go",
|
||||
} {
|
||||
check(t, file)
|
||||
}
|
||||
|
||||
if sizeofLongDouble(t) > 8 {
|
||||
check(t, "err4.go")
|
||||
}
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
}
|
||||
@@ -10,5 +10,5 @@ import "C"
|
||||
|
||||
func main() {
|
||||
var x C.ushort
|
||||
x = int(0) // ERROR HERE: C\.ushort
|
||||
x = int(0) // ERROR HERE
|
||||
}
|
||||
24
misc/cgo/errors/issue13635.go
Normal file
24
misc/cgo/errors/issue13635.go
Normal 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
|
||||
)
|
||||
}
|
||||
@@ -4,18 +4,20 @@
|
||||
|
||||
// Tests that cgo detects invalid pointer passing at runtime.
|
||||
|
||||
package errorstest
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
"sync"
|
||||
)
|
||||
|
||||
// ptrTest is the tests without the boilerplate.
|
||||
@@ -341,163 +343,221 @@ var ptrTests = []ptrTest{
|
||||
body: `var b C.char; p := &b; C.f((*C.u)(unsafe.Pointer(&p)))`,
|
||||
fail: false,
|
||||
},
|
||||
{
|
||||
// Test preemption while entering a cgo call. Issue #21306.
|
||||
name: "preempt-during-call",
|
||||
c: `void f() {}`,
|
||||
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.f(); runtime.GOMAXPROCS(i) }; wg.Done() }(i) }; wg.Wait()`,
|
||||
fail: false,
|
||||
},
|
||||
{
|
||||
// Test poller deadline with cgocheck=2. Issue #23435.
|
||||
name: "deadline",
|
||||
c: `#define US 10`,
|
||||
imports: []string{"os", "time"},
|
||||
body: `r, _, _ := os.Pipe(); r.SetDeadline(time.Now().Add(C.US * time.Microsecond))`,
|
||||
fail: false,
|
||||
},
|
||||
}
|
||||
|
||||
func TestPointerChecks(t *testing.T) {
|
||||
for _, pt := range ptrTests {
|
||||
pt := pt
|
||||
t.Run(pt.name, func(t *testing.T) {
|
||||
testOne(t, pt)
|
||||
})
|
||||
}
|
||||
func main() {
|
||||
os.Exit(doTests())
|
||||
}
|
||||
|
||||
func testOne(t *testing.T, pt ptrTest) {
|
||||
t.Parallel()
|
||||
|
||||
gopath, err := ioutil.TempDir("", filepath.Base(t.Name()))
|
||||
func doTests() int {
|
||||
gopath, err := ioutil.TempDir("", "cgoerrors")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
return 2
|
||||
}
|
||||
defer os.RemoveAll(gopath)
|
||||
|
||||
src := filepath.Join(gopath, "src")
|
||||
if err := os.Mkdir(src, 0777); err != nil {
|
||||
t.Fatal(err)
|
||||
if err := os.MkdirAll(filepath.Join(gopath, "src"), 0777); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
return 2
|
||||
}
|
||||
|
||||
name := filepath.Join(src, fmt.Sprintf("%s.go", filepath.Base(t.Name())))
|
||||
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 {
|
||||
t.Fatal(err)
|
||||
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, pt.c)
|
||||
fmt.Fprintln(b, t.c)
|
||||
fmt.Fprintln(b, `*/`)
|
||||
fmt.Fprintln(b, `import "C"`)
|
||||
fmt.Fprintln(b)
|
||||
for _, imp := range pt.imports {
|
||||
for _, imp := range t.imports {
|
||||
fmt.Fprintln(b, `import "`+imp+`"`)
|
||||
}
|
||||
if len(pt.imports) > 0 {
|
||||
if len(t.imports) > 0 {
|
||||
fmt.Fprintln(b)
|
||||
}
|
||||
if len(pt.support) > 0 {
|
||||
fmt.Fprintln(b, pt.support)
|
||||
if len(t.support) > 0 {
|
||||
fmt.Fprintln(b, t.support)
|
||||
fmt.Fprintln(b)
|
||||
}
|
||||
fmt.Fprintln(b, `func main() {`)
|
||||
fmt.Fprintln(b, pt.body)
|
||||
fmt.Fprintln(b, t.body)
|
||||
fmt.Fprintln(b, `}`)
|
||||
|
||||
if err := b.Flush(); err != nil {
|
||||
t.Fatalf("flushing %s: %v", name, err)
|
||||
fmt.Fprintf(os.Stderr, "flushing %s: %v\n", name, err)
|
||||
return false
|
||||
}
|
||||
if err := f.Close(); err != nil {
|
||||
t.Fatalf("closing %s: %v", name, err)
|
||||
fmt.Fprintf(os.Stderr, "closing %s: %v\n", name, err)
|
||||
return false
|
||||
}
|
||||
|
||||
for _, e := range pt.extra {
|
||||
if err := ioutil.WriteFile(filepath.Join(src, e.name), []byte(e.contents), 0644); err != nil {
|
||||
t.Fatalf("writing %s: %v", e.name, err)
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
args := func(cmd *exec.Cmd) string {
|
||||
return strings.Join(cmd.Args, " ")
|
||||
}
|
||||
ok := true
|
||||
|
||||
cmd := exec.Command("go", "build")
|
||||
cmd.Dir = src
|
||||
cmd.Dir = dir
|
||||
cmd.Env = addEnv("GOPATH", gopath)
|
||||
buf, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Logf("%#q:\n%s", args(cmd), buf)
|
||||
t.Fatalf("failed to build: %v", err)
|
||||
fmt.Fprintf(os.Stderr, "test %s failed to build: %v\n%s", t.name, err, buf)
|
||||
return false
|
||||
}
|
||||
|
||||
exe := filepath.Join(src, filepath.Base(src))
|
||||
exe := filepath.Join(dir, filepath.Base(dir))
|
||||
cmd = exec.Command(exe)
|
||||
cmd.Dir = src
|
||||
cmd.Dir = dir
|
||||
|
||||
if pt.expensive {
|
||||
if t.expensive {
|
||||
cmd.Env = cgocheckEnv("1")
|
||||
buf, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Logf("%#q:\n%s", args(cmd), buf)
|
||||
if pt.fail {
|
||||
t.Fatalf("test marked expensive, but failed when not expensive: %v", err)
|
||||
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 {
|
||||
t.Errorf("failed unexpectedly with GODEBUG=cgocheck=1: %v", err)
|
||||
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 = src
|
||||
cmd.Dir = dir
|
||||
}
|
||||
|
||||
if pt.expensive {
|
||||
if t.expensive {
|
||||
cmd.Env = cgocheckEnv("2")
|
||||
}
|
||||
|
||||
buf, err = cmd.CombinedOutput()
|
||||
if pt.fail {
|
||||
|
||||
if t.fail {
|
||||
if err == nil {
|
||||
t.Logf("%#q:\n%s", args(cmd), buf)
|
||||
t.Fatalf("did not fail as expected")
|
||||
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")) {
|
||||
t.Logf("%#q:\n%s", args(cmd), buf)
|
||||
t.Fatalf("did not print expected error (failed with %v)", err)
|
||||
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 {
|
||||
t.Logf("%#q:\n%s", args(cmd), buf)
|
||||
t.Fatalf("failed unexpectedly: %v", err)
|
||||
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 !pt.expensive {
|
||||
if !t.expensive && ok {
|
||||
// Make sure it passes with the expensive checks.
|
||||
cmd := exec.Command(exe)
|
||||
cmd.Dir = src
|
||||
cmd.Dir = dir
|
||||
cmd.Env = cgocheckEnv("2")
|
||||
buf, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Logf("%#q:\n%s", args(cmd), buf)
|
||||
t.Fatalf("failed unexpectedly with expensive checks: %v", err)
|
||||
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 pt.fail {
|
||||
if t.fail && ok {
|
||||
cmd = exec.Command(exe)
|
||||
cmd.Dir = src
|
||||
cmd.Dir = dir
|
||||
cmd.Env = cgocheckEnv("0")
|
||||
buf, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Logf("%#q:\n%s", args(cmd), buf)
|
||||
t.Fatalf("failed unexpectedly with GODEBUG=cgocheck=0: %v", err)
|
||||
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 {
|
||||
@@ -1,15 +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 main
|
||||
|
||||
/*
|
||||
long double x = 0;
|
||||
*/
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
_ = C.x // ERROR HERE
|
||||
_ = C.x
|
||||
}
|
||||
@@ -1,15 +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 p
|
||||
|
||||
/*
|
||||
static int transform(int x) { return x; }
|
||||
*/
|
||||
import "C"
|
||||
|
||||
func F() {
|
||||
var x rune = '✈'
|
||||
var _ rune = C.transform(x) // ERROR HERE: C\.int
|
||||
}
|
||||
@@ -1,24 +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.
|
||||
|
||||
// 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\.uchar
|
||||
_ C.schar = "sc" // ERROR HERE: C\.schar
|
||||
_ C.ushort = "us" // ERROR HERE: C\.ushort
|
||||
_ C.uint = "ui" // ERROR HERE: C\.uint
|
||||
_ C.ulong = "ul" // ERROR HERE: C\.ulong
|
||||
_ C.longlong = "ll" // ERROR HERE: C\.longlong
|
||||
_ C.ulonglong = "ull" // ERROR HERE: C\.ulonglong
|
||||
_ C.complexfloat = "cf" // ERROR HERE: C\.complexfloat
|
||||
_ C.complexdouble = "cd" // ERROR HERE: C\.complexdouble
|
||||
)
|
||||
}
|
||||
@@ -1,18 +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.
|
||||
|
||||
// Issue 18452: show pos info in undefined name errors
|
||||
|
||||
package p
|
||||
|
||||
import (
|
||||
"C"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func a() {
|
||||
fmt.Println("Hello, world!")
|
||||
C.function_that_does_not_exist() // ERROR HERE
|
||||
C.pi // ERROR HERE
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package main
|
||||
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
_ = C.malloc // ERROR HERE
|
||||
}
|
||||
@@ -1,16 +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 main
|
||||
|
||||
/*
|
||||
const int sizeofLongDouble = sizeof(long double);
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println(C.sizeofLongDouble)
|
||||
}
|
||||
73
misc/cgo/errors/test.bash
Executable file
73
misc/cgo/errors/test.bash
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2013 The Go Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
check() {
|
||||
file=$1
|
||||
line=$(grep -n 'ERROR HERE' $file | sed 's/:.*//')
|
||||
if [ "$line" = "" ]; then
|
||||
echo 1>&2 misc/cgo/errors/test.bash: BUG: cannot find ERROR HERE in $file
|
||||
exit 1
|
||||
fi
|
||||
expect $file $file:$line:
|
||||
}
|
||||
|
||||
expect() {
|
||||
file=$1
|
||||
shift
|
||||
if go build $file >errs 2>&1; then
|
||||
echo 1>&2 misc/cgo/errors/test.bash: BUG: expected cgo to fail on $file but it succeeded
|
||||
exit 1
|
||||
fi
|
||||
if ! test -s errs; then
|
||||
echo 1>&2 misc/cgo/errors/test.bash: BUG: expected error output for $file but saw none
|
||||
exit 1
|
||||
fi
|
||||
for error; do
|
||||
if ! fgrep $error errs >/dev/null 2>&1; then
|
||||
echo 1>&2 misc/cgo/errors/test.bash: BUG: expected error output for $file to contain \"$error\" but saw:
|
||||
cat 1>&2 errs
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
check err1.go
|
||||
check err2.go
|
||||
check err3.go
|
||||
check issue7757.go
|
||||
check issue8442.go
|
||||
check issue11097a.go
|
||||
check issue11097b.go
|
||||
expect issue13129.go C.ushort
|
||||
check issue13423.go
|
||||
expect issue13635.go C.uchar C.schar C.ushort C.uint C.ulong C.longlong C.ulonglong C.complexfloat C.complexdouble
|
||||
check issue13830.go
|
||||
check issue16116.go
|
||||
check issue16591.go
|
||||
|
||||
if ! go build issue14669.go; then
|
||||
exit 1
|
||||
fi
|
||||
if ! CGO_CFLAGS="-O" go build issue14669.go; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! go run ptr.go; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The malloc.go test should crash.
|
||||
rm -f malloc.out
|
||||
if go run malloc.go >malloc.out 2>&1; then
|
||||
echo '`go run malloc.go` succeeded unexpectedly'
|
||||
cat malloc.out
|
||||
rm -f malloc.out
|
||||
exit 1
|
||||
fi
|
||||
rm -f malloc.out
|
||||
|
||||
rm -rf errs _obj
|
||||
exit 0
|
||||
@@ -12,7 +12,7 @@ FC=$1
|
||||
goos=$(go env GOOS)
|
||||
|
||||
libext="so"
|
||||
if [ "$goos" = "darwin" ]; then
|
||||
if [ "$goos" == "darwin" ]; then
|
||||
libext="dylib"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// cmpout -tags=use_go_run
|
||||
// cmpout
|
||||
|
||||
// Copyright 2010 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
@@ -11,10 +11,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"."
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"."
|
||||
)
|
||||
|
||||
const MAXDIM = 100
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// cmpout -tags=use_go_run
|
||||
// cmpout
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// cmpout -tags=use_go_run
|
||||
// cmpout
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// cmpout -tags=use_go_run
|
||||
// cmpout
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -27,7 +27,6 @@ func testBuildID(t *testing.T) {
|
||||
defer f.Close()
|
||||
|
||||
c := 0
|
||||
sections:
|
||||
for i, s := range f.Sections {
|
||||
if s.Type != elf.SHT_NOTE {
|
||||
continue
|
||||
@@ -48,7 +47,7 @@ sections:
|
||||
|
||||
if len(d) < 12 {
|
||||
t.Logf("note section %d too short (%d < 12)", i, len(d))
|
||||
continue sections
|
||||
continue
|
||||
}
|
||||
|
||||
namesz := f.ByteOrder.Uint32(d)
|
||||
@@ -60,7 +59,7 @@ sections:
|
||||
|
||||
if int(12+an+ad) > len(d) {
|
||||
t.Logf("note section %d too short for header (%d < 12 + align(%d,4) + align(%d,4))", i, len(d), namesz, descsz)
|
||||
continue sections
|
||||
continue
|
||||
}
|
||||
|
||||
// 3 == NT_GNU_BUILD_ID
|
||||
|
||||
@@ -76,16 +76,5 @@ func TestThreadLock(t *testing.T) { testThreadLockFunc(t) }
|
||||
func TestCheckConst(t *testing.T) { testCheckConst(t) }
|
||||
func Test17537(t *testing.T) { test17537(t) }
|
||||
func Test18126(t *testing.T) { test18126(t) }
|
||||
func Test20369(t *testing.T) { test20369(t) }
|
||||
func Test18720(t *testing.T) { test18720(t) }
|
||||
func Test20266(t *testing.T) { test20266(t) }
|
||||
func Test20129(t *testing.T) { test20129(t) }
|
||||
func Test20910(t *testing.T) { test20910(t) }
|
||||
func Test21708(t *testing.T) { test21708(t) }
|
||||
func Test21809(t *testing.T) { test21809(t) }
|
||||
func Test6907(t *testing.T) { test6907(t) }
|
||||
func Test6907Go(t *testing.T) { test6907Go(t) }
|
||||
func Test21897(t *testing.T) { test21897(t) }
|
||||
func Test22906(t *testing.T) { test22906(t) }
|
||||
|
||||
func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) }
|
||||
|
||||
@@ -73,7 +73,7 @@ func test18146(t *testing.T) {
|
||||
}
|
||||
runtime.GOMAXPROCS(threads)
|
||||
argv := append(os.Args, "-test.run=NoSuchTestExists")
|
||||
if err := syscall.Exec(os.Args[0], argv, os.Environ()); err != nil {
|
||||
if err := syscall.Exec(os.Args[0], argv, nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,54 +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 cgotest
|
||||
|
||||
/*
|
||||
#define HELLO "hello"
|
||||
#define WORLD "world"
|
||||
#define HELLO_WORLD HELLO "\000" WORLD
|
||||
|
||||
struct foo { char c; };
|
||||
#define SIZE_OF(x) sizeof(x)
|
||||
#define SIZE_OF_FOO SIZE_OF(struct foo)
|
||||
#define VAR1 VAR
|
||||
#define VAR var
|
||||
int var = 5;
|
||||
|
||||
#define ADDR &var
|
||||
|
||||
#define CALL fn()
|
||||
int fn(void) {
|
||||
return ++var;
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
import "testing"
|
||||
|
||||
func test18720(t *testing.T) {
|
||||
if got, want := C.HELLO_WORLD, "hello\000world"; got != want {
|
||||
t.Errorf("C.HELLO_WORLD == %q, expected %q", got, want)
|
||||
}
|
||||
|
||||
if got, want := C.VAR1, C.int(5); got != want {
|
||||
t.Errorf("C.VAR1 == %v, expected %v", got, want)
|
||||
}
|
||||
|
||||
if got, want := *C.ADDR, C.int(5); got != want {
|
||||
t.Errorf("*C.ADDR == %v, expected %v", got, want)
|
||||
}
|
||||
|
||||
if got, want := C.CALL, C.int(6); got != want {
|
||||
t.Errorf("C.CALL == %v, expected %v", got, want)
|
||||
}
|
||||
|
||||
if got, want := C.CALL, C.int(7); got != want {
|
||||
t.Errorf("C.CALL == %v, expected %v", got, want)
|
||||
}
|
||||
|
||||
// Issue 20125.
|
||||
if got, want := C.SIZE_OF_FOO, 1; got != want {
|
||||
t.Errorf("C.SIZE_OF_FOO == %v, expected %v", got, want)
|
||||
}
|
||||
}
|
||||
@@ -1,33 +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 cgotest
|
||||
|
||||
/*
|
||||
int issue20129 = 0;
|
||||
typedef void issue20129Void;
|
||||
issue20129Void issue20129Foo() {
|
||||
issue20129 = 1;
|
||||
}
|
||||
typedef issue20129Void issue20129Void2;
|
||||
issue20129Void2 issue20129Bar() {
|
||||
issue20129 = 2;
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
import "testing"
|
||||
|
||||
func test20129(t *testing.T) {
|
||||
if C.issue20129 != 0 {
|
||||
t.Fatal("test is broken")
|
||||
}
|
||||
C.issue20129Foo()
|
||||
if C.issue20129 != 1 {
|
||||
t.Errorf("got %v but expected %v", C.issue20129, 1)
|
||||
}
|
||||
C.issue20129Bar()
|
||||
if C.issue20129 != 2 {
|
||||
t.Errorf("got %v but expected %v", C.issue20129, 2)
|
||||
}
|
||||
}
|
||||
@@ -1,21 +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.
|
||||
|
||||
// Issue 20266: use -I with a relative path.
|
||||
|
||||
package cgotest
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -I issue20266 -Iissue20266 -Ddef20266
|
||||
#include "issue20266.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import "testing"
|
||||
|
||||
func test20266(t *testing.T) {
|
||||
if got, want := C.issue20266, 20266; got != want {
|
||||
t.Errorf("got %d, want %d", got, want)
|
||||
}
|
||||
}
|
||||
@@ -1,9 +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.
|
||||
|
||||
#define issue20266 20266
|
||||
|
||||
#ifndef def20266
|
||||
#error "expected def20266 to be defined"
|
||||
#endif
|
||||
@@ -1,20 +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 cgotest
|
||||
|
||||
/*
|
||||
#define UINT64_MAX 18446744073709551615ULL
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
"math"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func test20369(t *testing.T) {
|
||||
if C.UINT64_MAX != math.MaxUint64 {
|
||||
t.Fatalf("got %v, want %v", uint64(C.UINT64_MAX), uint64(math.MaxUint64))
|
||||
}
|
||||
}
|
||||
@@ -1,19 +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.
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "_cgo_export.h"
|
||||
|
||||
/* Test calling a Go function with multiple return values. */
|
||||
|
||||
void
|
||||
callMulti(void)
|
||||
{
|
||||
struct multi_return result = multi();
|
||||
assert(strcmp(result.r0, "multi") == 0);
|
||||
assert(result.r1 == 0);
|
||||
free(result.r0);
|
||||
}
|
||||
@@ -1,19 +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 cgotest
|
||||
|
||||
//void callMulti(void);
|
||||
import "C"
|
||||
|
||||
import "testing"
|
||||
|
||||
//export multi
|
||||
func multi() (*C.char, C.int) {
|
||||
return C.CString("multi"), 0
|
||||
}
|
||||
|
||||
func test20910(t *testing.T) {
|
||||
C.callMulti()
|
||||
}
|
||||
@@ -1,13 +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.
|
||||
|
||||
// Fail to guess the kind of the constant "x".
|
||||
// No runtime test; just make sure it compiles.
|
||||
|
||||
package cgotest
|
||||
|
||||
// const int x = 42;
|
||||
import "C"
|
||||
|
||||
var issue21668_X = C.x
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user