Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d260448f6b | ||
|
|
a00b3d29de | ||
|
|
fa6b1232e6 | ||
|
|
3b7e6e8db1 | ||
|
|
13af44f8a5 | ||
|
|
b87a963f87 | ||
|
|
3e88a825df | ||
|
|
d72c550f1c | ||
|
|
371a3ab28a | ||
|
|
ff7cb872a4 | ||
|
|
b9b37d1292 | ||
|
|
03290b55e9 | ||
|
|
5f1cf34402 | ||
|
|
09879160e5 | ||
|
|
ea3b4c9321 | ||
|
|
41644eec2c | ||
|
|
205f850cea | ||
|
|
6c7631126f | ||
|
|
9294a08f1b | ||
|
|
46a6097aa7 | ||
|
|
91504a0e0d | ||
|
|
836b670612 | ||
|
|
0a98e78c1f | ||
|
|
c785d6af66 | ||
|
|
99aa2da7ea | ||
|
|
0f1a18b773 | ||
|
|
1c5438aae8 |
10
.gitattributes
vendored
@@ -1,10 +0,0 @@
|
||||
# Treat all files in the Go repo as binary, with no git magic updating
|
||||
# line endings. Windows users contributing to Go will need to use a
|
||||
# modern version of git and editors capable of LF line endings.
|
||||
#
|
||||
# We'll prevent accidental CRLF line endings from entering the repo
|
||||
# via the git-review gofmt checks.
|
||||
#
|
||||
# See golang.org/issue/9281
|
||||
|
||||
* -text
|
||||
21
.github/ISSUE_TEMPLATE
vendored
@@ -1,21 +0,0 @@
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
|
||||
### What version of Go are you using (`go version`)?
|
||||
|
||||
|
||||
### 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.
|
||||
|
||||
|
||||
### What did you expect to see?
|
||||
|
||||
|
||||
### What did you see instead?
|
||||
|
||||
|
||||
7
.github/PULL_REQUEST_TEMPLATE
vendored
@@ -1,7 +0,0 @@
|
||||
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
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
|
||||
45
.gitignore
vendored
@@ -1,45 +0,0 @@
|
||||
.DS_Store
|
||||
*.[56789ao]
|
||||
*.a[56789o]
|
||||
*.so
|
||||
*.pyc
|
||||
._*
|
||||
.nfs.*
|
||||
[56789a].out
|
||||
*~
|
||||
*.orig
|
||||
*.rej
|
||||
*.exe
|
||||
.*.swp
|
||||
core
|
||||
*.cgo*.go
|
||||
*.cgo*.c
|
||||
_cgo_*
|
||||
_obj
|
||||
_test
|
||||
_testmain.go
|
||||
|
||||
/VERSION.cache
|
||||
/bin/
|
||||
/build.out
|
||||
/doc/articles/wiki/*.bin
|
||||
/goinstall.log
|
||||
/last-change
|
||||
/misc/cgo/life/run.out
|
||||
/misc/cgo/stdio/run.out
|
||||
/misc/cgo/testso/main
|
||||
/pkg/
|
||||
/src/*.*/
|
||||
/src/cmd/cgo/zdefaultcc.go
|
||||
/src/cmd/go/internal/cfg/zdefaultcc.go
|
||||
/src/cmd/go/internal/cfg/zosarch.go
|
||||
/src/cmd/internal/objabi/zbootstrap.go
|
||||
/src/go/build/zcgo.go
|
||||
/src/go/doc/headscan
|
||||
/src/runtime/internal/sys/zversion.go
|
||||
/src/unicode/maketables
|
||||
/test.out
|
||||
/test/garbage/*.out
|
||||
/test/pass.out
|
||||
/test/run.out
|
||||
/test/times.out
|
||||
65
.hgignore
Normal file
@@ -0,0 +1,65 @@
|
||||
syntax:glob
|
||||
.DS_Store
|
||||
.git
|
||||
.gitignore
|
||||
*.[568ao]
|
||||
*.a[568o]
|
||||
*.so
|
||||
*.pyc
|
||||
._*
|
||||
.nfs.*
|
||||
[568a].out
|
||||
*~
|
||||
*.orig
|
||||
*.rej
|
||||
*.exe
|
||||
.*.swp
|
||||
core
|
||||
*.cgo*.go
|
||||
*.cgo*.c
|
||||
_cgo_*
|
||||
_obj
|
||||
_test
|
||||
_testmain.go
|
||||
build.out
|
||||
test.out
|
||||
doc/tmpltohtml
|
||||
doc/articles/wiki/*.bin
|
||||
misc/cgo/life/run.out
|
||||
misc/cgo/stdio/run.out
|
||||
misc/cgo/testso/main
|
||||
misc/dashboard/builder/builder
|
||||
misc/goplay/goplay
|
||||
misc/osx/*.pkg
|
||||
misc/osx/*.dmg
|
||||
src/cmd/6a/6a
|
||||
src/cmd/?a/y.output
|
||||
src/cmd/?l/enam.c
|
||||
src/cmd/cc/y.output
|
||||
src/cmd/dist/dist.dSYM
|
||||
src/cmd/gc/mkbuiltin1
|
||||
src/cmd/gc/opnames.h
|
||||
src/cmd/gc/y.output
|
||||
src/pkg/exp/norm/maketables
|
||||
src/pkg/exp/norm/maketesttables
|
||||
src/pkg/exp/norm/normregtest
|
||||
src/pkg/exp/ebnflint/ebnflint
|
||||
src/pkg/go/doc/headscan
|
||||
src/pkg/runtime/goc2c
|
||||
src/pkg/runtime/mkversion
|
||||
src/pkg/runtime/z*
|
||||
src/pkg/unicode/maketables
|
||||
src/pkg/*.*/
|
||||
test/pass.out
|
||||
test/run.out
|
||||
test/times.out
|
||||
test/garbage/*.out
|
||||
goinstall.log
|
||||
last-change
|
||||
VERSION.cache
|
||||
|
||||
syntax:regexp
|
||||
^bin/
|
||||
^pkg/
|
||||
^src/cmd/(.*)/6?\1$
|
||||
^.*/core.[0-9]*$
|
||||
116
.hgtags
Normal file
@@ -0,0 +1,116 @@
|
||||
1f0a01c93d305f1ab636c68b67346659c5b957f7 weekly.2009-11-06
|
||||
64e703cb307da550861fe740ff70a482a2c14819 weekly.2009-11-10
|
||||
b51fd2d6c16034480f26c96ba32a11c598e4638e weekly.2009-11-10.1
|
||||
cb140bac9ab0fd9f734ee443cea9ebadc9c99737 weekly.2009-11-12
|
||||
d1b75410b793309532352a6fb6b44453f052f3f4 weekly.2009-11-17
|
||||
e205103b02e7393d4719df5faac2dac808234d3f weekly.2009-12-07
|
||||
3a47d2e3882bb12129de05382a2c131bb0c00964 weekly.2009-12-09
|
||||
a6fcf4303b0a92cce4011556b1c96044252d93af weekly.2009-12-22
|
||||
3887d4d81bca78b63d620985d93f1cc06c063871 weekly.2010-01-05
|
||||
40dd722155f6d0c83fa572c1a5abf7c6ff35049f weekly.2010-01-13
|
||||
0a2770db06efe92b08b5c6f30e14b7e8db012538 weekly.2010-01-27
|
||||
db4262ce882d8445764312d41547ee8f11a7f7a9 weekly.2010-02-04
|
||||
53fec18b83e2b93baafba4733b59bb86b8c1988e weekly.2010-02-17
|
||||
4a0661b86e50eae734dbe43ed1312c4a0304676b weekly.2010-02-23
|
||||
a215d03e7ee1013b2abe3f1e2c84457ec51c68e4 weekly.2010-03-04
|
||||
194d473264c1a015803d07bed200e0c312aca43e weekly.2010-03-15
|
||||
9482fde11a02ffd57ba0561dc8a4ac338061a3ae weekly.2010-03-22
|
||||
57380d620ee6b65eb88da1c52784b62c94d7e72e weekly.2010-03-30
|
||||
f98f784927abc56a61501eba0cf225966f2b0142 weekly.2010-04-13
|
||||
6cc6c0d85fc3234fc0a5ec0a8777aa9d59d05ae8 weekly.2010-04-27
|
||||
17ded5ad443b41ac05924864798f1bd8750da344 weekly.2010-05-04
|
||||
a85ad0a640154b5d33626ad8ea15ed17e3828178 weekly.2010-05-27
|
||||
f776656df34c009f2aad142bf7b34a778404acd1 weekly.2010-06-09
|
||||
113ec27f29f18825444f6f8a3cdc156c1df28e87 weekly.2010-06-21
|
||||
b761e0299e9bf66298778cf170b0f64216e3cf7d weekly.2010-07-01
|
||||
5992bf56aa72efcea87d8dff14985fc8fcc68575 weekly.2010-07-14
|
||||
db904d88dc0ebf6ee5b55e44088915695c1223ee weekly.2010-07-29
|
||||
8884f7b4c7750481ed246c249db47b61fe752c56 weekly.2010-08-04
|
||||
07d3a97302be88af68acff34c8a089589da21d18 weekly.2010-08-11
|
||||
18926649cda7498b8aa539b3a611abcff548f09f weekly.2010-08-25
|
||||
92fcf05736e8565a485adc52da1894270e06ed09 weekly.2010-09-06
|
||||
9329773e204fed50ec686ee78cc715b624bf1b1d weekly.2010-09-15
|
||||
1eec33c03bceef5d7607ea4636185f7bf773e0e4 weekly.2010-09-22
|
||||
c2b8c9f13fb8ad2b56920d9da2928c5314ebf725 weekly.2010-09-29
|
||||
7c2e97710bf49cdbe388260958a6674afefb6c0f weekly.2010-10-13
|
||||
ca4f9687cec0b9c4732afd57b8c2786c7fe242de weekly.2010-10-13.1
|
||||
79997f0e5823ee9d13a34ca9971a9d8811df1c4a weekly.2010-10-20
|
||||
4d5b0816392116d3a3452bb275b6dab6c6456278 weekly.2010-10-27
|
||||
c627e23260c7ddf4a1fcda6ef3197c98fa22551d weekly.2010-11-02
|
||||
a7800e20064a39585aa3ee339c2b7454ae1ce6d5 weekly.2010-11-10
|
||||
c5287468fcff0f8a7bb9ffaece2a4863e7e5d83e weekly.2010-11-23
|
||||
f7e692dc29b02fba8e5d59b967880a347b53607c weekly.2010-12-02
|
||||
56e39c466cc1c49b587eb56dc2166d61151637df weekly.2010-12-08
|
||||
26f4898dc1ca18bb77f9968aca23773637e34f0d weekly.2010-12-15
|
||||
61b2c52b0d2246430395f2869d7b34e565333cf5 weekly.2010-12-15.1
|
||||
51c777dbccb9f537ebffb99244f521c05bf65df6 weekly.2010-12-22
|
||||
8eeee945e358f19405e81792db0e16a1cad14bc0 weekly.2011-01-06
|
||||
514c7ba501a1dd74d69ea2d0a2b4116802ada2b5 weekly.2011-01-12
|
||||
72f9cb714f08b98c6a65ab2f2256fad6bb16967a weekly.2011-01-19
|
||||
d8ba80011a986470a54e5262ec125105aa4adc34 weekly.2011-01-20
|
||||
5b98b59dd37292e36afb24babb2d22758928e13d weekly.2011-02-01
|
||||
867d37fb41a4d96ab7a6202fd6ad54c345494051 weekly.2011-02-01.1
|
||||
b2be017f91348d5f8cbaf42f77a99fc905044b59 weekly.2011-02-15
|
||||
322350d6fdbf11d9c404d6fc766349d824031339 weekly.2011-02-24
|
||||
21848430d60167817ca965c813a2118068ca660f weekly.2011-03-07
|
||||
c5c62aeb6267e124cf05f9622e28dbd0dc6b971d weekly.2011-03-07.1
|
||||
c5c62aeb6267e124cf05f9622e28dbd0dc6b971d release.r56
|
||||
3b4e9c85b643a35860805718323b05186dd7f235 weekly.2011-03-15
|
||||
b84e614e25161f626a6102813c41a80a15e3a625 weekly.2011-03-28
|
||||
cd89452cfea3d125aaf75a1ec8004e2f6a868d38 weekly.2011-04-04
|
||||
d6903b7fbff40c13ee7ea3177c0ae54c7f89d2e6 weekly.2011-04-13
|
||||
2f0fa51fa2da6ab50fcebba526326153da8ed999 weekly.2011-04-27
|
||||
8493bb64e5592bd20c0e60e78e7f8052c1276fcf release.r57
|
||||
95d2ce135523c96c4cea049af94ce76dd8c7d981 release.r57.1
|
||||
c98449d685d2b6aa1df9bfd2e1cce9307efb6e00 weekly.2011-05-22
|
||||
3418f22c39eb8299053ae681199ee90f8cd29c6d weekly.2011-06-02
|
||||
c81944152e973a917797679055b8fcdc70fbc802 weekly.2011-06-09
|
||||
9d7967223815ef6415ff01aa0fe6ad38cdbc7810 release.r57.2
|
||||
dac76f0b1a18a5de5b54a1dc0b231aceaf1c8583 weekly.2011-06-16
|
||||
541c445d6c1353fbfa39df7dc4b0eb27558d1fc1 weekly.2011-06-23
|
||||
1b38d90eebcddefabb3901c5bb63c7e2b04a6ec5 release.r58
|
||||
16bfa562ba767aefd82e598da8b15ee4729e23b0 weekly.2011-07-07
|
||||
d292bc7886682d35bb391bf572be28656baee12d release.r58.1
|
||||
3c21f37b25a3f7a1726265c5339c8a7b0b329336 weekly.2011-07-19
|
||||
bb28251f6da4aca85658582c370c7df89d34efd4 weekly.2011-07-29
|
||||
d5785050f61d973fc36775f7bd2e26689529cb3e release.r59
|
||||
c17ce5ec06b4bd5cf6e7ff2ceb0a60c2e40e0b17 weekly.2011-08-10
|
||||
6eb2b9dbe489acb57a2bfc1de31ec2239ed94326 weekly.2011-08-17
|
||||
c934f6f5fe8b30b4b3210ee3f13669e6e4670c32 weekly.2011-09-01
|
||||
c77997547d546c36c7b969586a36de7ceda74e33 weekly.2011-09-07
|
||||
b0819469a6df6029a27192fe7b19a73d97404c63 release.r60
|
||||
8a09ce0cefc64deab4e6d1ed59a08a53e879bbee weekly.2011-09-16
|
||||
fd30c132d1bdeb79f8f111cb721fb1c78b767b27 release.r60.1
|
||||
d7322ae4d055a4cf3efaf842d0717a41acd85bac weekly.2011-09-21
|
||||
32a5db19629897641b2d488de4d1b998942ef80e release.r60.2
|
||||
3bdabf483805fbf0c7ef013fd09bfd6062b9d3f2 weekly.2011-10-06
|
||||
c1702f36df0397c19fc333571a771666029aa37e release.r60.3
|
||||
acaddf1cea75c059d19b20dbef35b20fb3f38954 release.r58.2
|
||||
6d7136d74b656ba6e1194853a9486375005227ef weekly.2011-10-18
|
||||
941b8015061a0f6480954821dd589c60dfe35ed1 weekly.2011-10-25
|
||||
7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly.2011-10-26
|
||||
e69e528f2afc25a8334cfb9359fa4fcdf2a934b6 weekly.2011-11-01
|
||||
780c85032b174c9d4b42adf75d82bc85af7d78d1 weekly.2011-11-02
|
||||
f4397ad6e87c7ce5feac9b01686f1ebd6cbaac4e weekly.2011-11-08
|
||||
2f4482b89a6b5956828872137b6b96636cd904d3 weekly.2011-11-09
|
||||
b4a91b6933748db1a7150c06a1b55ad506e52906 weekly.2011-11-18
|
||||
80db2da6495a20ddff8305c236825811db8c8665 weekly.2011-12-01
|
||||
0beb796b4ef8747af601ed5ea6766d5b1340086b weekly.2011-12-02
|
||||
0c39eee85b0d1606b79c8ebcdeb3b67ed5849e39 weekly.2011-12-06
|
||||
82fdc445f2ff2c85043446eb84a19cc999dfcb95 weekly.2011-12-14
|
||||
4a82689277582a2a60f006e3f158985f2f8d1da3 weekly.2011-12-22
|
||||
354b17404643c0f1a710bdc48927dff02f203ae3 weekly.2012-01-15
|
||||
9f2be4fbbf690b9562c6e98b91daa0003f0913c7 weekly.2012-01-20
|
||||
1107a7d3cb075836387adfab5ce56d1b3e56637d weekly.2012-01-27
|
||||
52ba9506bd993663a0a033c2bd68699e25d061ab weekly.2012-02-07
|
||||
43cf9b39b6477d3144b0353ee91096e55db6107f weekly.2012-02-14
|
||||
96bd78e7d35e892113bdfa1bdc392d3a5f2e644b weekly.2012-02-22
|
||||
f4470a54e6dbcdd52d8d404e12e4754adcd2c948 weekly.2012-03-04
|
||||
3cdba7b0650c6c906ef3e782654f61701abd7dd2 weekly.2012-03-13
|
||||
bce220d0377405146527ab9478867cbc572a6886 weekly.2012-03-22
|
||||
dc5e410f0b4c32ab11dc992593a2bcf5f607381b weekly.2012-03-27
|
||||
dc5e410f0b4c32ab11dc992593a2bcf5f607381b weekly
|
||||
920e9d1ffd1f46665dd152aa9cf3c0f17d68dd88 go1
|
||||
2ccfd4b451d319941bfe3e08037e1462d3c15093 go1.0.1
|
||||
5e806355a9e1491aaab53d3612fed4c550b130c0 go1.0.2
|
||||
2d8bc3c94ecb3ec8f70556d5fd237788903c7281 go1.0.3
|
||||
@@ -1,40 +0,0 @@
|
||||
# Contributing to Go
|
||||
|
||||
Go is an open source project.
|
||||
|
||||
It is the work of hundreds of contributors. We appreciate your help!
|
||||
|
||||
## Before filing an issue
|
||||
|
||||
If you are unsure whether you have found a bug, please consider asking in the [golang-nuts mailing
|
||||
list](https://groups.google.com/forum/#!forum/golang-nuts) or [other forums](https://golang.org/help/) first. If
|
||||
the behavior you are seeing is confirmed as a bug or issue, it can easily be re-raised in the issue tracker.
|
||||
|
||||
## Filing issues
|
||||
|
||||
Sensitive security-related issues should be reported to [security@golang.org](mailto:security@golang.org).
|
||||
See the [security policy](https://golang.org/security) for details.
|
||||
|
||||
The recommended way to file an issue is by running `go bug`.
|
||||
Otherwise, when filing an issue, make sure to answer these five questions:
|
||||
|
||||
1. What version of Go are you using (`go version`)?
|
||||
2. What operating system and processor architecture are you using?
|
||||
3. What did you do?
|
||||
4. What did you expect to see?
|
||||
5. What did you see instead?
|
||||
|
||||
For change proposals, see [Proposing Changes To Go](https://github.com/golang/proposal/).
|
||||
|
||||
## Contributing code
|
||||
|
||||
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.
|
||||
|
||||
1043
CONTRIBUTORS
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
Copyright (c) 2012 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
|
||||
31
README
Normal file
@@ -0,0 +1,31 @@
|
||||
This is the source code repository for the Go programming language.
|
||||
|
||||
For documentation about how to install and use Go,
|
||||
visit http://golang.org/ or load doc/install.html in your web browser.
|
||||
|
||||
After installing Go, you can view a nicely formatted
|
||||
doc/install.html by running godoc --http=:6060
|
||||
and then visiting http://localhost:6060/doc/install.html.
|
||||
|
||||
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 README). 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.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 doc/install.html for more details.
|
||||
45
README.md
@@ -1,45 +0,0 @@
|
||||
# The Go Programming Language
|
||||
|
||||
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].*
|
||||
|
||||
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 does not use GitHub pull requests, and that
|
||||
we use 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.
|
||||
|
||||
[rf]: https://reneefrench.blogspot.com/
|
||||
[cc3-by]: https://creativecommons.org/licenses/by/3.0/
|
||||
@@ -1,6 +1,6 @@
|
||||
Files in this directory are data for Go's API checker ("go tool api", in src/cmd/api).
|
||||
|
||||
Each file is a list of API features, one per line.
|
||||
Each file is a list of of API features, one per line.
|
||||
|
||||
go1.txt (and similarly named files) are frozen once a version has been
|
||||
shipped. Each file adds new lines but does not remove any.
|
||||
|
||||
336
api/except.txt
@@ -1,345 +1,9 @@
|
||||
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
|
||||
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
|
||||
pkg syscall (darwin-386), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-386), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-386-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-386-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-amd64), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-amd64), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-amd64-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-amd64-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-386), const AF_MAX = 38
|
||||
pkg syscall (freebsd-386), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-386), const ELAST = 94
|
||||
pkg syscall (freebsd-386), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-386), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-386-cgo), const AF_MAX = 38
|
||||
pkg syscall (freebsd-386-cgo), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-386-cgo), const ELAST = 94
|
||||
pkg syscall (freebsd-386-cgo), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-amd64), const AF_MAX = 38
|
||||
pkg syscall (freebsd-amd64), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-amd64), const ELAST = 94
|
||||
pkg syscall (freebsd-amd64), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-amd64), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-amd64-cgo), const AF_MAX = 38
|
||||
pkg syscall (freebsd-amd64-cgo), const DLT_MATCHING_MAX = 242
|
||||
pkg syscall (freebsd-amd64-cgo), const ELAST = 94
|
||||
pkg syscall (freebsd-amd64-cgo), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-arm), const AF_MAX = 38
|
||||
pkg syscall (freebsd-arm), const BIOCGRTIMEOUT = 1074545262
|
||||
pkg syscall (freebsd-arm), const BIOCSRTIMEOUT = 2148287085
|
||||
pkg syscall (freebsd-arm), const ELAST = 94
|
||||
pkg syscall (freebsd-arm), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-arm), const SIOCAIFADDR = 2151967019
|
||||
pkg syscall (freebsd-arm), const SIOCGIFSTATUS = 3274991931
|
||||
pkg syscall (freebsd-arm), const SIOCSIFPHYADDR = 2151967046
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET = 537
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT = 536
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET = 535
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT = 534
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET = 515
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT = 533
|
||||
pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm), const SizeofBpfHdr = 24
|
||||
pkg syscall (freebsd-arm), const SizeofIfData = 88
|
||||
pkg syscall (freebsd-arm), const SizeofIfMsghdr = 104
|
||||
pkg syscall (freebsd-arm), const SizeofSockaddrDatalink = 56
|
||||
pkg syscall (freebsd-arm), const SizeofSockaddrUnix = 108
|
||||
pkg syscall (freebsd-arm), const TIOCTIMESTAMP = 1074558041
|
||||
pkg syscall (freebsd-arm), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-arm), type BpfHdr struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm), type Stat_t struct, Pad_cgo_0 [4]uint8
|
||||
pkg syscall (freebsd-arm-cgo), const AF_MAX = 38
|
||||
pkg syscall (freebsd-arm-cgo), const BIOCGRTIMEOUT = 1074545262
|
||||
pkg syscall (freebsd-arm-cgo), const BIOCSRTIMEOUT = 2148287085
|
||||
pkg syscall (freebsd-arm-cgo), const ELAST = 94
|
||||
pkg syscall (freebsd-arm-cgo), const O_CLOEXEC = 0
|
||||
pkg syscall (freebsd-arm-cgo), const SIOCAIFADDR = 2151967019
|
||||
pkg syscall (freebsd-arm-cgo), const SIOCGIFSTATUS = 3274991931
|
||||
pkg syscall (freebsd-arm-cgo), const SIOCSIFPHYADDR = 2151967046
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET = 537
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT = 536
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET = 535
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT = 534
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET = 515
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT = 533
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofBpfHdr = 24
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofIfData = 88
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofIfMsghdr = 104
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofSockaddrDatalink = 56
|
||||
pkg syscall (freebsd-arm-cgo), const SizeofSockaddrUnix = 108
|
||||
pkg syscall (freebsd-arm-cgo), const TIOCTIMESTAMP = 1074558041
|
||||
pkg syscall (freebsd-arm-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm-cgo), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8
|
||||
pkg syscall (freebsd-arm-cgo), type Stat_t struct, Pad_cgo_0 [4]uint8
|
||||
pkg syscall (linux-386), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-386-cgo), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-amd64), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-amd64-cgo), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-arm), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (linux-arm-cgo), type Cmsghdr struct, X__cmsg_data [0]uint8
|
||||
pkg syscall (netbsd-arm), const SizeofIfData = 132
|
||||
pkg syscall (netbsd-arm), func Fchflags(string, int) error
|
||||
pkg syscall (netbsd-arm), type IfMsghdr struct, Pad_cgo_1 [4]uint8
|
||||
pkg syscall (netbsd-arm-cgo), const SizeofIfData = 132
|
||||
pkg syscall (netbsd-arm-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Pad_cgo_1 [4]uint8
|
||||
pkg syscall (openbsd-386), const BIOCGRTIMEOUT = 1074283118
|
||||
pkg syscall (openbsd-386), const BIOCSRTIMEOUT = 2148024941
|
||||
pkg syscall (openbsd-386), const RTF_FMASK = 63496
|
||||
pkg syscall (openbsd-386), const RTM_VERSION = 4
|
||||
pkg syscall (openbsd-386), const SIOCBRDGDADDR = 2150132039
|
||||
pkg syscall (openbsd-386), const SIOCBRDGGPARAM = 3224922456
|
||||
pkg syscall (openbsd-386), const SIOCBRDGSADDR = 3223873860
|
||||
pkg syscall (openbsd-386), const SYS_CLOCK_GETRES = 234
|
||||
pkg syscall (openbsd-386), const SYS_CLOCK_GETTIME = 232
|
||||
pkg syscall (openbsd-386), const SYS_CLOCK_SETTIME = 233
|
||||
pkg syscall (openbsd-386), const SYS_FHSTATFS = 309
|
||||
pkg syscall (openbsd-386), const SYS_FSTAT = 292
|
||||
pkg syscall (openbsd-386), const SYS_FSTATAT = 316
|
||||
pkg syscall (openbsd-386), const SYS_FSTATFS = 308
|
||||
pkg syscall (openbsd-386), const SYS_FUTIMENS = 327
|
||||
pkg syscall (openbsd-386), const SYS_FUTIMES = 206
|
||||
pkg syscall (openbsd-386), const SYS_GETDIRENTRIES = 312
|
||||
pkg syscall (openbsd-386), const SYS_GETDIRENTRIES ideal-int
|
||||
pkg syscall (openbsd-386), const SYS_GETFSSTAT = 306
|
||||
pkg syscall (openbsd-386), const SYS_GETITIMER = 86
|
||||
pkg syscall (openbsd-386), const SYS_GETRUSAGE = 117
|
||||
pkg syscall (openbsd-386), const SYS_GETTIMEOFDAY = 116
|
||||
pkg syscall (openbsd-386), const SYS_KEVENT = 270
|
||||
pkg syscall (openbsd-386), const SYS_LSTAT = 293
|
||||
pkg syscall (openbsd-386), const SYS_NANOSLEEP = 240
|
||||
pkg syscall (openbsd-386), const SYS_SELECT = 93
|
||||
pkg syscall (openbsd-386), const SYS_SETITIMER = 83
|
||||
pkg syscall (openbsd-386), const SYS_SETTIMEOFDAY = 122
|
||||
pkg syscall (openbsd-386), const SYS_STAT = 291
|
||||
pkg syscall (openbsd-386), const SYS_STATFS = 307
|
||||
pkg syscall (openbsd-386), const SYS_UTIMENSAT = 326
|
||||
pkg syscall (openbsd-386), const SYS_UTIMES = 138
|
||||
pkg syscall (openbsd-386), const SYS_WAIT4 = 7
|
||||
pkg syscall (openbsd-386), const SYS___THRSLEEP = 300
|
||||
pkg syscall (openbsd-386), const SizeofIfData = 208
|
||||
pkg syscall (openbsd-386), const SizeofIfMsghdr = 232
|
||||
pkg syscall (openbsd-386), const SizeofRtMetrics = 48
|
||||
pkg syscall (openbsd-386), const SizeofRtMsghdr = 88
|
||||
pkg syscall (openbsd-386), const TIOCGTSTAMP = 1074295899
|
||||
pkg syscall (openbsd-386), type Dirent struct, Fileno uint32
|
||||
pkg syscall (openbsd-386), type FdSet struct, Bits [32]int32
|
||||
pkg syscall (openbsd-386), type Kevent_t struct, Data int32
|
||||
pkg syscall (openbsd-386), type Mclpool struct, Grown uint32
|
||||
pkg syscall (openbsd-386), type RtMetrics struct, Expire uint32
|
||||
pkg syscall (openbsd-386), type Stat_t struct, Ino uint32
|
||||
pkg syscall (openbsd-386), type Stat_t struct, Lspare0 int32
|
||||
pkg syscall (openbsd-386), type Stat_t struct, Lspare1 int32
|
||||
pkg syscall (openbsd-386), type Stat_t struct, Qspare [2]int64
|
||||
pkg syscall (openbsd-386), type Statfs_t struct, F_ctime uint32
|
||||
pkg syscall (openbsd-386), type Statfs_t struct, F_spare [3]uint32
|
||||
pkg syscall (openbsd-386), type Timespec struct, Sec int32
|
||||
pkg syscall (openbsd-386), type Timeval struct, Sec int32
|
||||
pkg syscall (openbsd-386-cgo), const BIOCGRTIMEOUT = 1074283118
|
||||
pkg syscall (openbsd-386-cgo), const BIOCSRTIMEOUT = 2148024941
|
||||
pkg syscall (openbsd-386-cgo), const RTF_FMASK = 63496
|
||||
pkg syscall (openbsd-386-cgo), const RTM_VERSION = 4
|
||||
pkg syscall (openbsd-386-cgo), const SIOCBRDGDADDR = 2150132039
|
||||
pkg syscall (openbsd-386-cgo), const SIOCBRDGGPARAM = 3224922456
|
||||
pkg syscall (openbsd-386-cgo), const SIOCBRDGSADDR = 3223873860
|
||||
pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETRES = 234
|
||||
pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETTIME = 232
|
||||
pkg syscall (openbsd-386-cgo), const SYS_CLOCK_SETTIME = 233
|
||||
pkg syscall (openbsd-386-cgo), const SYS_FHSTATFS = 309
|
||||
pkg syscall (openbsd-386-cgo), const SYS_FSTAT = 292
|
||||
pkg syscall (openbsd-386-cgo), const SYS_FSTATAT = 316
|
||||
pkg syscall (openbsd-386-cgo), const SYS_FSTATFS = 308
|
||||
pkg syscall (openbsd-386-cgo), const SYS_FUTIMENS = 327
|
||||
pkg syscall (openbsd-386-cgo), const SYS_FUTIMES = 206
|
||||
pkg syscall (openbsd-386-cgo), const SYS_GETDIRENTRIES = 312
|
||||
pkg syscall (openbsd-386-cgo), const SYS_GETDIRENTRIES ideal-int
|
||||
pkg syscall (openbsd-386-cgo), const SYS_GETFSSTAT = 306
|
||||
pkg syscall (openbsd-386-cgo), const SYS_GETITIMER = 86
|
||||
pkg syscall (openbsd-386-cgo), const SYS_GETRUSAGE = 117
|
||||
pkg syscall (openbsd-386-cgo), const SYS_GETTIMEOFDAY = 116
|
||||
pkg syscall (openbsd-386-cgo), const SYS_KEVENT = 270
|
||||
pkg syscall (openbsd-386-cgo), const SYS_LSTAT = 293
|
||||
pkg syscall (openbsd-386-cgo), const SYS_NANOSLEEP = 240
|
||||
pkg syscall (openbsd-386-cgo), const SYS_SELECT = 93
|
||||
pkg syscall (openbsd-386-cgo), const SYS_SETITIMER = 83
|
||||
pkg syscall (openbsd-386-cgo), const SYS_SETTIMEOFDAY = 122
|
||||
pkg syscall (openbsd-386-cgo), const SYS_STAT = 291
|
||||
pkg syscall (openbsd-386-cgo), const SYS_STATFS = 307
|
||||
pkg syscall (openbsd-386-cgo), const SYS_UTIMENSAT = 326
|
||||
pkg syscall (openbsd-386-cgo), const SYS_UTIMES = 138
|
||||
pkg syscall (openbsd-386-cgo), const SYS_WAIT4 = 7
|
||||
pkg syscall (openbsd-386-cgo), const SYS___THRSLEEP = 300
|
||||
pkg syscall (openbsd-386-cgo), const SizeofIfData = 208
|
||||
pkg syscall (openbsd-386-cgo), const SizeofIfMsghdr = 232
|
||||
pkg syscall (openbsd-386-cgo), const SizeofRtMetrics = 48
|
||||
pkg syscall (openbsd-386-cgo), const SizeofRtMsghdr = 88
|
||||
pkg syscall (openbsd-386-cgo), const TIOCGTSTAMP = 1074295899
|
||||
pkg syscall (openbsd-386-cgo), type Dirent struct, Fileno uint32
|
||||
pkg syscall (openbsd-386-cgo), type FdSet struct, Bits [32]int32
|
||||
pkg syscall (openbsd-386-cgo), type Kevent_t struct, Data int32
|
||||
pkg syscall (openbsd-386-cgo), type Mclpool struct, Grown uint32
|
||||
pkg syscall (openbsd-386-cgo), type RtMetrics struct, Expire uint32
|
||||
pkg syscall (openbsd-386-cgo), type Stat_t struct, Ino uint32
|
||||
pkg syscall (openbsd-386-cgo), type Stat_t struct, Lspare0 int32
|
||||
pkg syscall (openbsd-386-cgo), type Stat_t struct, Lspare1 int32
|
||||
pkg syscall (openbsd-386-cgo), type Stat_t struct, Qspare [2]int64
|
||||
pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_ctime uint32
|
||||
pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_spare [3]uint32
|
||||
pkg syscall (openbsd-386-cgo), type Timespec struct, Sec int32
|
||||
pkg syscall (openbsd-386-cgo), type Timeval struct, Sec int32
|
||||
pkg syscall (openbsd-amd64), const CCR0_FLUSH = 16
|
||||
pkg syscall (openbsd-amd64), const CCR0_FLUSH ideal-int
|
||||
pkg syscall (openbsd-amd64), const CPUID_CFLUSH = 524288
|
||||
pkg syscall (openbsd-amd64), const CPUID_CFLUSH ideal-int
|
||||
pkg syscall (openbsd-amd64), const EFER_LMA = 1024
|
||||
pkg syscall (openbsd-amd64), const EFER_LMA ideal-int
|
||||
pkg syscall (openbsd-amd64), const EFER_LME = 256
|
||||
pkg syscall (openbsd-amd64), const EFER_LME ideal-int
|
||||
pkg syscall (openbsd-amd64), const EFER_NXE = 2048
|
||||
pkg syscall (openbsd-amd64), const EFER_NXE ideal-int
|
||||
pkg syscall (openbsd-amd64), const EFER_SCE = 1
|
||||
pkg syscall (openbsd-amd64), const EFER_SCE ideal-int
|
||||
pkg syscall (openbsd-amd64), const PMC5_PIPELINE_FLUSH = 21
|
||||
pkg syscall (openbsd-amd64), const PMC5_PIPELINE_FLUSH ideal-int
|
||||
pkg syscall (openbsd-amd64), const RTF_FMASK = 63496
|
||||
pkg syscall (openbsd-amd64), const RTM_VERSION = 4
|
||||
pkg syscall (openbsd-amd64), const SIOCBRDGDADDR = 2150132039
|
||||
pkg syscall (openbsd-amd64), const SIOCBRDGSADDR = 3223873860
|
||||
pkg syscall (openbsd-amd64), const SYS_CLOCK_GETRES = 234
|
||||
pkg syscall (openbsd-amd64), const SYS_CLOCK_GETTIME = 232
|
||||
pkg syscall (openbsd-amd64), const SYS_CLOCK_SETTIME = 233
|
||||
pkg syscall (openbsd-amd64), const SYS_FHSTATFS = 309
|
||||
pkg syscall (openbsd-amd64), const SYS_FSTAT = 292
|
||||
pkg syscall (openbsd-amd64), const SYS_FSTATAT = 316
|
||||
pkg syscall (openbsd-amd64), const SYS_FSTATFS = 308
|
||||
pkg syscall (openbsd-amd64), const SYS_FUTIMENS = 327
|
||||
pkg syscall (openbsd-amd64), const SYS_FUTIMES = 206
|
||||
pkg syscall (openbsd-amd64), const SYS_GETDIRENTRIES = 312
|
||||
pkg syscall (openbsd-amd64), const SYS_GETDIRENTRIES ideal-int
|
||||
pkg syscall (openbsd-amd64), const SYS_GETFSSTAT = 306
|
||||
pkg syscall (openbsd-amd64), const SYS_GETITIMER = 86
|
||||
pkg syscall (openbsd-amd64), const SYS_GETRUSAGE = 117
|
||||
pkg syscall (openbsd-amd64), const SYS_GETTIMEOFDAY = 116
|
||||
pkg syscall (openbsd-amd64), const SYS_KEVENT = 270
|
||||
pkg syscall (openbsd-amd64), const SYS_LSTAT = 293
|
||||
pkg syscall (openbsd-amd64), const SYS_NANOSLEEP = 240
|
||||
pkg syscall (openbsd-amd64), const SYS_SELECT = 93
|
||||
pkg syscall (openbsd-amd64), const SYS_SETITIMER = 83
|
||||
pkg syscall (openbsd-amd64), const SYS_SETTIMEOFDAY = 122
|
||||
pkg syscall (openbsd-amd64), const SYS_STAT = 291
|
||||
pkg syscall (openbsd-amd64), const SYS_STATFS = 307
|
||||
pkg syscall (openbsd-amd64), const SYS_UTIMENSAT = 326
|
||||
pkg syscall (openbsd-amd64), const SYS_UTIMES = 138
|
||||
pkg syscall (openbsd-amd64), const SYS_WAIT4 = 7
|
||||
pkg syscall (openbsd-amd64), const SYS___THRSLEEP = 300
|
||||
pkg syscall (openbsd-amd64), const SizeofRtMetrics = 48
|
||||
pkg syscall (openbsd-amd64), const SizeofRtMsghdr = 88
|
||||
pkg syscall (openbsd-amd64), type Dirent struct, Fileno uint32
|
||||
pkg syscall (openbsd-amd64), type FdSet struct, Bits [32]int32
|
||||
pkg syscall (openbsd-amd64), type Kevent_t struct, Data int32
|
||||
pkg syscall (openbsd-amd64), type Kevent_t struct, Ident uint32
|
||||
pkg syscall (openbsd-amd64), type Mclpool struct, Grown uint32
|
||||
pkg syscall (openbsd-amd64), type RtMetrics struct, Expire uint32
|
||||
pkg syscall (openbsd-amd64), type Stat_t struct, Ino uint32
|
||||
pkg syscall (openbsd-amd64), type Stat_t struct, Lspare0 int32
|
||||
pkg syscall (openbsd-amd64), type Stat_t struct, Lspare1 int32
|
||||
pkg syscall (openbsd-amd64), type Stat_t struct, Qspare [2]int64
|
||||
pkg syscall (openbsd-amd64), type Statfs_t struct, F_ctime uint32
|
||||
pkg syscall (openbsd-amd64), type Statfs_t struct, F_spare [3]uint32
|
||||
pkg syscall (openbsd-amd64), type Statfs_t struct, Pad_cgo_1 [4]uint8
|
||||
pkg syscall (openbsd-amd64), type Timespec struct, Pad_cgo_0 [4]uint8
|
||||
pkg syscall (openbsd-amd64), type Timespec struct, Sec int32
|
||||
pkg syscall (openbsd-amd64-cgo), const CCR0_FLUSH = 16
|
||||
pkg syscall (openbsd-amd64-cgo), const CCR0_FLUSH ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const CPUID_CFLUSH = 524288
|
||||
pkg syscall (openbsd-amd64-cgo), const CPUID_CFLUSH ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_LMA = 1024
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_LMA ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_LME = 256
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_LME ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_NXE = 2048
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_NXE ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_SCE = 1
|
||||
pkg syscall (openbsd-amd64-cgo), const EFER_SCE ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const PMC5_PIPELINE_FLUSH = 21
|
||||
pkg syscall (openbsd-amd64-cgo), const PMC5_PIPELINE_FLUSH ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const RTF_FMASK = 63496
|
||||
pkg syscall (openbsd-amd64-cgo), const RTM_VERSION = 4
|
||||
pkg syscall (openbsd-amd64-cgo), const SIOCBRDGDADDR = 2150132039
|
||||
pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSADDR = 3223873860
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETRES = 234
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETTIME = 232
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_SETTIME = 233
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_FHSTATFS = 309
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_FSTAT = 292
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_FSTATAT = 316
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_FSTATFS = 308
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMENS = 327
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMES = 206
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_GETDIRENTRIES = 312
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_GETDIRENTRIES ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_GETFSSTAT = 306
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_GETITIMER = 86
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_GETRUSAGE = 117
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_GETTIMEOFDAY = 116
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_KEVENT = 270
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_LSTAT = 293
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_NANOSLEEP = 240
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_SELECT = 93
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_SETITIMER = 83
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_SETTIMEOFDAY = 122
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_STAT = 291
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_STATFS = 307
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_UTIMENSAT = 326
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_UTIMES = 138
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_WAIT4 = 7
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS___THRSLEEP = 300
|
||||
pkg syscall (openbsd-amd64-cgo), const SizeofRtMetrics = 48
|
||||
pkg syscall (openbsd-amd64-cgo), const SizeofRtMsghdr = 88
|
||||
pkg syscall (openbsd-amd64-cgo), type Dirent struct, Fileno uint32
|
||||
pkg syscall (openbsd-amd64-cgo), type FdSet struct, Bits [32]int32
|
||||
pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Data int32
|
||||
pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Ident uint32
|
||||
pkg syscall (openbsd-amd64-cgo), type Mclpool struct, Grown uint32
|
||||
pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Expire uint32
|
||||
pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Ino uint32
|
||||
pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Lspare0 int32
|
||||
pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Lspare1 int32
|
||||
pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Qspare [2]int64
|
||||
pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_ctime uint32
|
||||
pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_spare [3]uint32
|
||||
pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, Pad_cgo_1 [4]uint8
|
||||
pkg syscall (openbsd-amd64-cgo), type Timespec struct, Pad_cgo_0 [4]uint8
|
||||
pkg syscall (openbsd-amd64-cgo), type Timespec struct, Sec int32
|
||||
pkg testing, func RegisterCover(Cover)
|
||||
pkg testing, func MainStart(func(string, string) (bool, error), []InternalTest, []InternalBenchmark, []InternalExample) *M
|
||||
pkg text/template/parse, type DotNode bool
|
||||
pkg text/template/parse, type Node interface { Copy, String, Type }
|
||||
pkg unicode, const Version = "6.2.0"
|
||||
pkg unicode, const Version = "6.3.0"
|
||||
pkg unicode, const Version = "7.0.0"
|
||||
pkg unicode, const Version = "8.0.0"
|
||||
pkg syscall (openbsd-386), const SYS_KILL = 37
|
||||
pkg syscall (openbsd-386-cgo), const SYS_KILL = 37
|
||||
pkg syscall (openbsd-amd64), const SYS_KILL = 37
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_KILL = 37
|
||||
|
||||
48654
api/go1.1.txt
32484
api/go1.2.txt
2053
api/go1.3.txt
604
api/go1.4.txt
@@ -1,604 +0,0 @@
|
||||
# CL 134210043 archive/zip: add Writer.Flush, Brad Fitzpatrick <bradfitz@golang.org>
|
||||
pkg archive/zip, method (*Writer) Flush() error
|
||||
|
||||
# CL 97140043 compress/flate: add Reset() to allow reusing large buffers to compress multiple buffers, James Robinson <jamesr@google.com>
|
||||
pkg compress/flate, type Resetter interface { Reset }
|
||||
pkg compress/flate, type Resetter interface, Reset(io.Reader, []uint8) error
|
||||
pkg compress/zlib, type Resetter interface { Reset }
|
||||
pkg compress/zlib, type Resetter interface, Reset(io.Reader, []uint8) error
|
||||
|
||||
# CL 159120044 compress/gzip: allow stopping at end of first stream, Russ Cox <rsc@golang.org>
|
||||
pkg compress/gzip, method (*Reader) Multistream(bool)
|
||||
|
||||
# CL 138800043 crypto: Add SHA3 functions in go.crypto/sha3 to the Hash enum., David Leon Gil <coruus@gmail.com>
|
||||
pkg crypto, const SHA3_224 = 10
|
||||
pkg crypto, const SHA3_224 Hash
|
||||
pkg crypto, const SHA3_256 = 11
|
||||
pkg crypto, const SHA3_256 Hash
|
||||
pkg crypto, const SHA3_384 = 12
|
||||
pkg crypto, const SHA3_384 Hash
|
||||
pkg crypto, const SHA3_512 = 13
|
||||
pkg crypto, const SHA3_512 Hash
|
||||
|
||||
# CL 114680043 crypto: add Signer, Adam Langley <agl@golang.org>
|
||||
pkg crypto, method (Hash) HashFunc() Hash
|
||||
pkg crypto, type Signer interface { Public, Sign }
|
||||
pkg crypto, type Signer interface, Public() PublicKey
|
||||
pkg crypto, type Signer interface, Sign(io.Reader, []uint8, SignerOpts) ([]uint8, error)
|
||||
pkg crypto, type SignerOpts interface { HashFunc }
|
||||
pkg crypto, type SignerOpts interface, HashFunc() Hash
|
||||
pkg crypto/ecdsa, method (*PrivateKey) Public() crypto.PublicKey
|
||||
pkg crypto/ecdsa, method (*PrivateKey) Sign(io.Reader, []uint8, crypto.SignerOpts) ([]uint8, error)
|
||||
pkg crypto/rsa, method (*PSSOptions) HashFunc() crypto.Hash
|
||||
pkg crypto/rsa, method (*PrivateKey) Public() crypto.PublicKey
|
||||
pkg crypto/rsa, method (*PrivateKey) Sign(io.Reader, []uint8, crypto.SignerOpts) ([]uint8, error)
|
||||
pkg crypto/rsa, type PSSOptions struct, Hash crypto.Hash
|
||||
|
||||
# CL 157090043 crypto/tls: support TLS_FALLBACK_SCSV as a server., Adam Langley <agl@golang.org>
|
||||
pkg crypto/tls, const TLS_FALLBACK_SCSV = 22016
|
||||
pkg crypto/tls, const TLS_FALLBACK_SCSV uint16
|
||||
|
||||
# CL 107400043 crypto/tls: Added dynamic alternative to NameToCertificate map for SNI, Percy Wegmann <ox.to.a.cart@gmail.com>
|
||||
pkg crypto/tls, type ClientHelloInfo struct
|
||||
pkg crypto/tls, type ClientHelloInfo struct, CipherSuites []uint16
|
||||
pkg crypto/tls, type ClientHelloInfo struct, ServerName string
|
||||
pkg crypto/tls, type ClientHelloInfo struct, SupportedCurves []CurveID
|
||||
pkg crypto/tls, type ClientHelloInfo struct, SupportedPoints []uint8
|
||||
pkg crypto/tls, type Config struct, GetCertificate func(*ClientHelloInfo) (*Certificate, error)
|
||||
pkg crypto/tls, type ConnectionState struct, TLSUnique []uint8
|
||||
|
||||
# CL 153420045 crypto/x509: continue to recognise MaxPathLen of zero as "no value"., Adam Langley <agl@golang.org>
|
||||
pkg crypto/x509, type Certificate struct, MaxPathLenZero bool
|
||||
|
||||
# CL 158950043 database/sql: add Drivers, returning list of registered drivers, Russ Cox <rsc@golang.org>
|
||||
pkg database/sql, func Drivers() []string
|
||||
|
||||
# CL 117280043 debug/dwarf: fix Reader panic on DW_TAG_unspecified_type, Derek Parker <parkerderek86@gmail.com>
|
||||
pkg debug/dwarf, method (*UnspecifiedType) Basic() *BasicType
|
||||
pkg debug/dwarf, method (*UnspecifiedType) Common() *CommonType
|
||||
pkg debug/dwarf, method (*UnspecifiedType) Size() int64
|
||||
pkg debug/dwarf, method (*UnspecifiedType) String() string
|
||||
pkg debug/dwarf, type UnspecifiedType struct
|
||||
pkg debug/dwarf, type UnspecifiedType struct, embedded BasicType
|
||||
|
||||
# CL 132000043 debug/elf: support arm64 relocations, Michael Hudson-Doyle <michael.hudson@linaro.org>
|
||||
pkg debug/elf, const EM_AARCH64 = 183
|
||||
pkg debug/elf, const EM_AARCH64 Machine
|
||||
pkg debug/elf, const R_AARCH64_ABS16 = 259
|
||||
pkg debug/elf, const R_AARCH64_ABS16 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_ABS32 = 258
|
||||
pkg debug/elf, const R_AARCH64_ABS32 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_ABS64 = 257
|
||||
pkg debug/elf, const R_AARCH64_ABS64 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_ADD_ABS_LO12_NC = 277
|
||||
pkg debug/elf, const R_AARCH64_ADD_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_ADR_GOT_PAGE = 311
|
||||
pkg debug/elf, const R_AARCH64_ADR_GOT_PAGE R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_ADR_PREL_LO21 = 274
|
||||
pkg debug/elf, const R_AARCH64_ADR_PREL_LO21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_ADR_PREL_PG_HI21 = 275
|
||||
pkg debug/elf, const R_AARCH64_ADR_PREL_PG_HI21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_ADR_PREL_PG_HI21_NC = 276
|
||||
pkg debug/elf, const R_AARCH64_ADR_PREL_PG_HI21_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_CALL26 = 283
|
||||
pkg debug/elf, const R_AARCH64_CALL26 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_CONDBR19 = 280
|
||||
pkg debug/elf, const R_AARCH64_CONDBR19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_COPY = 1024
|
||||
pkg debug/elf, const R_AARCH64_COPY R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_GLOB_DAT = 1025
|
||||
pkg debug/elf, const R_AARCH64_GLOB_DAT R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_GOT_LD_PREL19 = 309
|
||||
pkg debug/elf, const R_AARCH64_GOT_LD_PREL19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_IRELATIVE = 1032
|
||||
pkg debug/elf, const R_AARCH64_IRELATIVE R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_JUMP26 = 282
|
||||
pkg debug/elf, const R_AARCH64_JUMP26 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_JUMP_SLOT = 1026
|
||||
pkg debug/elf, const R_AARCH64_JUMP_SLOT R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOT_LO12_NC = 312
|
||||
pkg debug/elf, const R_AARCH64_LD64_GOT_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_LDST128_ABS_LO12_NC = 299
|
||||
pkg debug/elf, const R_AARCH64_LDST128_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_LDST16_ABS_LO12_NC = 284
|
||||
pkg debug/elf, const R_AARCH64_LDST16_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_LDST32_ABS_LO12_NC = 285
|
||||
pkg debug/elf, const R_AARCH64_LDST32_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_LDST64_ABS_LO12_NC = 286
|
||||
pkg debug/elf, const R_AARCH64_LDST64_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_LDST8_ABS_LO12_NC = 278
|
||||
pkg debug/elf, const R_AARCH64_LDST8_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_LD_PREL_LO19 = 273
|
||||
pkg debug/elf, const R_AARCH64_LD_PREL_LO19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_SABS_G0 = 270
|
||||
pkg debug/elf, const R_AARCH64_MOVW_SABS_G0 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_SABS_G1 = 271
|
||||
pkg debug/elf, const R_AARCH64_MOVW_SABS_G1 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_SABS_G2 = 272
|
||||
pkg debug/elf, const R_AARCH64_MOVW_SABS_G2 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G0 = 263
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G0 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G0_NC = 264
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G0_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G1 = 265
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G1 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G1_NC = 266
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G1_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G2 = 267
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G2 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G2_NC = 268
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G2_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G3 = 269
|
||||
pkg debug/elf, const R_AARCH64_MOVW_UABS_G3 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_NONE = 0
|
||||
pkg debug/elf, const R_AARCH64_NONE R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_NULL = 256
|
||||
pkg debug/elf, const R_AARCH64_NULL R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_ABS16 = 2
|
||||
pkg debug/elf, const R_AARCH64_P32_ABS16 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_ABS32 = 1
|
||||
pkg debug/elf, const R_AARCH64_P32_ABS32 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_ADD_ABS_LO12_NC = 12
|
||||
pkg debug/elf, const R_AARCH64_P32_ADD_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_ADR_GOT_PAGE = 26
|
||||
pkg debug/elf, const R_AARCH64_P32_ADR_GOT_PAGE R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_ADR_PREL_LO21 = 10
|
||||
pkg debug/elf, const R_AARCH64_P32_ADR_PREL_LO21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_ADR_PREL_PG_HI21 = 11
|
||||
pkg debug/elf, const R_AARCH64_P32_ADR_PREL_PG_HI21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_CALL26 = 21
|
||||
pkg debug/elf, const R_AARCH64_P32_CALL26 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_CONDBR19 = 19
|
||||
pkg debug/elf, const R_AARCH64_P32_CONDBR19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_COPY = 180
|
||||
pkg debug/elf, const R_AARCH64_P32_COPY R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_GLOB_DAT = 181
|
||||
pkg debug/elf, const R_AARCH64_P32_GLOB_DAT R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_GOT_LD_PREL19 = 25
|
||||
pkg debug/elf, const R_AARCH64_P32_GOT_LD_PREL19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_IRELATIVE = 188
|
||||
pkg debug/elf, const R_AARCH64_P32_IRELATIVE R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_JUMP26 = 20
|
||||
pkg debug/elf, const R_AARCH64_P32_JUMP26 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_JUMP_SLOT = 182
|
||||
pkg debug/elf, const R_AARCH64_P32_JUMP_SLOT R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_LD32_GOT_LO12_NC = 27
|
||||
pkg debug/elf, const R_AARCH64_P32_LD32_GOT_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST128_ABS_LO12_NC = 17
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST128_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST16_ABS_LO12_NC = 14
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST16_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST32_ABS_LO12_NC = 15
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST32_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST64_ABS_LO12_NC = 16
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST64_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST8_ABS_LO12_NC = 13
|
||||
pkg debug/elf, const R_AARCH64_P32_LDST8_ABS_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_LD_PREL_LO19 = 9
|
||||
pkg debug/elf, const R_AARCH64_P32_LD_PREL_LO19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_MOVW_SABS_G0 = 8
|
||||
pkg debug/elf, const R_AARCH64_P32_MOVW_SABS_G0 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G0 = 5
|
||||
pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G0 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G0_NC = 6
|
||||
pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G0_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G1 = 7
|
||||
pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G1 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_PREL16 = 4
|
||||
pkg debug/elf, const R_AARCH64_P32_PREL16 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_PREL32 = 3
|
||||
pkg debug/elf, const R_AARCH64_P32_PREL32 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_RELATIVE = 183
|
||||
pkg debug/elf, const R_AARCH64_P32_RELATIVE R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC = 187
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADD_LO12_NC = 126
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADD_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADR_PAGE21 = 124
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADR_PAGE21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADR_PREL21 = 123
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADR_PREL21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_CALL = 127
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_CALL R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_LD32_LO12_NC = 125
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_LD32_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_LD_PREL19 = 122
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSDESC_LD_PREL19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSGD_ADD_LO12_NC = 82
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSGD_ADD_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSGD_ADR_PAGE21 = 81
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSGD_ADR_PAGE21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21 = 103
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC = 104
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19 = 105
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_HI12 = 109
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_HI12 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_LO12 = 110
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_LO12 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC = 111
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G0 = 107
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G0 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC = 108
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G1 = 106
|
||||
pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G1 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLS_DTPMOD = 184
|
||||
pkg debug/elf, const R_AARCH64_P32_TLS_DTPMOD R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLS_DTPREL = 185
|
||||
pkg debug/elf, const R_AARCH64_P32_TLS_DTPREL R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TLS_TPREL = 186
|
||||
pkg debug/elf, const R_AARCH64_P32_TLS_TPREL R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_P32_TSTBR14 = 18
|
||||
pkg debug/elf, const R_AARCH64_P32_TSTBR14 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_PREL16 = 262
|
||||
pkg debug/elf, const R_AARCH64_PREL16 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_PREL32 = 261
|
||||
pkg debug/elf, const R_AARCH64_PREL32 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_PREL64 = 260
|
||||
pkg debug/elf, const R_AARCH64_PREL64 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_RELATIVE = 1027
|
||||
pkg debug/elf, const R_AARCH64_RELATIVE R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC = 1031
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_ADD = 568
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_ADD R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_ADD_LO12_NC = 564
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_ADD_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_ADR_PAGE21 = 562
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_ADR_PAGE21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_ADR_PREL21 = 561
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_ADR_PREL21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_CALL = 569
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_CALL R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_LD64_LO12_NC = 563
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_LD64_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_LDR = 567
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_LDR R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_LD_PREL19 = 560
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_LD_PREL19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_OFF_G0_NC = 566
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_OFF_G0_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_OFF_G1 = 565
|
||||
pkg debug/elf, const R_AARCH64_TLSDESC_OFF_G1 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_ADD_LO12_NC = 514
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_ADD_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_ADR_PAGE21 = 513
|
||||
pkg debug/elf, const R_AARCH64_TLSGD_ADR_PAGE21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 = 541
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC = 542
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 = 543
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC = 540
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 = 539
|
||||
pkg debug/elf, const R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_HI12 = 549
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_HI12 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_LO12 = 550
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_LO12 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_LO12_NC = 551
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_LO12_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G0 = 547
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G0 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G0_NC = 548
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G0_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G1 = 545
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G1 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G1_NC = 546
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G1_NC R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G2 = 544
|
||||
pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G2 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLS_DTPMOD64 = 1028
|
||||
pkg debug/elf, const R_AARCH64_TLS_DTPMOD64 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLS_DTPREL64 = 1029
|
||||
pkg debug/elf, const R_AARCH64_TLS_DTPREL64 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TLS_TPREL64 = 1030
|
||||
pkg debug/elf, const R_AARCH64_TLS_TPREL64 R_AARCH64
|
||||
pkg debug/elf, const R_AARCH64_TSTBR14 = 279
|
||||
pkg debug/elf, const R_AARCH64_TSTBR14 R_AARCH64
|
||||
pkg debug/elf, method (R_AARCH64) GoString() string
|
||||
pkg debug/elf, method (R_AARCH64) String() string
|
||||
pkg debug/elf, type R_AARCH64 int
|
||||
|
||||
# CL 107530043 debug/elf: add (*File).DynamicSymbols, ErrNoSymbols, and tests for (*File).Symbols and (*File).DynamicSymbols, and formalize symbol order., Pietro Gagliardi <pietro10@mac.com>
|
||||
pkg debug/elf, method (*File) DynamicSymbols() ([]Symbol, error)
|
||||
pkg debug/elf, var ErrNoSymbols error
|
||||
|
||||
# CL 106460044 debug/plan9obj, cmd/addr2line: on Plan 9 use a.out header, Aram Hăvărneanu <aram@mgk.ro>
|
||||
pkg debug/plan9obj, type FileHeader struct, HdrSize uint64
|
||||
pkg debug/plan9obj, type FileHeader struct, LoadAddress uint64
|
||||
|
||||
# CL 122960043 encoding/xml: add InputOffset method to Decoder, Russ Cox <rsc@golang.org>
|
||||
pkg encoding/xml, method (*Decoder) InputOffset() int64
|
||||
|
||||
# CL 124940043 cmd/go, go/build: implement import comment checking, Russ Cox <rsc@golang.org>
|
||||
pkg go/build, const ImportComment = 4
|
||||
pkg go/build, const ImportComment ImportMode
|
||||
pkg go/build, type Package struct, ImportComment string
|
||||
|
||||
# CL 155050043 go/build: Return MultiplePackageError on importing a dir containing multiple packages, Jens Frederich <jfrederich@gmail.com>
|
||||
pkg go/build, method (*MultiplePackageError) Error() string
|
||||
pkg go/build, type MultiplePackageError struct
|
||||
pkg go/build, type MultiplePackageError struct, Dir string
|
||||
pkg go/build, type MultiplePackageError struct, Files []string
|
||||
pkg go/build, type MultiplePackageError struct, Packages []string
|
||||
|
||||
# CL 135110044 go/token: implement PositionFor accessors, Robert Griesemer <gri@golang.org>
|
||||
pkg go/token, method (*File) PositionFor(Pos, bool) Position
|
||||
pkg go/token, method (*FileSet) PositionFor(Pos, bool) Position
|
||||
|
||||
# CL 109000049 image: add RGBAAt, Gray16At, etc., ChaiShushan <chaishushan@gmail.com>
|
||||
pkg image, method (*Alpha) AlphaAt(int, int) color.Alpha
|
||||
pkg image, method (*Alpha16) Alpha16At(int, int) color.Alpha16
|
||||
pkg image, method (*Gray) GrayAt(int, int) color.Gray
|
||||
pkg image, method (*Gray16) Gray16At(int, int) color.Gray16
|
||||
pkg image, method (*NRGBA) NRGBAAt(int, int) color.NRGBA
|
||||
pkg image, method (*NRGBA64) NRGBA64At(int, int) color.NRGBA64
|
||||
pkg image, method (*RGBA) RGBAAt(int, int) color.RGBA
|
||||
pkg image, method (*RGBA64) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*YCbCr) YCbCrAt(int, int) color.YCbCr
|
||||
|
||||
# CL 129190043 png: make the encoder configurable, Jeff R. Allen <jra@nella.org>
|
||||
pkg image/png, const BestCompression = -3
|
||||
pkg image/png, const BestCompression CompressionLevel
|
||||
pkg image/png, const BestSpeed = -2
|
||||
pkg image/png, const BestSpeed CompressionLevel
|
||||
pkg image/png, const DefaultCompression = 0
|
||||
pkg image/png, const DefaultCompression CompressionLevel
|
||||
pkg image/png, const NoCompression = -1
|
||||
pkg image/png, const NoCompression CompressionLevel
|
||||
pkg image/png, method (*Encoder) Encode(io.Writer, image.Image) error
|
||||
pkg image/png, type CompressionLevel int
|
||||
pkg image/png, type Encoder struct
|
||||
pkg image/png, type Encoder struct, CompressionLevel CompressionLevel
|
||||
|
||||
# CL 101750048 math: implement Nextafter32, Robert Griesemer <gri@golang.org>
|
||||
pkg math, func Nextafter32(float32, float32) float32
|
||||
|
||||
# CL 93550043 math/big: implement Rat.Float32, Robert Griesemer <gri@golang.org>
|
||||
pkg math/big, method (*Rat) Float32() (float32, bool)
|
||||
|
||||
# CL 76540043 net/http: add BasicAuth method to *http.Request, Kelsey Hightower <kelsey.hightower@gmail.com>
|
||||
pkg net/http, method (*Request) BasicAuth() (string, string, bool)
|
||||
|
||||
# CL 137940043 net/http: add Transport.DialTLS hook, Brad Fitzpatrick <bradfitz@golang.org>
|
||||
pkg net/http, type Transport struct, DialTLS func(string, string) (net.Conn, error)
|
||||
|
||||
# CL 132750043 net/http/httputil: Pass a Logger to ReverseProxy, allowing the user to control logging., Mark Theunissen <mark.theunissen@gmail.com>
|
||||
pkg net/http/httputil, type ReverseProxy struct, ErrorLog *log.Logger
|
||||
|
||||
# CL 148370043 os, syscall: add Unsetenv, Brad Fitzpatrick <bradfitz@golang.org>
|
||||
pkg os, func Unsetenv(string) error
|
||||
pkg syscall, func Unsetenv(string) error
|
||||
|
||||
# CL 144020043 reflect: add Type.Comparable, Russ Cox <rsc@golang.org>
|
||||
pkg reflect, type Type interface, Comparable() bool
|
||||
|
||||
# CL 153670043 runtime: add PauseEnd array to MemStats and GCStats, Jens Frederich <jfrederich@gmail.com>
|
||||
pkg runtime, type MemStats struct, PauseEnd [256]uint64
|
||||
pkg runtime/debug, type GCStats struct, PauseEnd []time.Time
|
||||
|
||||
# CL 136710045 sync/atomic: add Value, Dmitriy Vyukov <dvyukov@google.com>
|
||||
pkg sync/atomic, method (*Value) Load() interface{}
|
||||
pkg sync/atomic, method (*Value) Store(interface{})
|
||||
pkg sync/atomic, type Value struct
|
||||
|
||||
# CL 126190043 syscall: support UID/GID map files for Linux user namespaces, Mrunal Patel <mrunalp@gmail.com>
|
||||
pkg syscall (linux-386), type SysProcAttr struct, GidMappings []SysProcIDMap
|
||||
pkg syscall (linux-386), type SysProcAttr struct, UidMappings []SysProcIDMap
|
||||
pkg syscall (linux-386), type SysProcIDMap struct
|
||||
pkg syscall (linux-386), type SysProcIDMap struct, ContainerID int
|
||||
pkg syscall (linux-386), type SysProcIDMap struct, HostID int
|
||||
pkg syscall (linux-386), type SysProcIDMap struct, Size int
|
||||
pkg syscall (linux-386-cgo), type SysProcAttr struct, GidMappings []SysProcIDMap
|
||||
pkg syscall (linux-386-cgo), type SysProcAttr struct, UidMappings []SysProcIDMap
|
||||
pkg syscall (linux-386-cgo), type SysProcIDMap struct
|
||||
pkg syscall (linux-386-cgo), type SysProcIDMap struct, ContainerID int
|
||||
pkg syscall (linux-386-cgo), type SysProcIDMap struct, HostID int
|
||||
pkg syscall (linux-386-cgo), type SysProcIDMap struct, Size int
|
||||
pkg syscall (linux-amd64), type SysProcAttr struct, GidMappings []SysProcIDMap
|
||||
pkg syscall (linux-amd64), type SysProcAttr struct, UidMappings []SysProcIDMap
|
||||
pkg syscall (linux-amd64), type SysProcIDMap struct
|
||||
pkg syscall (linux-amd64), type SysProcIDMap struct, ContainerID int
|
||||
pkg syscall (linux-amd64), type SysProcIDMap struct, HostID int
|
||||
pkg syscall (linux-amd64), type SysProcIDMap struct, Size int
|
||||
pkg syscall (linux-amd64-cgo), type SysProcAttr struct, GidMappings []SysProcIDMap
|
||||
pkg syscall (linux-amd64-cgo), type SysProcAttr struct, UidMappings []SysProcIDMap
|
||||
pkg syscall (linux-amd64-cgo), type SysProcIDMap struct
|
||||
pkg syscall (linux-amd64-cgo), type SysProcIDMap struct, ContainerID int
|
||||
pkg syscall (linux-amd64-cgo), type SysProcIDMap struct, HostID int
|
||||
pkg syscall (linux-amd64-cgo), type SysProcIDMap struct, Size int
|
||||
pkg syscall (linux-arm), type SysProcAttr struct, GidMappings []SysProcIDMap
|
||||
pkg syscall (linux-arm), type SysProcAttr struct, UidMappings []SysProcIDMap
|
||||
pkg syscall (linux-arm), type SysProcIDMap struct
|
||||
pkg syscall (linux-arm), type SysProcIDMap struct, ContainerID int
|
||||
pkg syscall (linux-arm), type SysProcIDMap struct, HostID int
|
||||
pkg syscall (linux-arm), type SysProcIDMap struct, Size int
|
||||
pkg syscall (linux-arm-cgo), type SysProcAttr struct, GidMappings []SysProcIDMap
|
||||
pkg syscall (linux-arm-cgo), type SysProcAttr struct, UidMappings []SysProcIDMap
|
||||
pkg syscall (linux-arm-cgo), type SysProcIDMap struct
|
||||
pkg syscall (linux-arm-cgo), type SysProcIDMap struct, ContainerID int
|
||||
pkg syscall (linux-arm-cgo), type SysProcIDMap struct, HostID int
|
||||
pkg syscall (linux-arm-cgo), type SysProcIDMap struct, Size int
|
||||
|
||||
# CL 122200043 net: fix CNAME resolving on Windows, Egon Elbre <egonelbre@gmail.com>
|
||||
pkg syscall (windows-386), const DNS_INFO_NO_RECORDS = 9501
|
||||
pkg syscall (windows-386), const DNS_INFO_NO_RECORDS ideal-int
|
||||
pkg syscall (windows-386), const DnsSectionAdditional = 3
|
||||
pkg syscall (windows-386), const DnsSectionAdditional ideal-int
|
||||
pkg syscall (windows-386), const DnsSectionAnswer = 1
|
||||
pkg syscall (windows-386), const DnsSectionAnswer ideal-int
|
||||
pkg syscall (windows-386), const DnsSectionAuthority = 2
|
||||
pkg syscall (windows-386), const DnsSectionAuthority ideal-int
|
||||
pkg syscall (windows-386), const DnsSectionQuestion = 0
|
||||
pkg syscall (windows-386), const DnsSectionQuestion ideal-int
|
||||
pkg syscall (windows-386), func DnsNameCompare(*uint16, *uint16) bool
|
||||
pkg syscall (windows-amd64), const DNS_INFO_NO_RECORDS = 9501
|
||||
pkg syscall (windows-amd64), const DNS_INFO_NO_RECORDS ideal-int
|
||||
pkg syscall (windows-amd64), const DnsSectionAdditional = 3
|
||||
pkg syscall (windows-amd64), const DnsSectionAdditional ideal-int
|
||||
pkg syscall (windows-amd64), const DnsSectionAnswer = 1
|
||||
pkg syscall (windows-amd64), const DnsSectionAnswer ideal-int
|
||||
pkg syscall (windows-amd64), const DnsSectionAuthority = 2
|
||||
pkg syscall (windows-amd64), const DnsSectionAuthority ideal-int
|
||||
pkg syscall (windows-amd64), const DnsSectionQuestion = 0
|
||||
pkg syscall (windows-amd64), const DnsSectionQuestion ideal-int
|
||||
pkg syscall (windows-amd64), func DnsNameCompare(*uint16, *uint16) bool
|
||||
|
||||
# CL 86160044 os: Implement symlink support for Windows, Michael Fraenkel <michael.fraenkel@gmail.com>
|
||||
pkg syscall (windows-386), const ERROR_PRIVILEGE_NOT_HELD = 1314
|
||||
pkg syscall (windows-386), const ERROR_PRIVILEGE_NOT_HELD Errno
|
||||
pkg syscall (windows-amd64), const ERROR_PRIVILEGE_NOT_HELD = 1314
|
||||
pkg syscall (windows-amd64), const ERROR_PRIVILEGE_NOT_HELD Errno
|
||||
|
||||
# CL 86160044 os: Implement symlink support for Windows, Michael Fraenkel <michael.fraenkel@gmail.com>
|
||||
pkg syscall (windows-386), const FILE_ATTRIBUTE_REPARSE_POINT = 1024
|
||||
pkg syscall (windows-386), const FILE_ATTRIBUTE_REPARSE_POINT ideal-int
|
||||
pkg syscall (windows-386), const FILE_FLAG_OPEN_REPARSE_POINT = 2097152
|
||||
pkg syscall (windows-386), const FILE_FLAG_OPEN_REPARSE_POINT ideal-int
|
||||
pkg syscall (windows-386), const FSCTL_GET_REPARSE_POINT = 589992
|
||||
pkg syscall (windows-386), const FSCTL_GET_REPARSE_POINT ideal-int
|
||||
pkg syscall (windows-386), const IO_REPARSE_TAG_SYMLINK = 2684354572
|
||||
pkg syscall (windows-386), const IO_REPARSE_TAG_SYMLINK ideal-int
|
||||
pkg syscall (windows-386), const MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16384
|
||||
pkg syscall (windows-386), const MAXIMUM_REPARSE_DATA_BUFFER_SIZE ideal-int
|
||||
pkg syscall (windows-386), const SYMBOLIC_LINK_FLAG_DIRECTORY = 1
|
||||
pkg syscall (windows-386), const SYMBOLIC_LINK_FLAG_DIRECTORY ideal-int
|
||||
pkg syscall (windows-386), func CreateHardLink(*uint16, *uint16, uintptr) error
|
||||
pkg syscall (windows-386), func CreateSymbolicLink(*uint16, *uint16, uint32) error
|
||||
pkg syscall (windows-386), func DeviceIoControl(Handle, uint32, *uint8, uint32, *uint8, uint32, *uint32, *Overlapped) error
|
||||
pkg syscall (windows-386), func LoadCreateSymbolicLink() error
|
||||
pkg syscall (windows-amd64), const FILE_ATTRIBUTE_REPARSE_POINT = 1024
|
||||
pkg syscall (windows-amd64), const FILE_ATTRIBUTE_REPARSE_POINT ideal-int
|
||||
pkg syscall (windows-amd64), const FILE_FLAG_OPEN_REPARSE_POINT = 2097152
|
||||
pkg syscall (windows-amd64), const FILE_FLAG_OPEN_REPARSE_POINT ideal-int
|
||||
pkg syscall (windows-amd64), const FSCTL_GET_REPARSE_POINT = 589992
|
||||
pkg syscall (windows-amd64), const FSCTL_GET_REPARSE_POINT ideal-int
|
||||
pkg syscall (windows-amd64), const IO_REPARSE_TAG_SYMLINK = 2684354572
|
||||
pkg syscall (windows-amd64), const IO_REPARSE_TAG_SYMLINK ideal-int
|
||||
pkg syscall (windows-amd64), const MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16384
|
||||
pkg syscall (windows-amd64), const MAXIMUM_REPARSE_DATA_BUFFER_SIZE ideal-int
|
||||
pkg syscall (windows-amd64), const SYMBOLIC_LINK_FLAG_DIRECTORY = 1
|
||||
pkg syscall (windows-amd64), const SYMBOLIC_LINK_FLAG_DIRECTORY ideal-int
|
||||
pkg syscall (windows-amd64), func CreateHardLink(*uint16, *uint16, uintptr) error
|
||||
pkg syscall (windows-amd64), func CreateSymbolicLink(*uint16, *uint16, uint32) error
|
||||
pkg syscall (windows-amd64), func DeviceIoControl(Handle, uint32, *uint8, uint32, *uint8, uint32, *uint32, *Overlapped) error
|
||||
pkg syscall (windows-amd64), func LoadCreateSymbolicLink() error
|
||||
|
||||
# CL 149510043 net: disable SIO_UDP_CONNRESET behavior on windows., Ron Hashimoto <mail@h2so5.net>
|
||||
pkg syscall (windows-386), const SIO_UDP_CONNRESET = 2550136844
|
||||
pkg syscall (windows-386), const SIO_UDP_CONNRESET ideal-int
|
||||
pkg syscall (windows-amd64), const SIO_UDP_CONNRESET = 2550136844
|
||||
pkg syscall (windows-amd64), const SIO_UDP_CONNRESET ideal-int
|
||||
|
||||
# CL 102320044 syscall: implement syscall.Getppid() on Windows, Alan Shreve <alan@inconshreveable.com>
|
||||
pkg syscall (windows-386), const TH32CS_INHERIT = 2147483648
|
||||
pkg syscall (windows-386), const TH32CS_INHERIT ideal-int
|
||||
pkg syscall (windows-386), const TH32CS_SNAPALL = 15
|
||||
pkg syscall (windows-386), const TH32CS_SNAPALL ideal-int
|
||||
pkg syscall (windows-386), const TH32CS_SNAPHEAPLIST = 1
|
||||
pkg syscall (windows-386), const TH32CS_SNAPHEAPLIST ideal-int
|
||||
pkg syscall (windows-386), const TH32CS_SNAPMODULE = 8
|
||||
pkg syscall (windows-386), const TH32CS_SNAPMODULE ideal-int
|
||||
pkg syscall (windows-386), const TH32CS_SNAPMODULE32 = 16
|
||||
pkg syscall (windows-386), const TH32CS_SNAPMODULE32 ideal-int
|
||||
pkg syscall (windows-386), const TH32CS_SNAPPROCESS = 2
|
||||
pkg syscall (windows-386), const TH32CS_SNAPPROCESS ideal-int
|
||||
pkg syscall (windows-386), const TH32CS_SNAPTHREAD = 4
|
||||
pkg syscall (windows-386), const TH32CS_SNAPTHREAD ideal-int
|
||||
pkg syscall (windows-386), func CreateToolhelp32Snapshot(uint32, uint32) (Handle, error)
|
||||
pkg syscall (windows-386), func Process32First(Handle, *ProcessEntry32) error
|
||||
pkg syscall (windows-386), func Process32Next(Handle, *ProcessEntry32) error
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, DefaultHeapID uintptr
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, ExeFile [260]uint16
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, Flags uint32
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, ModuleID uint32
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, ParentProcessID uint32
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, PriClassBase int32
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, ProcessID uint32
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, Size uint32
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, Threads uint32
|
||||
pkg syscall (windows-386), type ProcessEntry32 struct, Usage uint32
|
||||
pkg syscall (windows-amd64), const TH32CS_INHERIT = 2147483648
|
||||
pkg syscall (windows-amd64), const TH32CS_INHERIT ideal-int
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPALL = 15
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPALL ideal-int
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPHEAPLIST = 1
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPHEAPLIST ideal-int
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPMODULE = 8
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPMODULE ideal-int
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPMODULE32 = 16
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPMODULE32 ideal-int
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPPROCESS = 2
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPPROCESS ideal-int
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPTHREAD = 4
|
||||
pkg syscall (windows-amd64), const TH32CS_SNAPTHREAD ideal-int
|
||||
pkg syscall (windows-amd64), func CreateToolhelp32Snapshot(uint32, uint32) (Handle, error)
|
||||
pkg syscall (windows-amd64), func Process32First(Handle, *ProcessEntry32) error
|
||||
pkg syscall (windows-amd64), func Process32Next(Handle, *ProcessEntry32) error
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, DefaultHeapID uintptr
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, ExeFile [260]uint16
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, Flags uint32
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, ModuleID uint32
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, ParentProcessID uint32
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, PriClassBase int32
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, ProcessID uint32
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, Size uint32
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, Threads uint32
|
||||
pkg syscall (windows-amd64), type ProcessEntry32 struct, Usage uint32
|
||||
|
||||
# CL 127740043 os: make SameFile handle paths like c:a.txt properly, Alex Brainman <alex.brainman@gmail.com>
|
||||
pkg syscall (windows-386), func FullPath(string) (string, error)
|
||||
pkg syscall (windows-amd64), func FullPath(string) (string, error)
|
||||
|
||||
# CL 98150043 testing: add Coverage function, Russ Cox <rsc@golang.org>
|
||||
pkg testing, func Coverage() float64
|
||||
|
||||
# CL 148770043 cmd/go, testing: add TestMain support, Russ Cox <rsc@golang.org>
|
||||
pkg testing, func MainStart(func(string, string) (bool, error), []InternalTest, []InternalBenchmark, []InternalExample) *M
|
||||
pkg testing, method (*M) Run() int
|
||||
pkg testing, type M struct
|
||||
|
||||
# CL 108030044 text/scanner: provide facility for custom identifiers, Robert Griesemer <gri@golang.org>
|
||||
pkg text/scanner, type Scanner struct, IsIdentRune func(int32, int) bool
|
||||
|
||||
# CL 130620043 text/template: add back pointer to Nodes for better error generation, Rob Pike <r@golang.org>
|
||||
pkg text/template/parse, type DotNode struct, embedded NodeType
|
||||
pkg text/template/parse, type NilNode struct, embedded NodeType
|
||||
pkg text/template/parse, method (*BranchNode) Copy() Node
|
||||
pkg text/template/parse, method (*IdentifierNode) SetTree(*Tree) *IdentifierNode
|
||||
pkg html/template, type Error struct, Node parse.Node
|
||||
|
||||
# CL 127470043 unicode: strconv: regexp: Upgrade to Unicode 7.0.0., Marcel van Lohuizen <mpvl@golang.org>
|
||||
pkg unicode, const Version = "7.0.0"
|
||||
pkg unicode, var Bassa_Vah *RangeTable
|
||||
pkg unicode, var Caucasian_Albanian *RangeTable
|
||||
pkg unicode, var Duployan *RangeTable
|
||||
pkg unicode, var Elbasan *RangeTable
|
||||
pkg unicode, var Grantha *RangeTable
|
||||
pkg unicode, var Khojki *RangeTable
|
||||
pkg unicode, var Khudawadi *RangeTable
|
||||
pkg unicode, var Linear_A *RangeTable
|
||||
pkg unicode, var Mahajani *RangeTable
|
||||
pkg unicode, var Manichaean *RangeTable
|
||||
pkg unicode, var Mende_Kikakui *RangeTable
|
||||
pkg unicode, var Modi *RangeTable
|
||||
pkg unicode, var Mro *RangeTable
|
||||
pkg unicode, var Nabataean *RangeTable
|
||||
pkg unicode, var Old_North_Arabian *RangeTable
|
||||
pkg unicode, var Old_Permic *RangeTable
|
||||
pkg unicode, var Pahawh_Hmong *RangeTable
|
||||
pkg unicode, var Palmyrene *RangeTable
|
||||
pkg unicode, var Pau_Cin_Hau *RangeTable
|
||||
pkg unicode, var Psalter_Pahlavi *RangeTable
|
||||
pkg unicode, var Siddham *RangeTable
|
||||
pkg unicode, var Tirhuta *RangeTable
|
||||
pkg unicode, var Warang_Citi *RangeTable
|
||||
975
api/go1.5.txt
@@ -1,975 +0,0 @@
|
||||
pkg archive/zip, method (*Writer) SetOffset(int64)
|
||||
pkg bufio, method (*Reader) Discard(int) (int, error)
|
||||
pkg bufio, method (ReadWriter) Discard(int) (int, error)
|
||||
pkg bytes, func LastIndexByte([]uint8, uint8) int
|
||||
pkg bytes, method (*Buffer) Cap() int
|
||||
pkg bytes, method (*Reader) Size() int64
|
||||
pkg crypto, const SHA512_224 = 14
|
||||
pkg crypto, const SHA512_224 Hash
|
||||
pkg crypto, const SHA512_256 = 15
|
||||
pkg crypto, const SHA512_256 Hash
|
||||
pkg crypto, type Decrypter interface { Decrypt, Public }
|
||||
pkg crypto, type Decrypter interface, Decrypt(io.Reader, []uint8, DecrypterOpts) ([]uint8, error)
|
||||
pkg crypto, type Decrypter interface, Public() PublicKey
|
||||
pkg crypto, type DecrypterOpts interface {}
|
||||
pkg crypto/cipher, func NewGCMWithNonceSize(Block, int) (AEAD, error)
|
||||
pkg crypto/elliptic, type CurveParams struct, Name string
|
||||
pkg crypto/rsa, method (*PrivateKey) Decrypt(io.Reader, []uint8, crypto.DecrypterOpts) ([]uint8, error)
|
||||
pkg crypto/rsa, type OAEPOptions struct
|
||||
pkg crypto/rsa, type OAEPOptions struct, Hash crypto.Hash
|
||||
pkg crypto/rsa, type OAEPOptions struct, Label []uint8
|
||||
pkg crypto/rsa, type PKCS1v15DecryptOptions struct
|
||||
pkg crypto/rsa, type PKCS1v15DecryptOptions struct, SessionKeyLen int
|
||||
pkg crypto/sha512, const Size224 = 28
|
||||
pkg crypto/sha512, const Size224 ideal-int
|
||||
pkg crypto/sha512, const Size256 = 32
|
||||
pkg crypto/sha512, const Size256 ideal-int
|
||||
pkg crypto/sha512, func New512_224() hash.Hash
|
||||
pkg crypto/sha512, func New512_256() hash.Hash
|
||||
pkg crypto/sha512, func Sum512_224([]uint8) [28]uint8
|
||||
pkg crypto/sha512, func Sum512_256([]uint8) [32]uint8
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 49196
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 uint16
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 49200
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 uint16
|
||||
pkg crypto/tls, method (*Config) SetSessionTicketKeys([][32]uint8)
|
||||
pkg crypto/tls, type Certificate struct, SignedCertificateTimestamps [][]uint8
|
||||
pkg crypto/tls, type ConnectionState struct, OCSPResponse []uint8
|
||||
pkg crypto/tls, type ConnectionState struct, SignedCertificateTimestamps [][]uint8
|
||||
pkg crypto/x509, method (*CertificateRequest) CheckSignature() error
|
||||
pkg crypto/x509, type Certificate struct, UnhandledCriticalExtensions []asn1.ObjectIdentifier
|
||||
pkg crypto/x509/pkix, type Name struct, ExtraNames []AttributeTypeAndValue
|
||||
pkg database/sql, method (*DB) Stats() DBStats
|
||||
pkg database/sql, type DBStats struct
|
||||
pkg database/sql, type DBStats struct, OpenConnections int
|
||||
pkg debug/dwarf, const ClassAddress = 1
|
||||
pkg debug/dwarf, const ClassAddress Class
|
||||
pkg debug/dwarf, const ClassBlock = 2
|
||||
pkg debug/dwarf, const ClassBlock Class
|
||||
pkg debug/dwarf, const ClassConstant = 3
|
||||
pkg debug/dwarf, const ClassConstant Class
|
||||
pkg debug/dwarf, const ClassExprLoc = 4
|
||||
pkg debug/dwarf, const ClassExprLoc Class
|
||||
pkg debug/dwarf, const ClassFlag = 5
|
||||
pkg debug/dwarf, const ClassFlag Class
|
||||
pkg debug/dwarf, const ClassLinePtr = 6
|
||||
pkg debug/dwarf, const ClassLinePtr Class
|
||||
pkg debug/dwarf, const ClassLocListPtr = 7
|
||||
pkg debug/dwarf, const ClassLocListPtr Class
|
||||
pkg debug/dwarf, const ClassMacPtr = 8
|
||||
pkg debug/dwarf, const ClassMacPtr Class
|
||||
pkg debug/dwarf, const ClassRangeListPtr = 9
|
||||
pkg debug/dwarf, const ClassRangeListPtr Class
|
||||
pkg debug/dwarf, const ClassReference = 10
|
||||
pkg debug/dwarf, const ClassReference Class
|
||||
pkg debug/dwarf, const ClassReferenceAlt = 13
|
||||
pkg debug/dwarf, const ClassReferenceAlt Class
|
||||
pkg debug/dwarf, const ClassReferenceSig = 11
|
||||
pkg debug/dwarf, const ClassReferenceSig Class
|
||||
pkg debug/dwarf, const ClassString = 12
|
||||
pkg debug/dwarf, const ClassString Class
|
||||
pkg debug/dwarf, const ClassStringAlt = 14
|
||||
pkg debug/dwarf, const ClassStringAlt Class
|
||||
pkg debug/dwarf, method (*Data) LineReader(*Entry) (*LineReader, error)
|
||||
pkg debug/dwarf, method (*Entry) AttrField(Attr) *Field
|
||||
pkg debug/dwarf, method (*LineReader) Next(*LineEntry) error
|
||||
pkg debug/dwarf, method (*LineReader) Reset()
|
||||
pkg debug/dwarf, method (*LineReader) Seek(LineReaderPos)
|
||||
pkg debug/dwarf, method (*LineReader) SeekPC(uint64, *LineEntry) error
|
||||
pkg debug/dwarf, method (*LineReader) Tell() LineReaderPos
|
||||
pkg debug/dwarf, method (*Reader) AddressSize() int
|
||||
pkg debug/dwarf, method (Class) GoString() string
|
||||
pkg debug/dwarf, method (Class) String() string
|
||||
pkg debug/dwarf, type Class int
|
||||
pkg debug/dwarf, type Field struct, Class Class
|
||||
pkg debug/dwarf, type LineEntry struct
|
||||
pkg debug/dwarf, type LineEntry struct, Address uint64
|
||||
pkg debug/dwarf, type LineEntry struct, BasicBlock bool
|
||||
pkg debug/dwarf, type LineEntry struct, Column int
|
||||
pkg debug/dwarf, type LineEntry struct, Discriminator int
|
||||
pkg debug/dwarf, type LineEntry struct, EndSequence bool
|
||||
pkg debug/dwarf, type LineEntry struct, EpilogueBegin bool
|
||||
pkg debug/dwarf, type LineEntry struct, File *LineFile
|
||||
pkg debug/dwarf, type LineEntry struct, ISA int
|
||||
pkg debug/dwarf, type LineEntry struct, IsStmt bool
|
||||
pkg debug/dwarf, type LineEntry struct, Line int
|
||||
pkg debug/dwarf, type LineEntry struct, OpIndex int
|
||||
pkg debug/dwarf, type LineEntry struct, PrologueEnd bool
|
||||
pkg debug/dwarf, type LineFile struct
|
||||
pkg debug/dwarf, type LineFile struct, Length int
|
||||
pkg debug/dwarf, type LineFile struct, Mtime uint64
|
||||
pkg debug/dwarf, type LineFile struct, Name string
|
||||
pkg debug/dwarf, type LineReader struct
|
||||
pkg debug/dwarf, type LineReaderPos struct
|
||||
pkg debug/dwarf, var ErrUnknownPC error
|
||||
pkg debug/elf, const R_PPC64_ADDR14 = 7
|
||||
pkg debug/elf, const R_PPC64_ADDR14 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR14_BRNTAKEN = 9
|
||||
pkg debug/elf, const R_PPC64_ADDR14_BRNTAKEN R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR14_BRTAKEN = 8
|
||||
pkg debug/elf, const R_PPC64_ADDR14_BRTAKEN R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16 = 3
|
||||
pkg debug/elf, const R_PPC64_ADDR16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_DS = 56
|
||||
pkg debug/elf, const R_PPC64_ADDR16_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HA = 6
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HI = 5
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHER = 39
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHER R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHERA = 40
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHERA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHEST = 41
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHEST R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHESTA = 42
|
||||
pkg debug/elf, const R_PPC64_ADDR16_HIGHESTA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_LO = 4
|
||||
pkg debug/elf, const R_PPC64_ADDR16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR16_LO_DS = 57
|
||||
pkg debug/elf, const R_PPC64_ADDR16_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR24 = 2
|
||||
pkg debug/elf, const R_PPC64_ADDR24 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR32 = 1
|
||||
pkg debug/elf, const R_PPC64_ADDR32 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_ADDR64 = 38
|
||||
pkg debug/elf, const R_PPC64_ADDR64 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPMOD64 = 68
|
||||
pkg debug/elf, const R_PPC64_DTPMOD64 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16 = 74
|
||||
pkg debug/elf, const R_PPC64_DTPREL16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_DS = 101
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HA = 77
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HI = 76
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHER = 103
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHER R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHERA = 104
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHERA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHEST = 105
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHEST R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHESTA = 106
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_HIGHESTA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_LO = 75
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_LO_DS = 102
|
||||
pkg debug/elf, const R_PPC64_DTPREL16_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_DTPREL64 = 78
|
||||
pkg debug/elf, const R_PPC64_DTPREL64 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT16 = 14
|
||||
pkg debug/elf, const R_PPC64_GOT16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT16_DS = 58
|
||||
pkg debug/elf, const R_PPC64_GOT16_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT16_HA = 17
|
||||
pkg debug/elf, const R_PPC64_GOT16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT16_HI = 16
|
||||
pkg debug/elf, const R_PPC64_GOT16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT16_LO = 15
|
||||
pkg debug/elf, const R_PPC64_GOT16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT16_LO_DS = 59
|
||||
pkg debug/elf, const R_PPC64_GOT16_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_DTPREL16_DS = 91
|
||||
pkg debug/elf, const R_PPC64_GOT_DTPREL16_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_DTPREL16_HA = 94
|
||||
pkg debug/elf, const R_PPC64_GOT_DTPREL16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_DTPREL16_HI = 93
|
||||
pkg debug/elf, const R_PPC64_GOT_DTPREL16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_DTPREL16_LO_DS = 92
|
||||
pkg debug/elf, const R_PPC64_GOT_DTPREL16_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSGD16 = 79
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSGD16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSGD16_HA = 82
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSGD16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSGD16_HI = 81
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSGD16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSGD16_LO = 80
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSGD16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSLD16 = 83
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSLD16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSLD16_HA = 86
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSLD16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSLD16_HI = 85
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSLD16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSLD16_LO = 84
|
||||
pkg debug/elf, const R_PPC64_GOT_TLSLD16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TPREL16_DS = 87
|
||||
pkg debug/elf, const R_PPC64_GOT_TPREL16_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TPREL16_HA = 90
|
||||
pkg debug/elf, const R_PPC64_GOT_TPREL16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TPREL16_HI = 89
|
||||
pkg debug/elf, const R_PPC64_GOT_TPREL16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_GOT_TPREL16_LO_DS = 88
|
||||
pkg debug/elf, const R_PPC64_GOT_TPREL16_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_JMP_SLOT = 21
|
||||
pkg debug/elf, const R_PPC64_JMP_SLOT R_PPC64
|
||||
pkg debug/elf, const R_PPC64_NONE = 0
|
||||
pkg debug/elf, const R_PPC64_NONE R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL14 = 11
|
||||
pkg debug/elf, const R_PPC64_REL14 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL14_BRNTAKEN = 13
|
||||
pkg debug/elf, const R_PPC64_REL14_BRNTAKEN R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL14_BRTAKEN = 12
|
||||
pkg debug/elf, const R_PPC64_REL14_BRTAKEN R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL16 = 249
|
||||
pkg debug/elf, const R_PPC64_REL16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL16_HA = 252
|
||||
pkg debug/elf, const R_PPC64_REL16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL16_HI = 251
|
||||
pkg debug/elf, const R_PPC64_REL16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL16_LO = 250
|
||||
pkg debug/elf, const R_PPC64_REL16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL24 = 10
|
||||
pkg debug/elf, const R_PPC64_REL24 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL32 = 26
|
||||
pkg debug/elf, const R_PPC64_REL32 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_REL64 = 44
|
||||
pkg debug/elf, const R_PPC64_REL64 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TLS = 67
|
||||
pkg debug/elf, const R_PPC64_TLS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TLSGD = 107
|
||||
pkg debug/elf, const R_PPC64_TLSGD R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TLSLD = 108
|
||||
pkg debug/elf, const R_PPC64_TLSLD R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TOC = 51
|
||||
pkg debug/elf, const R_PPC64_TOC R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TOC16 = 47
|
||||
pkg debug/elf, const R_PPC64_TOC16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TOC16_DS = 63
|
||||
pkg debug/elf, const R_PPC64_TOC16_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TOC16_HA = 50
|
||||
pkg debug/elf, const R_PPC64_TOC16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TOC16_HI = 49
|
||||
pkg debug/elf, const R_PPC64_TOC16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TOC16_LO = 48
|
||||
pkg debug/elf, const R_PPC64_TOC16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TOC16_LO_DS = 64
|
||||
pkg debug/elf, const R_PPC64_TOC16_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16 = 69
|
||||
pkg debug/elf, const R_PPC64_TPREL16 R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_DS = 95
|
||||
pkg debug/elf, const R_PPC64_TPREL16_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HA = 72
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HI = 71
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HI R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHER = 97
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHER R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHERA = 98
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHERA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHEST = 99
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHEST R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHESTA = 100
|
||||
pkg debug/elf, const R_PPC64_TPREL16_HIGHESTA R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_LO = 70
|
||||
pkg debug/elf, const R_PPC64_TPREL16_LO R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL16_LO_DS = 96
|
||||
pkg debug/elf, const R_PPC64_TPREL16_LO_DS R_PPC64
|
||||
pkg debug/elf, const R_PPC64_TPREL64 = 73
|
||||
pkg debug/elf, const R_PPC64_TPREL64 R_PPC64
|
||||
pkg debug/elf, method (R_PPC64) GoString() string
|
||||
pkg debug/elf, method (R_PPC64) String() string
|
||||
pkg debug/elf, type R_PPC64 int
|
||||
pkg encoding/base64, const NoPadding = -1
|
||||
pkg encoding/base64, const NoPadding int32
|
||||
pkg encoding/base64, const StdPadding = 61
|
||||
pkg encoding/base64, const StdPadding int32
|
||||
pkg encoding/base64, method (Encoding) WithPadding(int32) *Encoding
|
||||
pkg encoding/base64, var RawStdEncoding *Encoding
|
||||
pkg encoding/base64, var RawURLEncoding *Encoding
|
||||
pkg encoding/json, method (*Decoder) More() bool
|
||||
pkg encoding/json, method (*Decoder) Token() (Token, error)
|
||||
pkg encoding/json, method (Delim) String() string
|
||||
pkg encoding/json, type Delim int32
|
||||
pkg encoding/json, type Token interface {}
|
||||
pkg encoding/json, type UnmarshalTypeError struct, Offset int64
|
||||
pkg flag, func UnquoteUsage(*Flag) (string, string)
|
||||
pkg go/ast, type EmptyStmt struct, Implicit bool
|
||||
pkg go/build, type Package struct, PkgTargetRoot string
|
||||
pkg go/constant, const Bool = 1
|
||||
pkg go/constant, const Bool Kind
|
||||
pkg go/constant, const Complex = 5
|
||||
pkg go/constant, const Complex Kind
|
||||
pkg go/constant, const Float = 4
|
||||
pkg go/constant, const Float Kind
|
||||
pkg go/constant, const Int = 3
|
||||
pkg go/constant, const Int Kind
|
||||
pkg go/constant, const String = 2
|
||||
pkg go/constant, const String Kind
|
||||
pkg go/constant, const Unknown = 0
|
||||
pkg go/constant, const Unknown Kind
|
||||
pkg go/constant, func BinaryOp(Value, token.Token, Value) Value
|
||||
pkg go/constant, func BitLen(Value) int
|
||||
pkg go/constant, func BoolVal(Value) bool
|
||||
pkg go/constant, func Bytes(Value) []uint8
|
||||
pkg go/constant, func Compare(Value, token.Token, Value) bool
|
||||
pkg go/constant, func Denom(Value) Value
|
||||
pkg go/constant, func Float32Val(Value) (float32, bool)
|
||||
pkg go/constant, func Float64Val(Value) (float64, bool)
|
||||
pkg go/constant, func Imag(Value) Value
|
||||
pkg go/constant, func Int64Val(Value) (int64, bool)
|
||||
pkg go/constant, func MakeBool(bool) Value
|
||||
pkg go/constant, func MakeFloat64(float64) Value
|
||||
pkg go/constant, func MakeFromBytes([]uint8) Value
|
||||
pkg go/constant, func MakeFromLiteral(string, token.Token, uint) Value
|
||||
pkg go/constant, func MakeImag(Value) Value
|
||||
pkg go/constant, func MakeInt64(int64) Value
|
||||
pkg go/constant, func MakeString(string) Value
|
||||
pkg go/constant, func MakeUint64(uint64) Value
|
||||
pkg go/constant, func MakeUnknown() Value
|
||||
pkg go/constant, func Num(Value) Value
|
||||
pkg go/constant, func Real(Value) Value
|
||||
pkg go/constant, func Shift(Value, token.Token, uint) Value
|
||||
pkg go/constant, func Sign(Value) int
|
||||
pkg go/constant, func StringVal(Value) string
|
||||
pkg go/constant, func Uint64Val(Value) (uint64, bool)
|
||||
pkg go/constant, func UnaryOp(token.Token, Value, uint) Value
|
||||
pkg go/constant, type Kind int
|
||||
pkg go/constant, type Value interface, Kind() Kind
|
||||
pkg go/constant, type Value interface, String() string
|
||||
pkg go/constant, type Value interface, unexported methods
|
||||
pkg go/importer, func Default() types.Importer
|
||||
pkg go/importer, func For(string, Lookup) types.Importer
|
||||
pkg go/importer, type Lookup func(string) (io.ReadCloser, error)
|
||||
pkg go/parser, func ParseExprFrom(*token.FileSet, string, interface{}, Mode) (ast.Expr, error)
|
||||
pkg go/types, const Bool = 1
|
||||
pkg go/types, const Bool BasicKind
|
||||
pkg go/types, const Byte = 8
|
||||
pkg go/types, const Byte BasicKind
|
||||
pkg go/types, const Complex128 = 16
|
||||
pkg go/types, const Complex128 BasicKind
|
||||
pkg go/types, const Complex64 = 15
|
||||
pkg go/types, const Complex64 BasicKind
|
||||
pkg go/types, const FieldVal = 0
|
||||
pkg go/types, const FieldVal SelectionKind
|
||||
pkg go/types, const Float32 = 13
|
||||
pkg go/types, const Float32 BasicKind
|
||||
pkg go/types, const Float64 = 14
|
||||
pkg go/types, const Float64 BasicKind
|
||||
pkg go/types, const Int = 2
|
||||
pkg go/types, const Int BasicKind
|
||||
pkg go/types, const Int16 = 4
|
||||
pkg go/types, const Int16 BasicKind
|
||||
pkg go/types, const Int32 = 5
|
||||
pkg go/types, const Int32 BasicKind
|
||||
pkg go/types, const Int64 = 6
|
||||
pkg go/types, const Int64 BasicKind
|
||||
pkg go/types, const Int8 = 3
|
||||
pkg go/types, const Int8 BasicKind
|
||||
pkg go/types, const Invalid = 0
|
||||
pkg go/types, const Invalid BasicKind
|
||||
pkg go/types, const IsBoolean = 1
|
||||
pkg go/types, const IsBoolean BasicInfo
|
||||
pkg go/types, const IsComplex = 16
|
||||
pkg go/types, const IsComplex BasicInfo
|
||||
pkg go/types, const IsConstType = 59
|
||||
pkg go/types, const IsConstType BasicInfo
|
||||
pkg go/types, const IsFloat = 8
|
||||
pkg go/types, const IsFloat BasicInfo
|
||||
pkg go/types, const IsInteger = 2
|
||||
pkg go/types, const IsInteger BasicInfo
|
||||
pkg go/types, const IsNumeric = 26
|
||||
pkg go/types, const IsNumeric BasicInfo
|
||||
pkg go/types, const IsOrdered = 42
|
||||
pkg go/types, const IsOrdered BasicInfo
|
||||
pkg go/types, const IsString = 32
|
||||
pkg go/types, const IsString BasicInfo
|
||||
pkg go/types, const IsUnsigned = 4
|
||||
pkg go/types, const IsUnsigned BasicInfo
|
||||
pkg go/types, const IsUntyped = 64
|
||||
pkg go/types, const IsUntyped BasicInfo
|
||||
pkg go/types, const MethodExpr = 2
|
||||
pkg go/types, const MethodExpr SelectionKind
|
||||
pkg go/types, const MethodVal = 1
|
||||
pkg go/types, const MethodVal SelectionKind
|
||||
pkg go/types, const RecvOnly = 2
|
||||
pkg go/types, const RecvOnly ChanDir
|
||||
pkg go/types, const Rune = 5
|
||||
pkg go/types, const Rune BasicKind
|
||||
pkg go/types, const SendOnly = 1
|
||||
pkg go/types, const SendOnly ChanDir
|
||||
pkg go/types, const SendRecv = 0
|
||||
pkg go/types, const SendRecv ChanDir
|
||||
pkg go/types, const String = 17
|
||||
pkg go/types, const String BasicKind
|
||||
pkg go/types, const Uint = 7
|
||||
pkg go/types, const Uint BasicKind
|
||||
pkg go/types, const Uint16 = 9
|
||||
pkg go/types, const Uint16 BasicKind
|
||||
pkg go/types, const Uint32 = 10
|
||||
pkg go/types, const Uint32 BasicKind
|
||||
pkg go/types, const Uint64 = 11
|
||||
pkg go/types, const Uint64 BasicKind
|
||||
pkg go/types, const Uint8 = 8
|
||||
pkg go/types, const Uint8 BasicKind
|
||||
pkg go/types, const Uintptr = 12
|
||||
pkg go/types, const Uintptr BasicKind
|
||||
pkg go/types, const UnsafePointer = 18
|
||||
pkg go/types, const UnsafePointer BasicKind
|
||||
pkg go/types, const UntypedBool = 19
|
||||
pkg go/types, const UntypedBool BasicKind
|
||||
pkg go/types, const UntypedComplex = 23
|
||||
pkg go/types, const UntypedComplex BasicKind
|
||||
pkg go/types, const UntypedFloat = 22
|
||||
pkg go/types, const UntypedFloat BasicKind
|
||||
pkg go/types, const UntypedInt = 20
|
||||
pkg go/types, const UntypedInt BasicKind
|
||||
pkg go/types, const UntypedNil = 25
|
||||
pkg go/types, const UntypedNil BasicKind
|
||||
pkg go/types, const UntypedRune = 21
|
||||
pkg go/types, const UntypedRune BasicKind
|
||||
pkg go/types, const UntypedString = 24
|
||||
pkg go/types, const UntypedString BasicKind
|
||||
pkg go/types, func AssertableTo(*Interface, Type) bool
|
||||
pkg go/types, func AssignableTo(Type, Type) bool
|
||||
pkg go/types, func Comparable(Type) bool
|
||||
pkg go/types, func ConvertibleTo(Type, Type) bool
|
||||
pkg go/types, func DefPredeclaredTestFuncs()
|
||||
pkg go/types, func Eval(*token.FileSet, *Package, token.Pos, string) (TypeAndValue, error)
|
||||
pkg go/types, func ExprString(ast.Expr) string
|
||||
pkg go/types, func Id(*Package, string) string
|
||||
pkg go/types, func Identical(Type, Type) bool
|
||||
pkg go/types, func Implements(Type, *Interface) bool
|
||||
pkg go/types, func IsInterface(Type) bool
|
||||
pkg go/types, func LookupFieldOrMethod(Type, bool, *Package, string) (Object, []int, bool)
|
||||
pkg go/types, func MissingMethod(Type, *Interface, bool) (*Func, bool)
|
||||
pkg go/types, func NewArray(Type, int64) *Array
|
||||
pkg go/types, func NewChan(ChanDir, Type) *Chan
|
||||
pkg go/types, func NewChecker(*Config, *token.FileSet, *Package, *Info) *Checker
|
||||
pkg go/types, func NewConst(token.Pos, *Package, string, Type, constant.Value) *Const
|
||||
pkg go/types, func NewField(token.Pos, *Package, string, Type, bool) *Var
|
||||
pkg go/types, func NewFunc(token.Pos, *Package, string, *Signature) *Func
|
||||
pkg go/types, func NewInterface([]*Func, []*Named) *Interface
|
||||
pkg go/types, func NewLabel(token.Pos, *Package, string) *Label
|
||||
pkg go/types, func NewMap(Type, Type) *Map
|
||||
pkg go/types, func NewMethodSet(Type) *MethodSet
|
||||
pkg go/types, func NewNamed(*TypeName, Type, []*Func) *Named
|
||||
pkg go/types, func NewPackage(string, string) *Package
|
||||
pkg go/types, func NewParam(token.Pos, *Package, string, Type) *Var
|
||||
pkg go/types, func NewPkgName(token.Pos, *Package, string, *Package) *PkgName
|
||||
pkg go/types, func NewPointer(Type) *Pointer
|
||||
pkg go/types, func NewScope(*Scope, token.Pos, token.Pos, string) *Scope
|
||||
pkg go/types, func NewSignature(*Var, *Tuple, *Tuple, bool) *Signature
|
||||
pkg go/types, func NewSlice(Type) *Slice
|
||||
pkg go/types, func NewStruct([]*Var, []string) *Struct
|
||||
pkg go/types, func NewTuple(...*Var) *Tuple
|
||||
pkg go/types, func NewTypeName(token.Pos, *Package, string, Type) *TypeName
|
||||
pkg go/types, func NewVar(token.Pos, *Package, string, Type) *Var
|
||||
pkg go/types, func ObjectString(Object, Qualifier) string
|
||||
pkg go/types, func RelativeTo(*Package) Qualifier
|
||||
pkg go/types, func SelectionString(*Selection, Qualifier) string
|
||||
pkg go/types, func TypeString(Type, Qualifier) string
|
||||
pkg go/types, func WriteExpr(*bytes.Buffer, ast.Expr)
|
||||
pkg go/types, func WriteSignature(*bytes.Buffer, *Signature, Qualifier)
|
||||
pkg go/types, func WriteType(*bytes.Buffer, Type, Qualifier)
|
||||
pkg go/types, method (*Array) Elem() Type
|
||||
pkg go/types, method (*Array) Len() int64
|
||||
pkg go/types, method (*Array) String() string
|
||||
pkg go/types, method (*Array) Underlying() Type
|
||||
pkg go/types, method (*Basic) Info() BasicInfo
|
||||
pkg go/types, method (*Basic) Kind() BasicKind
|
||||
pkg go/types, method (*Basic) Name() string
|
||||
pkg go/types, method (*Basic) String() string
|
||||
pkg go/types, method (*Basic) Underlying() Type
|
||||
pkg go/types, method (*Builtin) Exported() bool
|
||||
pkg go/types, method (*Builtin) Id() string
|
||||
pkg go/types, method (*Builtin) Name() string
|
||||
pkg go/types, method (*Builtin) Parent() *Scope
|
||||
pkg go/types, method (*Builtin) Pkg() *Package
|
||||
pkg go/types, method (*Builtin) Pos() token.Pos
|
||||
pkg go/types, method (*Builtin) String() string
|
||||
pkg go/types, method (*Builtin) Type() Type
|
||||
pkg go/types, method (*Chan) Dir() ChanDir
|
||||
pkg go/types, method (*Chan) Elem() Type
|
||||
pkg go/types, method (*Chan) String() string
|
||||
pkg go/types, method (*Chan) Underlying() Type
|
||||
pkg go/types, method (*Checker) Files([]*ast.File) error
|
||||
pkg go/types, method (*Config) Check(string, *token.FileSet, []*ast.File, *Info) (*Package, error)
|
||||
pkg go/types, method (*Const) Exported() bool
|
||||
pkg go/types, method (*Const) Id() string
|
||||
pkg go/types, method (*Const) Name() string
|
||||
pkg go/types, method (*Const) Parent() *Scope
|
||||
pkg go/types, method (*Const) Pkg() *Package
|
||||
pkg go/types, method (*Const) Pos() token.Pos
|
||||
pkg go/types, method (*Const) String() string
|
||||
pkg go/types, method (*Const) Type() Type
|
||||
pkg go/types, method (*Const) Val() constant.Value
|
||||
pkg go/types, method (*Func) Exported() bool
|
||||
pkg go/types, method (*Func) FullName() string
|
||||
pkg go/types, method (*Func) Id() string
|
||||
pkg go/types, method (*Func) Name() string
|
||||
pkg go/types, method (*Func) Parent() *Scope
|
||||
pkg go/types, method (*Func) Pkg() *Package
|
||||
pkg go/types, method (*Func) Pos() token.Pos
|
||||
pkg go/types, method (*Func) Scope() *Scope
|
||||
pkg go/types, method (*Func) String() string
|
||||
pkg go/types, method (*Func) Type() Type
|
||||
pkg go/types, method (*Info) ObjectOf(*ast.Ident) Object
|
||||
pkg go/types, method (*Info) TypeOf(ast.Expr) Type
|
||||
pkg go/types, method (*Initializer) String() string
|
||||
pkg go/types, method (*Interface) Complete() *Interface
|
||||
pkg go/types, method (*Interface) Embedded(int) *Named
|
||||
pkg go/types, method (*Interface) Empty() bool
|
||||
pkg go/types, method (*Interface) ExplicitMethod(int) *Func
|
||||
pkg go/types, method (*Interface) Method(int) *Func
|
||||
pkg go/types, method (*Interface) NumEmbeddeds() int
|
||||
pkg go/types, method (*Interface) NumExplicitMethods() int
|
||||
pkg go/types, method (*Interface) NumMethods() int
|
||||
pkg go/types, method (*Interface) String() string
|
||||
pkg go/types, method (*Interface) Underlying() Type
|
||||
pkg go/types, method (*Label) Exported() bool
|
||||
pkg go/types, method (*Label) Id() string
|
||||
pkg go/types, method (*Label) Name() string
|
||||
pkg go/types, method (*Label) Parent() *Scope
|
||||
pkg go/types, method (*Label) Pkg() *Package
|
||||
pkg go/types, method (*Label) Pos() token.Pos
|
||||
pkg go/types, method (*Label) String() string
|
||||
pkg go/types, method (*Label) Type() Type
|
||||
pkg go/types, method (*Map) Elem() Type
|
||||
pkg go/types, method (*Map) Key() Type
|
||||
pkg go/types, method (*Map) String() string
|
||||
pkg go/types, method (*Map) Underlying() Type
|
||||
pkg go/types, method (*MethodSet) At(int) *Selection
|
||||
pkg go/types, method (*MethodSet) Len() int
|
||||
pkg go/types, method (*MethodSet) Lookup(*Package, string) *Selection
|
||||
pkg go/types, method (*MethodSet) String() string
|
||||
pkg go/types, method (*Named) AddMethod(*Func)
|
||||
pkg go/types, method (*Named) Method(int) *Func
|
||||
pkg go/types, method (*Named) NumMethods() int
|
||||
pkg go/types, method (*Named) Obj() *TypeName
|
||||
pkg go/types, method (*Named) SetUnderlying(Type)
|
||||
pkg go/types, method (*Named) String() string
|
||||
pkg go/types, method (*Named) Underlying() Type
|
||||
pkg go/types, method (*Nil) Exported() bool
|
||||
pkg go/types, method (*Nil) Id() string
|
||||
pkg go/types, method (*Nil) Name() string
|
||||
pkg go/types, method (*Nil) Parent() *Scope
|
||||
pkg go/types, method (*Nil) Pkg() *Package
|
||||
pkg go/types, method (*Nil) Pos() token.Pos
|
||||
pkg go/types, method (*Nil) String() string
|
||||
pkg go/types, method (*Nil) Type() Type
|
||||
pkg go/types, method (*Package) Complete() bool
|
||||
pkg go/types, method (*Package) Imports() []*Package
|
||||
pkg go/types, method (*Package) MarkComplete()
|
||||
pkg go/types, method (*Package) Name() string
|
||||
pkg go/types, method (*Package) Path() string
|
||||
pkg go/types, method (*Package) Scope() *Scope
|
||||
pkg go/types, method (*Package) SetImports([]*Package)
|
||||
pkg go/types, method (*Package) String() string
|
||||
pkg go/types, method (*PkgName) Exported() bool
|
||||
pkg go/types, method (*PkgName) Id() string
|
||||
pkg go/types, method (*PkgName) Imported() *Package
|
||||
pkg go/types, method (*PkgName) Name() string
|
||||
pkg go/types, method (*PkgName) Parent() *Scope
|
||||
pkg go/types, method (*PkgName) Pkg() *Package
|
||||
pkg go/types, method (*PkgName) Pos() token.Pos
|
||||
pkg go/types, method (*PkgName) String() string
|
||||
pkg go/types, method (*PkgName) Type() Type
|
||||
pkg go/types, method (*Pointer) Elem() Type
|
||||
pkg go/types, method (*Pointer) String() string
|
||||
pkg go/types, method (*Pointer) Underlying() Type
|
||||
pkg go/types, method (*Scope) Child(int) *Scope
|
||||
pkg go/types, method (*Scope) Contains(token.Pos) bool
|
||||
pkg go/types, method (*Scope) End() token.Pos
|
||||
pkg go/types, method (*Scope) Innermost(token.Pos) *Scope
|
||||
pkg go/types, method (*Scope) Insert(Object) Object
|
||||
pkg go/types, method (*Scope) Len() int
|
||||
pkg go/types, method (*Scope) Lookup(string) Object
|
||||
pkg go/types, method (*Scope) LookupParent(string, token.Pos) (*Scope, Object)
|
||||
pkg go/types, method (*Scope) Names() []string
|
||||
pkg go/types, method (*Scope) NumChildren() int
|
||||
pkg go/types, method (*Scope) Parent() *Scope
|
||||
pkg go/types, method (*Scope) Pos() token.Pos
|
||||
pkg go/types, method (*Scope) String() string
|
||||
pkg go/types, method (*Scope) WriteTo(io.Writer, int, bool)
|
||||
pkg go/types, method (*Selection) Index() []int
|
||||
pkg go/types, method (*Selection) Indirect() bool
|
||||
pkg go/types, method (*Selection) Kind() SelectionKind
|
||||
pkg go/types, method (*Selection) Obj() Object
|
||||
pkg go/types, method (*Selection) Recv() Type
|
||||
pkg go/types, method (*Selection) String() string
|
||||
pkg go/types, method (*Selection) Type() Type
|
||||
pkg go/types, method (*Signature) Params() *Tuple
|
||||
pkg go/types, method (*Signature) Recv() *Var
|
||||
pkg go/types, method (*Signature) Results() *Tuple
|
||||
pkg go/types, method (*Signature) String() string
|
||||
pkg go/types, method (*Signature) Underlying() Type
|
||||
pkg go/types, method (*Signature) Variadic() bool
|
||||
pkg go/types, method (*Slice) Elem() Type
|
||||
pkg go/types, method (*Slice) String() string
|
||||
pkg go/types, method (*Slice) Underlying() Type
|
||||
pkg go/types, method (*StdSizes) Alignof(Type) int64
|
||||
pkg go/types, method (*StdSizes) Offsetsof([]*Var) []int64
|
||||
pkg go/types, method (*StdSizes) Sizeof(Type) int64
|
||||
pkg go/types, method (*Struct) Field(int) *Var
|
||||
pkg go/types, method (*Struct) NumFields() int
|
||||
pkg go/types, method (*Struct) String() string
|
||||
pkg go/types, method (*Struct) Tag(int) string
|
||||
pkg go/types, method (*Struct) Underlying() Type
|
||||
pkg go/types, method (*Tuple) At(int) *Var
|
||||
pkg go/types, method (*Tuple) Len() int
|
||||
pkg go/types, method (*Tuple) String() string
|
||||
pkg go/types, method (*Tuple) Underlying() Type
|
||||
pkg go/types, method (*TypeName) Exported() bool
|
||||
pkg go/types, method (*TypeName) Id() string
|
||||
pkg go/types, method (*TypeName) Name() string
|
||||
pkg go/types, method (*TypeName) Parent() *Scope
|
||||
pkg go/types, method (*TypeName) Pkg() *Package
|
||||
pkg go/types, method (*TypeName) Pos() token.Pos
|
||||
pkg go/types, method (*TypeName) String() string
|
||||
pkg go/types, method (*TypeName) Type() Type
|
||||
pkg go/types, method (*Var) Anonymous() bool
|
||||
pkg go/types, method (*Var) Exported() bool
|
||||
pkg go/types, method (*Var) Id() string
|
||||
pkg go/types, method (*Var) IsField() bool
|
||||
pkg go/types, method (*Var) Name() string
|
||||
pkg go/types, method (*Var) Parent() *Scope
|
||||
pkg go/types, method (*Var) Pkg() *Package
|
||||
pkg go/types, method (*Var) Pos() token.Pos
|
||||
pkg go/types, method (*Var) String() string
|
||||
pkg go/types, method (*Var) Type() Type
|
||||
pkg go/types, method (Checker) ObjectOf(*ast.Ident) Object
|
||||
pkg go/types, method (Checker) TypeOf(ast.Expr) Type
|
||||
pkg go/types, method (Error) Error() string
|
||||
pkg go/types, method (TypeAndValue) Addressable() bool
|
||||
pkg go/types, method (TypeAndValue) Assignable() bool
|
||||
pkg go/types, method (TypeAndValue) HasOk() bool
|
||||
pkg go/types, method (TypeAndValue) IsBuiltin() bool
|
||||
pkg go/types, method (TypeAndValue) IsNil() bool
|
||||
pkg go/types, method (TypeAndValue) IsType() bool
|
||||
pkg go/types, method (TypeAndValue) IsValue() bool
|
||||
pkg go/types, method (TypeAndValue) IsVoid() bool
|
||||
pkg go/types, type Array struct
|
||||
pkg go/types, type Basic struct
|
||||
pkg go/types, type BasicInfo int
|
||||
pkg go/types, type BasicKind int
|
||||
pkg go/types, type Builtin struct
|
||||
pkg go/types, type Chan struct
|
||||
pkg go/types, type ChanDir int
|
||||
pkg go/types, type Checker struct
|
||||
pkg go/types, type Checker struct, embedded *Info
|
||||
pkg go/types, type Config struct
|
||||
pkg go/types, type Config struct, DisableUnusedImportCheck bool
|
||||
pkg go/types, type Config struct, Error func(error)
|
||||
pkg go/types, type Config struct, FakeImportC bool
|
||||
pkg go/types, type Config struct, IgnoreFuncBodies bool
|
||||
pkg go/types, type Config struct, Importer Importer
|
||||
pkg go/types, type Config struct, Sizes Sizes
|
||||
pkg go/types, type Const struct
|
||||
pkg go/types, type Error struct
|
||||
pkg go/types, type Error struct, Fset *token.FileSet
|
||||
pkg go/types, type Error struct, Msg string
|
||||
pkg go/types, type Error struct, Pos token.Pos
|
||||
pkg go/types, type Error struct, Soft bool
|
||||
pkg go/types, type Func struct
|
||||
pkg go/types, type Importer interface { Import }
|
||||
pkg go/types, type Importer interface, Import(string) (*Package, error)
|
||||
pkg go/types, type Info struct
|
||||
pkg go/types, type Info struct, Defs map[*ast.Ident]Object
|
||||
pkg go/types, type Info struct, Implicits map[ast.Node]Object
|
||||
pkg go/types, type Info struct, InitOrder []*Initializer
|
||||
pkg go/types, type Info struct, Scopes map[ast.Node]*Scope
|
||||
pkg go/types, type Info struct, Selections map[*ast.SelectorExpr]*Selection
|
||||
pkg go/types, type Info struct, Types map[ast.Expr]TypeAndValue
|
||||
pkg go/types, type Info struct, Uses map[*ast.Ident]Object
|
||||
pkg go/types, type Initializer struct
|
||||
pkg go/types, type Initializer struct, Lhs []*Var
|
||||
pkg go/types, type Initializer struct, Rhs ast.Expr
|
||||
pkg go/types, type Interface struct
|
||||
pkg go/types, type Label struct
|
||||
pkg go/types, type Map struct
|
||||
pkg go/types, type MethodSet struct
|
||||
pkg go/types, type Named struct
|
||||
pkg go/types, type Nil struct
|
||||
pkg go/types, type Object interface, Exported() bool
|
||||
pkg go/types, type Object interface, Id() string
|
||||
pkg go/types, type Object interface, Name() string
|
||||
pkg go/types, type Object interface, Parent() *Scope
|
||||
pkg go/types, type Object interface, Pkg() *Package
|
||||
pkg go/types, type Object interface, Pos() token.Pos
|
||||
pkg go/types, type Object interface, String() string
|
||||
pkg go/types, type Object interface, Type() Type
|
||||
pkg go/types, type Object interface, unexported methods
|
||||
pkg go/types, type Package struct
|
||||
pkg go/types, type PkgName struct
|
||||
pkg go/types, type Pointer struct
|
||||
pkg go/types, type Qualifier func(*Package) string
|
||||
pkg go/types, type Scope struct
|
||||
pkg go/types, type Selection struct
|
||||
pkg go/types, type SelectionKind int
|
||||
pkg go/types, type Signature struct
|
||||
pkg go/types, type Sizes interface { Alignof, Offsetsof, Sizeof }
|
||||
pkg go/types, type Sizes interface, Alignof(Type) int64
|
||||
pkg go/types, type Sizes interface, Offsetsof([]*Var) []int64
|
||||
pkg go/types, type Sizes interface, Sizeof(Type) int64
|
||||
pkg go/types, type Slice struct
|
||||
pkg go/types, type StdSizes struct
|
||||
pkg go/types, type StdSizes struct, MaxAlign int64
|
||||
pkg go/types, type StdSizes struct, WordSize int64
|
||||
pkg go/types, type Struct struct
|
||||
pkg go/types, type Tuple struct
|
||||
pkg go/types, type Type interface { String, Underlying }
|
||||
pkg go/types, type Type interface, String() string
|
||||
pkg go/types, type Type interface, Underlying() Type
|
||||
pkg go/types, type TypeAndValue struct
|
||||
pkg go/types, type TypeAndValue struct, Type Type
|
||||
pkg go/types, type TypeAndValue struct, Value constant.Value
|
||||
pkg go/types, type TypeName struct
|
||||
pkg go/types, type Var struct
|
||||
pkg go/types, var Typ []*Basic
|
||||
pkg go/types, var Universe *Scope
|
||||
pkg go/types, var Unsafe *Package
|
||||
pkg html/template, method (*Template) Option(...string) *Template
|
||||
pkg image, const YCbCrSubsampleRatio410 = 5
|
||||
pkg image, const YCbCrSubsampleRatio410 YCbCrSubsampleRatio
|
||||
pkg image, const YCbCrSubsampleRatio411 = 4
|
||||
pkg image, const YCbCrSubsampleRatio411 YCbCrSubsampleRatio
|
||||
pkg image, func NewCMYK(Rectangle) *CMYK
|
||||
pkg image, method (*CMYK) At(int, int) color.Color
|
||||
pkg image, method (*CMYK) Bounds() Rectangle
|
||||
pkg image, method (*CMYK) CMYKAt(int, int) color.CMYK
|
||||
pkg image, method (*CMYK) ColorModel() color.Model
|
||||
pkg image, method (*CMYK) Opaque() bool
|
||||
pkg image, method (*CMYK) PixOffset(int, int) int
|
||||
pkg image, method (*CMYK) Set(int, int, color.Color)
|
||||
pkg image, method (*CMYK) SetCMYK(int, int, color.CMYK)
|
||||
pkg image, method (*CMYK) SubImage(Rectangle) Image
|
||||
pkg image, method (Rectangle) At(int, int) color.Color
|
||||
pkg image, method (Rectangle) Bounds() Rectangle
|
||||
pkg image, method (Rectangle) ColorModel() color.Model
|
||||
pkg image, type CMYK struct
|
||||
pkg image, type CMYK struct, Pix []uint8
|
||||
pkg image, type CMYK struct, Rect Rectangle
|
||||
pkg image, type CMYK struct, Stride int
|
||||
pkg image/color, func CMYKToRGB(uint8, uint8, uint8, uint8) (uint8, uint8, uint8)
|
||||
pkg image/color, func RGBToCMYK(uint8, uint8, uint8) (uint8, uint8, uint8, uint8)
|
||||
pkg image/color, method (CMYK) RGBA() (uint32, uint32, uint32, uint32)
|
||||
pkg image/color, type CMYK struct
|
||||
pkg image/color, type CMYK struct, C uint8
|
||||
pkg image/color, type CMYK struct, K uint8
|
||||
pkg image/color, type CMYK struct, M uint8
|
||||
pkg image/color, type CMYK struct, Y uint8
|
||||
pkg image/color, var CMYKModel Model
|
||||
pkg image/gif, const DisposalBackground = 2
|
||||
pkg image/gif, const DisposalBackground ideal-int
|
||||
pkg image/gif, const DisposalNone = 1
|
||||
pkg image/gif, const DisposalNone ideal-int
|
||||
pkg image/gif, const DisposalPrevious = 3
|
||||
pkg image/gif, const DisposalPrevious ideal-int
|
||||
pkg image/gif, type GIF struct, BackgroundIndex uint8
|
||||
pkg image/gif, type GIF struct, Config image.Config
|
||||
pkg image/gif, type GIF struct, Disposal []uint8
|
||||
pkg io, func CopyBuffer(Writer, Reader, []uint8) (int64, error)
|
||||
pkg log, const LUTC = 32
|
||||
pkg log, const LUTC ideal-int
|
||||
pkg log, func Output(int, string) error
|
||||
pkg log, method (*Logger) SetOutput(io.Writer)
|
||||
pkg math/big, const Above = 1
|
||||
pkg math/big, const Above Accuracy
|
||||
pkg math/big, const AwayFromZero = 3
|
||||
pkg math/big, const AwayFromZero RoundingMode
|
||||
pkg math/big, const Below = -1
|
||||
pkg math/big, const Below Accuracy
|
||||
pkg math/big, const Exact = 0
|
||||
pkg math/big, const Exact Accuracy
|
||||
pkg math/big, const MaxExp = 2147483647
|
||||
pkg math/big, const MaxExp ideal-int
|
||||
pkg math/big, const MaxPrec = 4294967295
|
||||
pkg math/big, const MaxPrec ideal-int
|
||||
pkg math/big, const MinExp = -2147483648
|
||||
pkg math/big, const MinExp ideal-int
|
||||
pkg math/big, const ToNearestAway = 1
|
||||
pkg math/big, const ToNearestAway RoundingMode
|
||||
pkg math/big, const ToNearestEven = 0
|
||||
pkg math/big, const ToNearestEven RoundingMode
|
||||
pkg math/big, const ToNegativeInf = 4
|
||||
pkg math/big, const ToNegativeInf RoundingMode
|
||||
pkg math/big, const ToPositiveInf = 5
|
||||
pkg math/big, const ToPositiveInf RoundingMode
|
||||
pkg math/big, const ToZero = 2
|
||||
pkg math/big, const ToZero RoundingMode
|
||||
pkg math/big, func Jacobi(*Int, *Int) int
|
||||
pkg math/big, func NewFloat(float64) *Float
|
||||
pkg math/big, func ParseFloat(string, int, uint, RoundingMode) (*Float, int, error)
|
||||
pkg math/big, method (*Float) Abs(*Float) *Float
|
||||
pkg math/big, method (*Float) Acc() Accuracy
|
||||
pkg math/big, method (*Float) Add(*Float, *Float) *Float
|
||||
pkg math/big, method (*Float) Append([]uint8, uint8, int) []uint8
|
||||
pkg math/big, method (*Float) Cmp(*Float) int
|
||||
pkg math/big, method (*Float) Copy(*Float) *Float
|
||||
pkg math/big, method (*Float) Float32() (float32, Accuracy)
|
||||
pkg math/big, method (*Float) Float64() (float64, Accuracy)
|
||||
pkg math/big, method (*Float) Format(fmt.State, int32)
|
||||
pkg math/big, method (*Float) Int(*Int) (*Int, Accuracy)
|
||||
pkg math/big, method (*Float) Int64() (int64, Accuracy)
|
||||
pkg math/big, method (*Float) IsInf() bool
|
||||
pkg math/big, method (*Float) IsInt() bool
|
||||
pkg math/big, method (*Float) MantExp(*Float) int
|
||||
pkg math/big, method (*Float) MinPrec() uint
|
||||
pkg math/big, method (*Float) Mode() RoundingMode
|
||||
pkg math/big, method (*Float) Mul(*Float, *Float) *Float
|
||||
pkg math/big, method (*Float) Neg(*Float) *Float
|
||||
pkg math/big, method (*Float) Parse(string, int) (*Float, int, error)
|
||||
pkg math/big, method (*Float) Prec() uint
|
||||
pkg math/big, method (*Float) Quo(*Float, *Float) *Float
|
||||
pkg math/big, method (*Float) Rat(*Rat) (*Rat, Accuracy)
|
||||
pkg math/big, method (*Float) Set(*Float) *Float
|
||||
pkg math/big, method (*Float) SetFloat64(float64) *Float
|
||||
pkg math/big, method (*Float) SetInf(bool) *Float
|
||||
pkg math/big, method (*Float) SetInt(*Int) *Float
|
||||
pkg math/big, method (*Float) SetInt64(int64) *Float
|
||||
pkg math/big, method (*Float) SetMantExp(*Float, int) *Float
|
||||
pkg math/big, method (*Float) SetMode(RoundingMode) *Float
|
||||
pkg math/big, method (*Float) SetPrec(uint) *Float
|
||||
pkg math/big, method (*Float) SetRat(*Rat) *Float
|
||||
pkg math/big, method (*Float) SetString(string) (*Float, bool)
|
||||
pkg math/big, method (*Float) SetUint64(uint64) *Float
|
||||
pkg math/big, method (*Float) Sign() int
|
||||
pkg math/big, method (*Float) Signbit() bool
|
||||
pkg math/big, method (*Float) String() string
|
||||
pkg math/big, method (*Float) Sub(*Float, *Float) *Float
|
||||
pkg math/big, method (*Float) Text(uint8, int) string
|
||||
pkg math/big, method (*Float) Uint64() (uint64, Accuracy)
|
||||
pkg math/big, method (*Int) ModSqrt(*Int, *Int) *Int
|
||||
pkg math/big, method (Accuracy) String() string
|
||||
pkg math/big, method (ErrNaN) Error() string
|
||||
pkg math/big, method (RoundingMode) String() string
|
||||
pkg math/big, type Accuracy int8
|
||||
pkg math/big, type ErrNaN struct
|
||||
pkg math/big, type Float struct
|
||||
pkg math/big, type RoundingMode uint8
|
||||
pkg mime, const BEncoding = 98
|
||||
pkg mime, const BEncoding WordEncoder
|
||||
pkg mime, const QEncoding = 113
|
||||
pkg mime, const QEncoding WordEncoder
|
||||
pkg mime, func ExtensionsByType(string) ([]string, error)
|
||||
pkg mime, method (*WordDecoder) Decode(string) (string, error)
|
||||
pkg mime, method (*WordDecoder) DecodeHeader(string) (string, error)
|
||||
pkg mime, method (WordEncoder) Encode(string, string) string
|
||||
pkg mime, type WordDecoder struct
|
||||
pkg mime, type WordDecoder struct, CharsetReader func(string, io.Reader) (io.Reader, error)
|
||||
pkg mime, type WordEncoder uint8
|
||||
pkg mime/quotedprintable, func NewReader(io.Reader) *Reader
|
||||
pkg mime/quotedprintable, func NewWriter(io.Writer) *Writer
|
||||
pkg mime/quotedprintable, method (*Reader) Read([]uint8) (int, error)
|
||||
pkg mime/quotedprintable, method (*Writer) Close() error
|
||||
pkg mime/quotedprintable, method (*Writer) Write([]uint8) (int, error)
|
||||
pkg mime/quotedprintable, type Reader struct
|
||||
pkg mime/quotedprintable, type Writer struct
|
||||
pkg mime/quotedprintable, type Writer struct, Binary bool
|
||||
pkg net, type Dialer struct, FallbackDelay time.Duration
|
||||
pkg net, type OpError struct, Source Addr
|
||||
pkg net/http, type Request struct, Cancel <-chan struct
|
||||
pkg net/http/fcgi, var ErrConnClosed error
|
||||
pkg net/http/fcgi, var ErrRequestAborted error
|
||||
pkg net/http/pprof, func Trace(http.ResponseWriter, *http.Request)
|
||||
pkg net/mail, method (*AddressParser) Parse(string) (*Address, error)
|
||||
pkg net/mail, method (*AddressParser) ParseList(string) ([]*Address, error)
|
||||
pkg net/mail, type AddressParser struct
|
||||
pkg net/mail, type AddressParser struct, WordDecoder *mime.WordDecoder
|
||||
pkg net/smtp, method (*Client) TLSConnectionState() (tls.ConnectionState, bool)
|
||||
pkg net/url, method (*URL) EscapedPath() string
|
||||
pkg net/url, type URL struct, RawPath string
|
||||
pkg os, func LookupEnv(string) (string, bool)
|
||||
pkg os/signal, func Ignore(...os.Signal)
|
||||
pkg os/signal, func Reset(...os.Signal)
|
||||
pkg reflect, func ArrayOf(int, Type) Type
|
||||
pkg reflect, func FuncOf([]Type, []Type, bool) Type
|
||||
pkg runtime, func ReadTrace() []uint8
|
||||
pkg runtime, func StartTrace() error
|
||||
pkg runtime, func StopTrace()
|
||||
pkg runtime, type MemStats struct, GCCPUFraction float64
|
||||
pkg runtime/trace, func Start(io.Writer) error
|
||||
pkg runtime/trace, func Stop()
|
||||
pkg strings, func Compare(string, string) int
|
||||
pkg strings, func LastIndexByte(string, uint8) int
|
||||
pkg strings, method (*Reader) Size() int64
|
||||
pkg syscall (darwin-386), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (darwin-386), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (darwin-386), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (darwin-386-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (darwin-386-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (darwin-386-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (darwin-amd64), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (darwin-amd64), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (darwin-amd64), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (freebsd-386), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (freebsd-386), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (freebsd-386), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (freebsd-amd64), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (freebsd-amd64), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (freebsd-amd64), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (freebsd-arm), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (freebsd-arm), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (freebsd-arm), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (linux-386), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (linux-386), type SysProcAttr struct, GidMappingsEnableSetgroups bool
|
||||
pkg syscall (linux-386), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (linux-386-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (linux-386-cgo), type SysProcAttr struct, GidMappingsEnableSetgroups bool
|
||||
pkg syscall (linux-386-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (linux-amd64), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (linux-amd64), type SysProcAttr struct, GidMappingsEnableSetgroups bool
|
||||
pkg syscall (linux-amd64), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (linux-amd64-cgo), type SysProcAttr struct, GidMappingsEnableSetgroups bool
|
||||
pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (linux-arm), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (linux-arm), type SysProcAttr struct, GidMappingsEnableSetgroups bool
|
||||
pkg syscall (linux-arm), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (linux-arm-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (linux-arm-cgo), type SysProcAttr struct, GidMappingsEnableSetgroups bool
|
||||
pkg syscall (linux-arm-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (netbsd-386), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (netbsd-386), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (netbsd-386), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (netbsd-amd64), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (netbsd-amd64), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (netbsd-amd64), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (netbsd-arm), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (netbsd-arm), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (netbsd-arm), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (openbsd-386), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (openbsd-386), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (openbsd-386), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (openbsd-amd64), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (openbsd-amd64), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (openbsd-amd64), type SysProcAttr struct, Pgid int
|
||||
pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Ctty int
|
||||
pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Foreground bool
|
||||
pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Pgid int
|
||||
pkg text/template, method (*Template) DefinedTemplates() string
|
||||
pkg text/template, method (*Template) Option(...string) *Template
|
||||
pkg time, method (Time) AppendFormat([]uint8, string) []uint8
|
||||
pkg unicode, const Version = "8.0.0"
|
||||
pkg unicode, var Ahom *RangeTable
|
||||
pkg unicode, var Anatolian_Hieroglyphs *RangeTable
|
||||
pkg unicode, var Hatran *RangeTable
|
||||
pkg unicode, var Multani *RangeTable
|
||||
pkg unicode, var Old_Hungarian *RangeTable
|
||||
pkg unicode, var SignWriting *RangeTable
|
||||
275
api/go1.6.txt
@@ -1,275 +0,0 @@
|
||||
pkg archive/zip, method (*ReadCloser) RegisterDecompressor(uint16, Decompressor)
|
||||
pkg archive/zip, method (*Reader) RegisterDecompressor(uint16, Decompressor)
|
||||
pkg archive/zip, method (*Writer) RegisterCompressor(uint16, Compressor)
|
||||
pkg bufio, method (*Scanner) Buffer([]uint8, int)
|
||||
pkg bufio, var ErrFinalToken error
|
||||
pkg crypto/tls, const TLS_RSA_WITH_AES_128_GCM_SHA256 = 156
|
||||
pkg crypto/tls, const TLS_RSA_WITH_AES_128_GCM_SHA256 uint16
|
||||
pkg crypto/tls, const TLS_RSA_WITH_AES_256_GCM_SHA384 = 157
|
||||
pkg crypto/tls, const TLS_RSA_WITH_AES_256_GCM_SHA384 uint16
|
||||
pkg crypto/tls, method (RecordHeaderError) Error() string
|
||||
pkg crypto/tls, type RecordHeaderError struct
|
||||
pkg crypto/tls, type RecordHeaderError struct, Msg string
|
||||
pkg crypto/tls, type RecordHeaderError struct, RecordHeader [5]uint8
|
||||
pkg crypto/x509, method (InsecureAlgorithmError) Error() string
|
||||
pkg crypto/x509, method (SignatureAlgorithm) String() string
|
||||
pkg crypto/x509, type InsecureAlgorithmError int
|
||||
pkg database/sql, method (*DB) SetConnMaxLifetime(time.Duration)
|
||||
pkg debug/dwarf, const ClassUnknown = 0
|
||||
pkg debug/dwarf, const ClassUnknown Class
|
||||
pkg debug/elf, const COMPRESS_HIOS = 1879048191
|
||||
pkg debug/elf, const COMPRESS_HIOS CompressionType
|
||||
pkg debug/elf, const COMPRESS_HIPROC = 2147483647
|
||||
pkg debug/elf, const COMPRESS_HIPROC CompressionType
|
||||
pkg debug/elf, const COMPRESS_LOOS = 1610612736
|
||||
pkg debug/elf, const COMPRESS_LOOS CompressionType
|
||||
pkg debug/elf, const COMPRESS_LOPROC = 1879048192
|
||||
pkg debug/elf, const COMPRESS_LOPROC CompressionType
|
||||
pkg debug/elf, const COMPRESS_ZLIB = 1
|
||||
pkg debug/elf, const COMPRESS_ZLIB CompressionType
|
||||
pkg debug/elf, const R_MIPS_16 = 1
|
||||
pkg debug/elf, const R_MIPS_16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_26 = 4
|
||||
pkg debug/elf, const R_MIPS_26 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_32 = 2
|
||||
pkg debug/elf, const R_MIPS_32 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_64 = 18
|
||||
pkg debug/elf, const R_MIPS_64 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_ADD_IMMEDIATE = 34
|
||||
pkg debug/elf, const R_MIPS_ADD_IMMEDIATE R_MIPS
|
||||
pkg debug/elf, const R_MIPS_CALL16 = 11
|
||||
pkg debug/elf, const R_MIPS_CALL16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_CALL_HI16 = 30
|
||||
pkg debug/elf, const R_MIPS_CALL_HI16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_CALL_LO16 = 31
|
||||
pkg debug/elf, const R_MIPS_CALL_LO16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_DELETE = 27
|
||||
pkg debug/elf, const R_MIPS_DELETE R_MIPS
|
||||
pkg debug/elf, const R_MIPS_GOT16 = 9
|
||||
pkg debug/elf, const R_MIPS_GOT16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_GOT_DISP = 19
|
||||
pkg debug/elf, const R_MIPS_GOT_DISP R_MIPS
|
||||
pkg debug/elf, const R_MIPS_GOT_HI16 = 22
|
||||
pkg debug/elf, const R_MIPS_GOT_HI16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_GOT_LO16 = 23
|
||||
pkg debug/elf, const R_MIPS_GOT_LO16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_GOT_OFST = 21
|
||||
pkg debug/elf, const R_MIPS_GOT_OFST R_MIPS
|
||||
pkg debug/elf, const R_MIPS_GOT_PAGE = 20
|
||||
pkg debug/elf, const R_MIPS_GOT_PAGE R_MIPS
|
||||
pkg debug/elf, const R_MIPS_GPREL16 = 7
|
||||
pkg debug/elf, const R_MIPS_GPREL16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_GPREL32 = 12
|
||||
pkg debug/elf, const R_MIPS_GPREL32 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_HI16 = 5
|
||||
pkg debug/elf, const R_MIPS_HI16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_HIGHER = 28
|
||||
pkg debug/elf, const R_MIPS_HIGHER R_MIPS
|
||||
pkg debug/elf, const R_MIPS_HIGHEST = 29
|
||||
pkg debug/elf, const R_MIPS_HIGHEST R_MIPS
|
||||
pkg debug/elf, const R_MIPS_INSERT_A = 25
|
||||
pkg debug/elf, const R_MIPS_INSERT_A R_MIPS
|
||||
pkg debug/elf, const R_MIPS_INSERT_B = 26
|
||||
pkg debug/elf, const R_MIPS_INSERT_B R_MIPS
|
||||
pkg debug/elf, const R_MIPS_JALR = 37
|
||||
pkg debug/elf, const R_MIPS_JALR R_MIPS
|
||||
pkg debug/elf, const R_MIPS_LITERAL = 8
|
||||
pkg debug/elf, const R_MIPS_LITERAL R_MIPS
|
||||
pkg debug/elf, const R_MIPS_LO16 = 6
|
||||
pkg debug/elf, const R_MIPS_LO16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_NONE = 0
|
||||
pkg debug/elf, const R_MIPS_NONE R_MIPS
|
||||
pkg debug/elf, const R_MIPS_PC16 = 10
|
||||
pkg debug/elf, const R_MIPS_PC16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_PJUMP = 35
|
||||
pkg debug/elf, const R_MIPS_PJUMP R_MIPS
|
||||
pkg debug/elf, const R_MIPS_REL16 = 33
|
||||
pkg debug/elf, const R_MIPS_REL16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_REL32 = 3
|
||||
pkg debug/elf, const R_MIPS_REL32 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_RELGOT = 36
|
||||
pkg debug/elf, const R_MIPS_RELGOT R_MIPS
|
||||
pkg debug/elf, const R_MIPS_SCN_DISP = 32
|
||||
pkg debug/elf, const R_MIPS_SCN_DISP R_MIPS
|
||||
pkg debug/elf, const R_MIPS_SHIFT5 = 16
|
||||
pkg debug/elf, const R_MIPS_SHIFT5 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_SHIFT6 = 17
|
||||
pkg debug/elf, const R_MIPS_SHIFT6 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_SUB = 24
|
||||
pkg debug/elf, const R_MIPS_SUB R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPMOD32 = 38
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPMOD32 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPMOD64 = 40
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPMOD64 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPREL32 = 39
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPREL32 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPREL64 = 41
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPREL64 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPREL_HI16 = 44
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPREL_HI16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPREL_LO16 = 45
|
||||
pkg debug/elf, const R_MIPS_TLS_DTPREL_LO16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_GD = 42
|
||||
pkg debug/elf, const R_MIPS_TLS_GD R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_GOTTPREL = 46
|
||||
pkg debug/elf, const R_MIPS_TLS_GOTTPREL R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_LDM = 43
|
||||
pkg debug/elf, const R_MIPS_TLS_LDM R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_TPREL32 = 47
|
||||
pkg debug/elf, const R_MIPS_TLS_TPREL32 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_TPREL64 = 48
|
||||
pkg debug/elf, const R_MIPS_TLS_TPREL64 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_TPREL_HI16 = 49
|
||||
pkg debug/elf, const R_MIPS_TLS_TPREL_HI16 R_MIPS
|
||||
pkg debug/elf, const R_MIPS_TLS_TPREL_LO16 = 50
|
||||
pkg debug/elf, const R_MIPS_TLS_TPREL_LO16 R_MIPS
|
||||
pkg debug/elf, const SHF_COMPRESSED = 2048
|
||||
pkg debug/elf, const SHF_COMPRESSED SectionFlag
|
||||
pkg debug/elf, method (CompressionType) GoString() string
|
||||
pkg debug/elf, method (CompressionType) String() string
|
||||
pkg debug/elf, method (R_MIPS) GoString() string
|
||||
pkg debug/elf, method (R_MIPS) String() string
|
||||
pkg debug/elf, type Chdr32 struct
|
||||
pkg debug/elf, type Chdr32 struct, Addralign uint32
|
||||
pkg debug/elf, type Chdr32 struct, Size uint32
|
||||
pkg debug/elf, type Chdr32 struct, Type uint32
|
||||
pkg debug/elf, type Chdr64 struct
|
||||
pkg debug/elf, type Chdr64 struct, Addralign uint64
|
||||
pkg debug/elf, type Chdr64 struct, Size uint64
|
||||
pkg debug/elf, type Chdr64 struct, Type uint32
|
||||
pkg debug/elf, type CompressionType int
|
||||
pkg debug/elf, type R_MIPS int
|
||||
pkg debug/elf, type SectionHeader struct, FileSize uint64
|
||||
pkg encoding/asn1, const ClassApplication = 1
|
||||
pkg encoding/asn1, const ClassApplication ideal-int
|
||||
pkg encoding/asn1, const ClassContextSpecific = 2
|
||||
pkg encoding/asn1, const ClassContextSpecific ideal-int
|
||||
pkg encoding/asn1, const ClassPrivate = 3
|
||||
pkg encoding/asn1, const ClassPrivate ideal-int
|
||||
pkg encoding/asn1, const ClassUniversal = 0
|
||||
pkg encoding/asn1, const ClassUniversal ideal-int
|
||||
pkg encoding/asn1, const TagBitString = 3
|
||||
pkg encoding/asn1, const TagBitString ideal-int
|
||||
pkg encoding/asn1, const TagBoolean = 1
|
||||
pkg encoding/asn1, const TagBoolean ideal-int
|
||||
pkg encoding/asn1, const TagEnum = 10
|
||||
pkg encoding/asn1, const TagEnum ideal-int
|
||||
pkg encoding/asn1, const TagGeneralString = 27
|
||||
pkg encoding/asn1, const TagGeneralString ideal-int
|
||||
pkg encoding/asn1, const TagGeneralizedTime = 24
|
||||
pkg encoding/asn1, const TagGeneralizedTime ideal-int
|
||||
pkg encoding/asn1, const TagIA5String = 22
|
||||
pkg encoding/asn1, const TagIA5String ideal-int
|
||||
pkg encoding/asn1, const TagInteger = 2
|
||||
pkg encoding/asn1, const TagInteger ideal-int
|
||||
pkg encoding/asn1, const TagOID = 6
|
||||
pkg encoding/asn1, const TagOID ideal-int
|
||||
pkg encoding/asn1, const TagOctetString = 4
|
||||
pkg encoding/asn1, const TagOctetString ideal-int
|
||||
pkg encoding/asn1, const TagPrintableString = 19
|
||||
pkg encoding/asn1, const TagPrintableString ideal-int
|
||||
pkg encoding/asn1, const TagSequence = 16
|
||||
pkg encoding/asn1, const TagSequence ideal-int
|
||||
pkg encoding/asn1, const TagSet = 17
|
||||
pkg encoding/asn1, const TagSet ideal-int
|
||||
pkg encoding/asn1, const TagT61String = 20
|
||||
pkg encoding/asn1, const TagT61String ideal-int
|
||||
pkg encoding/asn1, const TagUTCTime = 23
|
||||
pkg encoding/asn1, const TagUTCTime ideal-int
|
||||
pkg encoding/asn1, const TagUTF8String = 12
|
||||
pkg encoding/asn1, const TagUTF8String ideal-int
|
||||
pkg go/build, const IgnoreVendor = 8
|
||||
pkg go/build, const IgnoreVendor ImportMode
|
||||
pkg go/build, type Package struct, InvalidGoFiles []string
|
||||
pkg go/constant, func ToComplex(Value) Value
|
||||
pkg go/constant, func ToFloat(Value) Value
|
||||
pkg go/constant, func ToInt(Value) Value
|
||||
pkg go/constant, type Value interface, ExactString() string
|
||||
pkg go/types, method (*Package) SetName(string)
|
||||
pkg go/types, type ImportMode int
|
||||
pkg go/types, type ImporterFrom interface { Import, ImportFrom }
|
||||
pkg go/types, type ImporterFrom interface, Import(string) (*Package, error)
|
||||
pkg go/types, type ImporterFrom interface, ImportFrom(string, string, ImportMode) (*Package, error)
|
||||
pkg html/template, func IsTrue(interface{}) (bool, bool)
|
||||
pkg html/template, method (*Template) DefinedTemplates() string
|
||||
pkg image, func NewNYCbCrA(Rectangle, YCbCrSubsampleRatio) *NYCbCrA
|
||||
pkg image, method (*NYCbCrA) AOffset(int, int) int
|
||||
pkg image, method (*NYCbCrA) At(int, int) color.Color
|
||||
pkg image, method (*NYCbCrA) Bounds() Rectangle
|
||||
pkg image, method (*NYCbCrA) COffset(int, int) int
|
||||
pkg image, method (*NYCbCrA) ColorModel() color.Model
|
||||
pkg image, method (*NYCbCrA) NYCbCrAAt(int, int) color.NYCbCrA
|
||||
pkg image, method (*NYCbCrA) Opaque() bool
|
||||
pkg image, method (*NYCbCrA) SubImage(Rectangle) Image
|
||||
pkg image, method (*NYCbCrA) YCbCrAt(int, int) color.YCbCr
|
||||
pkg image, method (*NYCbCrA) YOffset(int, int) int
|
||||
pkg image, type NYCbCrA struct
|
||||
pkg image, type NYCbCrA struct, A []uint8
|
||||
pkg image, type NYCbCrA struct, AStride int
|
||||
pkg image, type NYCbCrA struct, embedded YCbCr
|
||||
pkg image/color, method (NYCbCrA) RGBA() (uint32, uint32, uint32, uint32)
|
||||
pkg image/color, type NYCbCrA struct
|
||||
pkg image/color, type NYCbCrA struct, A uint8
|
||||
pkg image/color, type NYCbCrA struct, embedded YCbCr
|
||||
pkg image/color, var NYCbCrAModel Model
|
||||
pkg math/big, method (*Float) MarshalText() ([]uint8, error)
|
||||
pkg math/big, method (*Float) UnmarshalText([]uint8) error
|
||||
pkg math/big, method (*Int) Append([]uint8, int) []uint8
|
||||
pkg math/big, method (*Int) Text(int) string
|
||||
pkg math/rand, func Read([]uint8) (int, error)
|
||||
pkg math/rand, method (*Rand) Read([]uint8) (int, error)
|
||||
pkg net, type DNSError struct, IsTemporary bool
|
||||
pkg net, type Dialer struct, Cancel <-chan struct
|
||||
pkg net/http, const MethodConnect = "CONNECT"
|
||||
pkg net/http, const MethodConnect ideal-string
|
||||
pkg net/http, const MethodDelete = "DELETE"
|
||||
pkg net/http, const MethodDelete ideal-string
|
||||
pkg net/http, const MethodGet = "GET"
|
||||
pkg net/http, const MethodGet ideal-string
|
||||
pkg net/http, const MethodHead = "HEAD"
|
||||
pkg net/http, const MethodHead ideal-string
|
||||
pkg net/http, const MethodOptions = "OPTIONS"
|
||||
pkg net/http, const MethodOptions ideal-string
|
||||
pkg net/http, const MethodPatch = "PATCH"
|
||||
pkg net/http, const MethodPatch ideal-string
|
||||
pkg net/http, const MethodPost = "POST"
|
||||
pkg net/http, const MethodPost ideal-string
|
||||
pkg net/http, const MethodPut = "PUT"
|
||||
pkg net/http, const MethodPut ideal-string
|
||||
pkg net/http, const MethodTrace = "TRACE"
|
||||
pkg net/http, const MethodTrace ideal-string
|
||||
pkg net/http, const StatusNetworkAuthenticationRequired = 511
|
||||
pkg net/http, const StatusNetworkAuthenticationRequired ideal-int
|
||||
pkg net/http, const StatusPreconditionRequired = 428
|
||||
pkg net/http, const StatusPreconditionRequired ideal-int
|
||||
pkg net/http, const StatusRequestHeaderFieldsTooLarge = 431
|
||||
pkg net/http, const StatusRequestHeaderFieldsTooLarge ideal-int
|
||||
pkg net/http, const StatusTooManyRequests = 429
|
||||
pkg net/http, const StatusTooManyRequests ideal-int
|
||||
pkg net/http, const StatusUnavailableForLegalReasons = 451
|
||||
pkg net/http, const StatusUnavailableForLegalReasons ideal-int
|
||||
pkg net/http, type Transport struct, ExpectContinueTimeout time.Duration
|
||||
pkg net/http, type Transport struct, TLSNextProto map[string]func(string, *tls.Conn) RoundTripper
|
||||
pkg net/http, var ErrSkipAltProtocol error
|
||||
pkg net/http/httptest, method (*ResponseRecorder) WriteString(string) (int, error)
|
||||
pkg net/http/httputil, type BufferPool interface { Get, Put }
|
||||
pkg net/http/httputil, type BufferPool interface, Get() []uint8
|
||||
pkg net/http/httputil, type BufferPool interface, Put([]uint8)
|
||||
pkg net/http/httputil, type ReverseProxy struct, BufferPool BufferPool
|
||||
pkg net/url, method (*Error) Temporary() bool
|
||||
pkg net/url, method (*Error) Timeout() bool
|
||||
pkg net/url, method (InvalidHostError) Error() string
|
||||
pkg net/url, type InvalidHostError string
|
||||
pkg os/exec, type ExitError struct, Stderr []uint8
|
||||
pkg regexp, method (*Regexp) Copy() *Regexp
|
||||
pkg runtime/debug, func SetTraceback(string)
|
||||
pkg strconv, func AppendQuoteRuneToGraphic([]uint8, int32) []uint8
|
||||
pkg strconv, func AppendQuoteToGraphic([]uint8, string) []uint8
|
||||
pkg strconv, func IsGraphic(int32) bool
|
||||
pkg strconv, func QuoteRuneToGraphic(int32) string
|
||||
pkg strconv, func QuoteToGraphic(string) string
|
||||
pkg text/template, func IsTrue(interface{}) (bool, bool)
|
||||
pkg text/template, method (ExecError) Error() string
|
||||
pkg text/template, type ExecError struct
|
||||
pkg text/template, type ExecError struct, Err error
|
||||
pkg text/template, type ExecError struct, Name string
|
||||
285
api/go1.7.txt
@@ -1,285 +0,0 @@
|
||||
pkg bytes, func ContainsAny([]uint8, string) bool
|
||||
pkg bytes, func ContainsRune([]uint8, int32) bool
|
||||
pkg bytes, method (*Reader) Reset([]uint8)
|
||||
pkg compress/flate, const HuffmanOnly = -2
|
||||
pkg compress/flate, const HuffmanOnly ideal-int
|
||||
pkg context, func Background() Context
|
||||
pkg context, func TODO() Context
|
||||
pkg context, func WithCancel(Context) (Context, CancelFunc)
|
||||
pkg context, func WithDeadline(Context, time.Time) (Context, CancelFunc)
|
||||
pkg context, func WithTimeout(Context, time.Duration) (Context, CancelFunc)
|
||||
pkg context, func WithValue(Context, interface{}, interface{}) Context
|
||||
pkg context, type CancelFunc func()
|
||||
pkg context, type Context interface { Deadline, Done, Err, Value }
|
||||
pkg context, type Context interface, Deadline() (time.Time, bool)
|
||||
pkg context, type Context interface, Done() <-chan struct
|
||||
pkg context, type Context interface, Err() error
|
||||
pkg context, type Context interface, Value(interface{}) interface{}
|
||||
pkg context, var Canceled error
|
||||
pkg context, var DeadlineExceeded error
|
||||
pkg crypto/tls, const RenegotiateFreelyAsClient = 2
|
||||
pkg crypto/tls, const RenegotiateFreelyAsClient RenegotiationSupport
|
||||
pkg crypto/tls, const RenegotiateNever = 0
|
||||
pkg crypto/tls, const RenegotiateNever RenegotiationSupport
|
||||
pkg crypto/tls, const RenegotiateOnceAsClient = 1
|
||||
pkg crypto/tls, const RenegotiateOnceAsClient RenegotiationSupport
|
||||
pkg crypto/tls, type Config struct, DynamicRecordSizingDisabled bool
|
||||
pkg crypto/tls, type Config struct, Renegotiation RenegotiationSupport
|
||||
pkg crypto/tls, type RenegotiationSupport int
|
||||
pkg crypto/x509, func SystemCertPool() (*CertPool, error)
|
||||
pkg crypto/x509, type SystemRootsError struct, Err error
|
||||
pkg debug/dwarf, method (*Data) Ranges(*Entry) ([][2]uint64, error)
|
||||
pkg debug/dwarf, method (*Reader) SeekPC(uint64) (*Entry, error)
|
||||
pkg debug/elf, const R_390_12 = 2
|
||||
pkg debug/elf, const R_390_12 R_390
|
||||
pkg debug/elf, const R_390_16 = 3
|
||||
pkg debug/elf, const R_390_16 R_390
|
||||
pkg debug/elf, const R_390_20 = 57
|
||||
pkg debug/elf, const R_390_20 R_390
|
||||
pkg debug/elf, const R_390_32 = 4
|
||||
pkg debug/elf, const R_390_32 R_390
|
||||
pkg debug/elf, const R_390_64 = 22
|
||||
pkg debug/elf, const R_390_64 R_390
|
||||
pkg debug/elf, const R_390_8 = 1
|
||||
pkg debug/elf, const R_390_8 R_390
|
||||
pkg debug/elf, const R_390_COPY = 9
|
||||
pkg debug/elf, const R_390_COPY R_390
|
||||
pkg debug/elf, const R_390_GLOB_DAT = 10
|
||||
pkg debug/elf, const R_390_GLOB_DAT R_390
|
||||
pkg debug/elf, const R_390_GOT12 = 6
|
||||
pkg debug/elf, const R_390_GOT12 R_390
|
||||
pkg debug/elf, const R_390_GOT16 = 15
|
||||
pkg debug/elf, const R_390_GOT16 R_390
|
||||
pkg debug/elf, const R_390_GOT20 = 58
|
||||
pkg debug/elf, const R_390_GOT20 R_390
|
||||
pkg debug/elf, const R_390_GOT32 = 7
|
||||
pkg debug/elf, const R_390_GOT32 R_390
|
||||
pkg debug/elf, const R_390_GOT64 = 24
|
||||
pkg debug/elf, const R_390_GOT64 R_390
|
||||
pkg debug/elf, const R_390_GOTENT = 26
|
||||
pkg debug/elf, const R_390_GOTENT R_390
|
||||
pkg debug/elf, const R_390_GOTOFF = 13
|
||||
pkg debug/elf, const R_390_GOTOFF R_390
|
||||
pkg debug/elf, const R_390_GOTOFF16 = 27
|
||||
pkg debug/elf, const R_390_GOTOFF16 R_390
|
||||
pkg debug/elf, const R_390_GOTOFF64 = 28
|
||||
pkg debug/elf, const R_390_GOTOFF64 R_390
|
||||
pkg debug/elf, const R_390_GOTPC = 14
|
||||
pkg debug/elf, const R_390_GOTPC R_390
|
||||
pkg debug/elf, const R_390_GOTPCDBL = 21
|
||||
pkg debug/elf, const R_390_GOTPCDBL R_390
|
||||
pkg debug/elf, const R_390_GOTPLT12 = 29
|
||||
pkg debug/elf, const R_390_GOTPLT12 R_390
|
||||
pkg debug/elf, const R_390_GOTPLT16 = 30
|
||||
pkg debug/elf, const R_390_GOTPLT16 R_390
|
||||
pkg debug/elf, const R_390_GOTPLT20 = 59
|
||||
pkg debug/elf, const R_390_GOTPLT20 R_390
|
||||
pkg debug/elf, const R_390_GOTPLT32 = 31
|
||||
pkg debug/elf, const R_390_GOTPLT32 R_390
|
||||
pkg debug/elf, const R_390_GOTPLT64 = 32
|
||||
pkg debug/elf, const R_390_GOTPLT64 R_390
|
||||
pkg debug/elf, const R_390_GOTPLTENT = 33
|
||||
pkg debug/elf, const R_390_GOTPLTENT R_390
|
||||
pkg debug/elf, const R_390_GOTPLTOFF16 = 34
|
||||
pkg debug/elf, const R_390_GOTPLTOFF16 R_390
|
||||
pkg debug/elf, const R_390_GOTPLTOFF32 = 35
|
||||
pkg debug/elf, const R_390_GOTPLTOFF32 R_390
|
||||
pkg debug/elf, const R_390_GOTPLTOFF64 = 36
|
||||
pkg debug/elf, const R_390_GOTPLTOFF64 R_390
|
||||
pkg debug/elf, const R_390_JMP_SLOT = 11
|
||||
pkg debug/elf, const R_390_JMP_SLOT R_390
|
||||
pkg debug/elf, const R_390_NONE = 0
|
||||
pkg debug/elf, const R_390_NONE R_390
|
||||
pkg debug/elf, const R_390_PC16 = 16
|
||||
pkg debug/elf, const R_390_PC16 R_390
|
||||
pkg debug/elf, const R_390_PC16DBL = 17
|
||||
pkg debug/elf, const R_390_PC16DBL R_390
|
||||
pkg debug/elf, const R_390_PC32 = 5
|
||||
pkg debug/elf, const R_390_PC32 R_390
|
||||
pkg debug/elf, const R_390_PC32DBL = 19
|
||||
pkg debug/elf, const R_390_PC32DBL R_390
|
||||
pkg debug/elf, const R_390_PC64 = 23
|
||||
pkg debug/elf, const R_390_PC64 R_390
|
||||
pkg debug/elf, const R_390_PLT16DBL = 18
|
||||
pkg debug/elf, const R_390_PLT16DBL R_390
|
||||
pkg debug/elf, const R_390_PLT32 = 8
|
||||
pkg debug/elf, const R_390_PLT32 R_390
|
||||
pkg debug/elf, const R_390_PLT32DBL = 20
|
||||
pkg debug/elf, const R_390_PLT32DBL R_390
|
||||
pkg debug/elf, const R_390_PLT64 = 25
|
||||
pkg debug/elf, const R_390_PLT64 R_390
|
||||
pkg debug/elf, const R_390_RELATIVE = 12
|
||||
pkg debug/elf, const R_390_RELATIVE R_390
|
||||
pkg debug/elf, const R_390_TLS_DTPMOD = 54
|
||||
pkg debug/elf, const R_390_TLS_DTPMOD R_390
|
||||
pkg debug/elf, const R_390_TLS_DTPOFF = 55
|
||||
pkg debug/elf, const R_390_TLS_DTPOFF R_390
|
||||
pkg debug/elf, const R_390_TLS_GD32 = 40
|
||||
pkg debug/elf, const R_390_TLS_GD32 R_390
|
||||
pkg debug/elf, const R_390_TLS_GD64 = 41
|
||||
pkg debug/elf, const R_390_TLS_GD64 R_390
|
||||
pkg debug/elf, const R_390_TLS_GDCALL = 38
|
||||
pkg debug/elf, const R_390_TLS_GDCALL R_390
|
||||
pkg debug/elf, const R_390_TLS_GOTIE12 = 42
|
||||
pkg debug/elf, const R_390_TLS_GOTIE12 R_390
|
||||
pkg debug/elf, const R_390_TLS_GOTIE20 = 60
|
||||
pkg debug/elf, const R_390_TLS_GOTIE20 R_390
|
||||
pkg debug/elf, const R_390_TLS_GOTIE32 = 43
|
||||
pkg debug/elf, const R_390_TLS_GOTIE32 R_390
|
||||
pkg debug/elf, const R_390_TLS_GOTIE64 = 44
|
||||
pkg debug/elf, const R_390_TLS_GOTIE64 R_390
|
||||
pkg debug/elf, const R_390_TLS_IE32 = 47
|
||||
pkg debug/elf, const R_390_TLS_IE32 R_390
|
||||
pkg debug/elf, const R_390_TLS_IE64 = 48
|
||||
pkg debug/elf, const R_390_TLS_IE64 R_390
|
||||
pkg debug/elf, const R_390_TLS_IEENT = 49
|
||||
pkg debug/elf, const R_390_TLS_IEENT R_390
|
||||
pkg debug/elf, const R_390_TLS_LDCALL = 39
|
||||
pkg debug/elf, const R_390_TLS_LDCALL R_390
|
||||
pkg debug/elf, const R_390_TLS_LDM32 = 45
|
||||
pkg debug/elf, const R_390_TLS_LDM32 R_390
|
||||
pkg debug/elf, const R_390_TLS_LDM64 = 46
|
||||
pkg debug/elf, const R_390_TLS_LDM64 R_390
|
||||
pkg debug/elf, const R_390_TLS_LDO32 = 52
|
||||
pkg debug/elf, const R_390_TLS_LDO32 R_390
|
||||
pkg debug/elf, const R_390_TLS_LDO64 = 53
|
||||
pkg debug/elf, const R_390_TLS_LDO64 R_390
|
||||
pkg debug/elf, const R_390_TLS_LE32 = 50
|
||||
pkg debug/elf, const R_390_TLS_LE32 R_390
|
||||
pkg debug/elf, const R_390_TLS_LE64 = 51
|
||||
pkg debug/elf, const R_390_TLS_LE64 R_390
|
||||
pkg debug/elf, const R_390_TLS_LOAD = 37
|
||||
pkg debug/elf, const R_390_TLS_LOAD R_390
|
||||
pkg debug/elf, const R_390_TLS_TPOFF = 56
|
||||
pkg debug/elf, const R_390_TLS_TPOFF R_390
|
||||
pkg debug/elf, method (R_390) GoString() string
|
||||
pkg debug/elf, method (R_390) String() string
|
||||
pkg debug/elf, type R_390 int
|
||||
pkg encoding/json, method (*Encoder) SetEscapeHTML(bool)
|
||||
pkg encoding/json, method (*Encoder) SetIndent(string, string)
|
||||
pkg go/build, type Package struct, BinaryOnly bool
|
||||
pkg go/build, type Package struct, CgoFFLAGS []string
|
||||
pkg go/build, type Package struct, FFiles []string
|
||||
pkg go/doc, type Example struct, Unordered bool
|
||||
pkg io, const SeekCurrent = 1
|
||||
pkg io, const SeekCurrent ideal-int
|
||||
pkg io, const SeekEnd = 2
|
||||
pkg io, const SeekEnd ideal-int
|
||||
pkg io, const SeekStart = 0
|
||||
pkg io, const SeekStart ideal-int
|
||||
pkg math/big, method (*Float) GobDecode([]uint8) error
|
||||
pkg math/big, method (*Float) GobEncode() ([]uint8, error)
|
||||
pkg net, method (*Dialer) DialContext(context.Context, string, string) (Conn, error)
|
||||
pkg net/http, const StatusAlreadyReported = 208
|
||||
pkg net/http, const StatusAlreadyReported ideal-int
|
||||
pkg net/http, const StatusFailedDependency = 424
|
||||
pkg net/http, const StatusFailedDependency ideal-int
|
||||
pkg net/http, const StatusIMUsed = 226
|
||||
pkg net/http, const StatusIMUsed ideal-int
|
||||
pkg net/http, const StatusInsufficientStorage = 507
|
||||
pkg net/http, const StatusInsufficientStorage ideal-int
|
||||
pkg net/http, const StatusLocked = 423
|
||||
pkg net/http, const StatusLocked ideal-int
|
||||
pkg net/http, const StatusLoopDetected = 508
|
||||
pkg net/http, const StatusLoopDetected ideal-int
|
||||
pkg net/http, const StatusMultiStatus = 207
|
||||
pkg net/http, const StatusMultiStatus ideal-int
|
||||
pkg net/http, const StatusNotExtended = 510
|
||||
pkg net/http, const StatusNotExtended ideal-int
|
||||
pkg net/http, const StatusPermanentRedirect = 308
|
||||
pkg net/http, const StatusPermanentRedirect ideal-int
|
||||
pkg net/http, const StatusProcessing = 102
|
||||
pkg net/http, const StatusProcessing ideal-int
|
||||
pkg net/http, const StatusUnprocessableEntity = 422
|
||||
pkg net/http, const StatusUnprocessableEntity ideal-int
|
||||
pkg net/http, const StatusUpgradeRequired = 426
|
||||
pkg net/http, const StatusUpgradeRequired ideal-int
|
||||
pkg net/http, const StatusVariantAlsoNegotiates = 506
|
||||
pkg net/http, const StatusVariantAlsoNegotiates ideal-int
|
||||
pkg net/http, method (*Request) Context() context.Context
|
||||
pkg net/http, method (*Request) WithContext(context.Context) *Request
|
||||
pkg net/http, type Request struct, Response *Response
|
||||
pkg net/http, type Response struct, Uncompressed bool
|
||||
pkg net/http, type Transport struct, DialContext func(context.Context, string, string) (net.Conn, error)
|
||||
pkg net/http, type Transport struct, IdleConnTimeout time.Duration
|
||||
pkg net/http, type Transport struct, MaxIdleConns int
|
||||
pkg net/http, type Transport struct, MaxResponseHeaderBytes int64
|
||||
pkg net/http, var ErrUseLastResponse error
|
||||
pkg net/http, var LocalAddrContextKey *contextKey
|
||||
pkg net/http, var ServerContextKey *contextKey
|
||||
pkg net/http/cgi, type Handler struct, Stderr io.Writer
|
||||
pkg net/http/httptest, func NewRequest(string, string, io.Reader) *http.Request
|
||||
pkg net/http/httptest, method (*ResponseRecorder) Result() *http.Response
|
||||
pkg net/http/httptrace, func ContextClientTrace(context.Context) *ClientTrace
|
||||
pkg net/http/httptrace, func WithClientTrace(context.Context, *ClientTrace) context.Context
|
||||
pkg net/http/httptrace, type ClientTrace struct
|
||||
pkg net/http/httptrace, type ClientTrace struct, ConnectDone func(string, string, error)
|
||||
pkg net/http/httptrace, type ClientTrace struct, ConnectStart func(string, string)
|
||||
pkg net/http/httptrace, type ClientTrace struct, DNSDone func(DNSDoneInfo)
|
||||
pkg net/http/httptrace, type ClientTrace struct, DNSStart func(DNSStartInfo)
|
||||
pkg net/http/httptrace, type ClientTrace struct, GetConn func(string)
|
||||
pkg net/http/httptrace, type ClientTrace struct, Got100Continue func()
|
||||
pkg net/http/httptrace, type ClientTrace struct, GotConn func(GotConnInfo)
|
||||
pkg net/http/httptrace, type ClientTrace struct, GotFirstResponseByte func()
|
||||
pkg net/http/httptrace, type ClientTrace struct, PutIdleConn func(error)
|
||||
pkg net/http/httptrace, type ClientTrace struct, Wait100Continue func()
|
||||
pkg net/http/httptrace, type ClientTrace struct, WroteHeaders func()
|
||||
pkg net/http/httptrace, type ClientTrace struct, WroteRequest func(WroteRequestInfo)
|
||||
pkg net/http/httptrace, type DNSDoneInfo struct
|
||||
pkg net/http/httptrace, type DNSDoneInfo struct, Addrs []net.IPAddr
|
||||
pkg net/http/httptrace, type DNSDoneInfo struct, Coalesced bool
|
||||
pkg net/http/httptrace, type DNSDoneInfo struct, Err error
|
||||
pkg net/http/httptrace, type DNSStartInfo struct
|
||||
pkg net/http/httptrace, type DNSStartInfo struct, Host string
|
||||
pkg net/http/httptrace, type GotConnInfo struct
|
||||
pkg net/http/httptrace, type GotConnInfo struct, Conn net.Conn
|
||||
pkg net/http/httptrace, type GotConnInfo struct, IdleTime time.Duration
|
||||
pkg net/http/httptrace, type GotConnInfo struct, Reused bool
|
||||
pkg net/http/httptrace, type GotConnInfo struct, WasIdle bool
|
||||
pkg net/http/httptrace, type WroteRequestInfo struct
|
||||
pkg net/http/httptrace, type WroteRequestInfo struct, Err error
|
||||
pkg net/url, type URL struct, ForceQuery bool
|
||||
pkg os/exec, func CommandContext(context.Context, string, ...string) *Cmd
|
||||
pkg os/user, func LookupGroup(string) (*Group, error)
|
||||
pkg os/user, func LookupGroupId(string) (*Group, error)
|
||||
pkg os/user, method (*User) GroupIds() ([]string, error)
|
||||
pkg os/user, method (UnknownGroupError) Error() string
|
||||
pkg os/user, method (UnknownGroupIdError) Error() string
|
||||
pkg os/user, type Group struct
|
||||
pkg os/user, type Group struct, Gid string
|
||||
pkg os/user, type Group struct, Name string
|
||||
pkg os/user, type UnknownGroupError string
|
||||
pkg os/user, type UnknownGroupIdError string
|
||||
pkg reflect, func StructOf([]StructField) Type
|
||||
pkg reflect, method (StructTag) Lookup(string) (string, bool)
|
||||
pkg runtime, func CallersFrames([]uintptr) *Frames
|
||||
pkg runtime, func KeepAlive(interface{})
|
||||
pkg runtime, func SetCgoTraceback(int, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer)
|
||||
pkg runtime, method (*Frames) Next() (Frame, bool)
|
||||
pkg runtime, type Frame struct
|
||||
pkg runtime, type Frame struct, Entry uintptr
|
||||
pkg runtime, type Frame struct, File string
|
||||
pkg runtime, type Frame struct, Func *Func
|
||||
pkg runtime, type Frame struct, Function string
|
||||
pkg runtime, type Frame struct, Line int
|
||||
pkg runtime, type Frame struct, PC uintptr
|
||||
pkg runtime, type Frames struct
|
||||
pkg strings, method (*Reader) Reset(string)
|
||||
pkg syscall (linux-386), type SysProcAttr struct, Unshareflags uintptr
|
||||
pkg syscall (linux-386-cgo), type SysProcAttr struct, Unshareflags uintptr
|
||||
pkg syscall (linux-amd64), type SysProcAttr struct, Unshareflags uintptr
|
||||
pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Unshareflags uintptr
|
||||
pkg syscall (linux-arm), type SysProcAttr struct, Unshareflags uintptr
|
||||
pkg syscall (linux-arm-cgo), type SysProcAttr struct, Unshareflags uintptr
|
||||
pkg testing, method (*B) Run(string, func(*B)) bool
|
||||
pkg testing, method (*T) Run(string, func(*T)) bool
|
||||
pkg testing, type InternalExample struct, Unordered bool
|
||||
pkg unicode, const Version = "9.0.0"
|
||||
pkg unicode, var Adlam *RangeTable
|
||||
pkg unicode, var Bhaiksuki *RangeTable
|
||||
pkg unicode, var Marchen *RangeTable
|
||||
pkg unicode, var Newa *RangeTable
|
||||
pkg unicode, var Osage *RangeTable
|
||||
pkg unicode, var Prepended_Concatenation_Mark *RangeTable
|
||||
pkg unicode, var Sentence_Terminal *RangeTable
|
||||
pkg unicode, var Tangut *RangeTable
|
||||
261
api/go1.8.txt
@@ -1,261 +0,0 @@
|
||||
pkg compress/gzip, const HuffmanOnly = -2
|
||||
pkg compress/gzip, const HuffmanOnly ideal-int
|
||||
pkg compress/zlib, const HuffmanOnly = -2
|
||||
pkg compress/zlib, const HuffmanOnly ideal-int
|
||||
pkg crypto/tls, const ECDSAWithP256AndSHA256 = 1027
|
||||
pkg crypto/tls, const ECDSAWithP256AndSHA256 SignatureScheme
|
||||
pkg crypto/tls, const ECDSAWithP384AndSHA384 = 1283
|
||||
pkg crypto/tls, const ECDSAWithP384AndSHA384 SignatureScheme
|
||||
pkg crypto/tls, const ECDSAWithP521AndSHA512 = 1539
|
||||
pkg crypto/tls, const ECDSAWithP521AndSHA512 SignatureScheme
|
||||
pkg crypto/tls, const PKCS1WithSHA1 = 513
|
||||
pkg crypto/tls, const PKCS1WithSHA1 SignatureScheme
|
||||
pkg crypto/tls, const PKCS1WithSHA256 = 1025
|
||||
pkg crypto/tls, const PKCS1WithSHA256 SignatureScheme
|
||||
pkg crypto/tls, const PKCS1WithSHA384 = 1281
|
||||
pkg crypto/tls, const PKCS1WithSHA384 SignatureScheme
|
||||
pkg crypto/tls, const PKCS1WithSHA512 = 1537
|
||||
pkg crypto/tls, const PKCS1WithSHA512 SignatureScheme
|
||||
pkg crypto/tls, const PSSWithSHA256 = 2052
|
||||
pkg crypto/tls, const PSSWithSHA256 SignatureScheme
|
||||
pkg crypto/tls, const PSSWithSHA384 = 2053
|
||||
pkg crypto/tls, const PSSWithSHA384 SignatureScheme
|
||||
pkg crypto/tls, const PSSWithSHA512 = 2054
|
||||
pkg crypto/tls, const PSSWithSHA512 SignatureScheme
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 49187
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 uint16
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 = 52393
|
||||
pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 uint16
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 49191
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 uint16
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 = 52392
|
||||
pkg crypto/tls, const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 uint16
|
||||
pkg crypto/tls, const TLS_RSA_WITH_AES_128_CBC_SHA256 = 60
|
||||
pkg crypto/tls, const TLS_RSA_WITH_AES_128_CBC_SHA256 uint16
|
||||
pkg crypto/tls, const X25519 = 29
|
||||
pkg crypto/tls, const X25519 CurveID
|
||||
pkg crypto/tls, method (*Config) Clone() *Config
|
||||
pkg crypto/tls, method (*Conn) CloseWrite() error
|
||||
pkg crypto/tls, type CertificateRequestInfo struct
|
||||
pkg crypto/tls, type CertificateRequestInfo struct, AcceptableCAs [][]uint8
|
||||
pkg crypto/tls, type CertificateRequestInfo struct, SignatureSchemes []SignatureScheme
|
||||
pkg crypto/tls, type ClientHelloInfo struct, Conn net.Conn
|
||||
pkg crypto/tls, type ClientHelloInfo struct, SignatureSchemes []SignatureScheme
|
||||
pkg crypto/tls, type ClientHelloInfo struct, SupportedProtos []string
|
||||
pkg crypto/tls, type ClientHelloInfo struct, SupportedVersions []uint16
|
||||
pkg crypto/tls, type Config struct, GetClientCertificate func(*CertificateRequestInfo) (*Certificate, error)
|
||||
pkg crypto/tls, type Config struct, GetConfigForClient func(*ClientHelloInfo) (*Config, error)
|
||||
pkg crypto/tls, type Config struct, KeyLogWriter io.Writer
|
||||
pkg crypto/tls, type Config struct, VerifyPeerCertificate func([][]uint8, [][]*x509.Certificate) error
|
||||
pkg crypto/tls, type SignatureScheme uint16
|
||||
pkg crypto/x509, const NameMismatch = 5
|
||||
pkg crypto/x509, const NameMismatch InvalidReason
|
||||
pkg crypto/x509, const SHA256WithRSAPSS = 13
|
||||
pkg crypto/x509, const SHA256WithRSAPSS SignatureAlgorithm
|
||||
pkg crypto/x509, const SHA384WithRSAPSS = 14
|
||||
pkg crypto/x509, const SHA384WithRSAPSS SignatureAlgorithm
|
||||
pkg crypto/x509, const SHA512WithRSAPSS = 15
|
||||
pkg crypto/x509, const SHA512WithRSAPSS SignatureAlgorithm
|
||||
pkg crypto/x509, type UnknownAuthorityError struct, Cert *Certificate
|
||||
pkg database/sql, const LevelDefault = 0
|
||||
pkg database/sql, const LevelDefault IsolationLevel
|
||||
pkg database/sql, const LevelLinearizable = 7
|
||||
pkg database/sql, const LevelLinearizable IsolationLevel
|
||||
pkg database/sql, const LevelReadCommitted = 2
|
||||
pkg database/sql, const LevelReadCommitted IsolationLevel
|
||||
pkg database/sql, const LevelReadUncommitted = 1
|
||||
pkg database/sql, const LevelReadUncommitted IsolationLevel
|
||||
pkg database/sql, const LevelRepeatableRead = 4
|
||||
pkg database/sql, const LevelRepeatableRead IsolationLevel
|
||||
pkg database/sql, const LevelSerializable = 6
|
||||
pkg database/sql, const LevelSerializable IsolationLevel
|
||||
pkg database/sql, const LevelSnapshot = 5
|
||||
pkg database/sql, const LevelSnapshot IsolationLevel
|
||||
pkg database/sql, const LevelWriteCommitted = 3
|
||||
pkg database/sql, const LevelWriteCommitted IsolationLevel
|
||||
pkg database/sql/driver, type ConnBeginTx interface { BeginTx }
|
||||
pkg database/sql/driver, type ConnBeginTx interface, BeginTx(context.Context, TxOptions) (Tx, error)
|
||||
pkg database/sql/driver, type ConnPrepareContext interface { PrepareContext }
|
||||
pkg database/sql/driver, type ConnPrepareContext interface, PrepareContext(context.Context, string) (Stmt, error)
|
||||
pkg database/sql/driver, type ExecerContext interface { ExecContext }
|
||||
pkg database/sql/driver, type ExecerContext interface, ExecContext(context.Context, string, []NamedValue) (Result, error)
|
||||
pkg database/sql/driver, type IsolationLevel int
|
||||
pkg database/sql/driver, type NamedValue struct
|
||||
pkg database/sql/driver, type NamedValue struct, Name string
|
||||
pkg database/sql/driver, type NamedValue struct, Ordinal int
|
||||
pkg database/sql/driver, type NamedValue struct, Value Value
|
||||
pkg database/sql/driver, type Pinger interface { Ping }
|
||||
pkg database/sql/driver, type Pinger interface, Ping(context.Context) error
|
||||
pkg database/sql/driver, type QueryerContext interface { QueryContext }
|
||||
pkg database/sql/driver, type QueryerContext interface, QueryContext(context.Context, string, []NamedValue) (Rows, error)
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface { Close, ColumnTypeDatabaseTypeName, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface, ColumnTypeDatabaseTypeName(int) string
|
||||
pkg database/sql/driver, type RowsColumnTypeDatabaseTypeName interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface { Close, ColumnTypeLength, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface, ColumnTypeLength(int) (int64, bool)
|
||||
pkg database/sql/driver, type RowsColumnTypeLength interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface { Close, ColumnTypeNullable, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface, ColumnTypeNullable(int) (bool, bool)
|
||||
pkg database/sql/driver, type RowsColumnTypeNullable interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface { Close, ColumnTypePrecisionScale, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface, ColumnTypePrecisionScale(int) (int64, int64, bool)
|
||||
pkg database/sql/driver, type RowsColumnTypePrecisionScale interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface { Close, ColumnTypeScanType, Columns, Next }
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface, Close() error
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface, ColumnTypeScanType(int) reflect.Type
|
||||
pkg database/sql/driver, type RowsColumnTypeScanType interface, Next([]Value) error
|
||||
pkg database/sql/driver, type RowsNextResultSet interface { Close, Columns, HasNextResultSet, Next, NextResultSet }
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, Close() error
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, Columns() []string
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, HasNextResultSet() bool
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, NextResultSet() error
|
||||
pkg database/sql/driver, type RowsNextResultSet interface, Next([]Value) error
|
||||
pkg database/sql/driver, type StmtExecContext interface { ExecContext }
|
||||
pkg database/sql/driver, type StmtExecContext interface, ExecContext(context.Context, []NamedValue) (Result, error)
|
||||
pkg database/sql/driver, type StmtQueryContext interface { QueryContext }
|
||||
pkg database/sql/driver, type StmtQueryContext interface, QueryContext(context.Context, []NamedValue) (Rows, error)
|
||||
pkg database/sql/driver, type TxOptions struct
|
||||
pkg database/sql/driver, type TxOptions struct, Isolation IsolationLevel
|
||||
pkg database/sql/driver, type TxOptions struct, ReadOnly bool
|
||||
pkg database/sql, func Named(string, interface{}) NamedArg
|
||||
pkg database/sql, method (*ColumnType) DatabaseTypeName() string
|
||||
pkg database/sql, method (*ColumnType) DecimalSize() (int64, int64, bool)
|
||||
pkg database/sql, method (*ColumnType) Length() (int64, bool)
|
||||
pkg database/sql, method (*ColumnType) Name() string
|
||||
pkg database/sql, method (*ColumnType) Nullable() (bool, bool)
|
||||
pkg database/sql, method (*ColumnType) ScanType() reflect.Type
|
||||
pkg database/sql, method (*DB) BeginTx(context.Context, *TxOptions) (*Tx, error)
|
||||
pkg database/sql, method (*DB) ExecContext(context.Context, string, ...interface{}) (Result, error)
|
||||
pkg database/sql, method (*DB) PingContext(context.Context) error
|
||||
pkg database/sql, method (*DB) PrepareContext(context.Context, string) (*Stmt, error)
|
||||
pkg database/sql, method (*DB) QueryContext(context.Context, string, ...interface{}) (*Rows, error)
|
||||
pkg database/sql, method (*DB) QueryRowContext(context.Context, string, ...interface{}) *Row
|
||||
pkg database/sql, method (*Rows) ColumnTypes() ([]*ColumnType, error)
|
||||
pkg database/sql, method (*Rows) NextResultSet() bool
|
||||
pkg database/sql, method (*Stmt) ExecContext(context.Context, ...interface{}) (Result, error)
|
||||
pkg database/sql, method (*Stmt) QueryContext(context.Context, ...interface{}) (*Rows, error)
|
||||
pkg database/sql, method (*Stmt) QueryRowContext(context.Context, ...interface{}) *Row
|
||||
pkg database/sql, method (*Tx) ExecContext(context.Context, string, ...interface{}) (Result, error)
|
||||
pkg database/sql, method (*Tx) PrepareContext(context.Context, string) (*Stmt, error)
|
||||
pkg database/sql, method (*Tx) QueryContext(context.Context, string, ...interface{}) (*Rows, error)
|
||||
pkg database/sql, method (*Tx) QueryRowContext(context.Context, string, ...interface{}) *Row
|
||||
pkg database/sql, method (*Tx) StmtContext(context.Context, *Stmt) *Stmt
|
||||
pkg database/sql, type ColumnType struct
|
||||
pkg database/sql, type IsolationLevel int
|
||||
pkg database/sql, type NamedArg struct
|
||||
pkg database/sql, type NamedArg struct, Name string
|
||||
pkg database/sql, type NamedArg struct, Value interface{}
|
||||
pkg database/sql, type TxOptions struct
|
||||
pkg database/sql, type TxOptions struct, Isolation IsolationLevel
|
||||
pkg database/sql, type TxOptions struct, ReadOnly bool
|
||||
pkg debug/pe, method (*COFFSymbol) FullName(StringTable) (string, error)
|
||||
pkg debug/pe, method (StringTable) String(uint32) (string, error)
|
||||
pkg debug/pe, type File struct, COFFSymbols []COFFSymbol
|
||||
pkg debug/pe, type File struct, StringTable StringTable
|
||||
pkg debug/pe, type Reloc struct
|
||||
pkg debug/pe, type Reloc struct, SymbolTableIndex uint32
|
||||
pkg debug/pe, type Reloc struct, Type uint16
|
||||
pkg debug/pe, type Reloc struct, VirtualAddress uint32
|
||||
pkg debug/pe, type Section struct, Relocs []Reloc
|
||||
pkg debug/pe, type StringTable []uint8
|
||||
pkg encoding/base64, method (Encoding) Strict() *Encoding
|
||||
pkg encoding/json, method (RawMessage) MarshalJSON() ([]uint8, error)
|
||||
pkg encoding/json, type UnmarshalTypeError struct, Field string
|
||||
pkg encoding/json, type UnmarshalTypeError struct, Struct string
|
||||
pkg expvar, func Handler() http.Handler
|
||||
pkg expvar, method (*Float) Value() float64
|
||||
pkg expvar, method (Func) Value() interface{}
|
||||
pkg expvar, method (*Int) Value() int64
|
||||
pkg expvar, method (*String) Value() string
|
||||
pkg go/doc, func IsPredeclared(string) bool
|
||||
pkg go/types, func Default(Type) Type
|
||||
pkg go/types, func IdenticalIgnoreTags(Type, Type) bool
|
||||
pkg math/big, method (*Float) Scan(fmt.ScanState, int32) error
|
||||
pkg math/big, method (*Int) Sqrt(*Int) *Int
|
||||
pkg math/rand, func Uint64() uint64
|
||||
pkg math/rand, method (*Rand) Uint64() uint64
|
||||
pkg math/rand, type Source64 interface, Int63() int64
|
||||
pkg math/rand, type Source64 interface { Int63, Seed, Uint64 }
|
||||
pkg math/rand, type Source64 interface, Seed(int64)
|
||||
pkg math/rand, type Source64 interface, Uint64() uint64
|
||||
pkg net/http, const TrailerPrefix ideal-string
|
||||
pkg net/http, const TrailerPrefix = "Trailer:"
|
||||
pkg net/http/httptrace, type ClientTrace struct, TLSHandshakeDone func(tls.ConnectionState, error)
|
||||
pkg net/http/httptrace, type ClientTrace struct, TLSHandshakeStart func()
|
||||
pkg net/http/httputil, type ReverseProxy struct, ModifyResponse func(*http.Response) error
|
||||
pkg net/http, method (*Server) Close() error
|
||||
pkg net/http, method (*Server) Shutdown(context.Context) error
|
||||
pkg net/http, type Pusher interface { Push }
|
||||
pkg net/http, type Pusher interface, Push(string, *PushOptions) error
|
||||
pkg net/http, type PushOptions struct
|
||||
pkg net/http, type PushOptions struct, Header Header
|
||||
pkg net/http, type PushOptions struct, Method string
|
||||
pkg net/http, type Request struct, GetBody func() (io.ReadCloser, error)
|
||||
pkg net/http, type Server struct, IdleTimeout time.Duration
|
||||
pkg net/http, type Server struct, ReadHeaderTimeout time.Duration
|
||||
pkg net/http, type Transport struct, ProxyConnectHeader Header
|
||||
pkg net/http, var ErrAbortHandler error
|
||||
pkg net/http, var ErrServerClosed error
|
||||
pkg net/http, var NoBody noBody
|
||||
pkg net/mail, func ParseDate(string) (time.Time, error)
|
||||
pkg net, method (*Buffers) Read([]uint8) (int, error)
|
||||
pkg net, method (*Buffers) WriteTo(io.Writer) (int64, error)
|
||||
pkg net, method (*Resolver) LookupAddr(context.Context, string) ([]string, error)
|
||||
pkg net, method (*Resolver) LookupCNAME(context.Context, string) (string, error)
|
||||
pkg net, method (*Resolver) LookupHost(context.Context, string) ([]string, error)
|
||||
pkg net, method (*Resolver) LookupIPAddr(context.Context, string) ([]IPAddr, error)
|
||||
pkg net, method (*Resolver) LookupMX(context.Context, string) ([]*MX, error)
|
||||
pkg net, method (*Resolver) LookupNS(context.Context, string) ([]*NS, error)
|
||||
pkg net, method (*Resolver) LookupPort(context.Context, string, string) (int, error)
|
||||
pkg net, method (*Resolver) LookupSRV(context.Context, string, string, string) (string, []*SRV, error)
|
||||
pkg net, method (*Resolver) LookupTXT(context.Context, string) ([]string, error)
|
||||
pkg net, method (*UnixListener) SetUnlinkOnClose(bool)
|
||||
pkg net, type Buffers [][]uint8
|
||||
pkg net, type Dialer struct, Resolver *Resolver
|
||||
pkg net, type Resolver struct
|
||||
pkg net, type Resolver struct, PreferGo bool
|
||||
pkg net/url, func PathEscape(string) string
|
||||
pkg net/url, func PathUnescape(string) (string, error)
|
||||
pkg net/url, method (*URL) Hostname() string
|
||||
pkg net/url, method (*URL) MarshalBinary() ([]uint8, error)
|
||||
pkg net/url, method (*URL) Port() string
|
||||
pkg net/url, method (*URL) UnmarshalBinary([]uint8) error
|
||||
pkg net, var DefaultResolver *Resolver
|
||||
pkg os, func Executable() (string, error)
|
||||
pkg os, var ErrClosed error
|
||||
pkg plugin, func Open(string) (*Plugin, error)
|
||||
pkg plugin, method (*Plugin) Lookup(string) (Symbol, error)
|
||||
pkg plugin, type Plugin struct
|
||||
pkg plugin, type Symbol interface {}
|
||||
pkg reflect, func Swapper(interface{}) func(int, int)
|
||||
pkg runtime, func MutexProfile([]BlockProfileRecord) (int, bool)
|
||||
pkg runtime, func SetMutexProfileFraction(int) int
|
||||
pkg runtime, type MemStats struct, NumForcedGC uint32
|
||||
pkg sort, func Slice(interface{}, func(int, int) bool)
|
||||
pkg sort, func SliceIsSorted(interface{}, func(int, int) bool) bool
|
||||
pkg sort, func SliceStable(interface{}, func(int, int) bool)
|
||||
pkg syscall (linux-arm-cgo), func TimevalToNsec(Timeval) int64
|
||||
pkg syscall (linux-arm), func TimevalToNsec(Timeval) int64
|
||||
pkg syscall (openbsd-386), const SYS_KILL = 122
|
||||
pkg syscall (openbsd-386-cgo), const SYS_KILL = 122
|
||||
pkg syscall (openbsd-amd64), const SYS_KILL = 122
|
||||
pkg syscall (openbsd-amd64-cgo), const SYS_KILL = 122
|
||||
pkg syscall (windows-386), const ERROR_DIR_NOT_EMPTY = 145
|
||||
pkg syscall (windows-386), const ERROR_DIR_NOT_EMPTY Errno
|
||||
pkg syscall (windows-amd64), const ERROR_DIR_NOT_EMPTY = 145
|
||||
pkg syscall (windows-amd64), const ERROR_DIR_NOT_EMPTY Errno
|
||||
pkg testing, func CoverMode() string
|
||||
pkg testing, func MainStart(testDeps, []InternalTest, []InternalBenchmark, []InternalExample) *M
|
||||
pkg testing, method (*B) Name() string
|
||||
pkg testing, method (*T) Name() string
|
||||
pkg testing, type TB interface, Name() string
|
||||
pkg time, func Until(Time) Duration
|
||||
169
api/go1.9.txt
@@ -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
|
||||
143
api/go1.txt
@@ -391,18 +391,6 @@ pkg crypto/dsa, var ErrInvalidPublicKey error
|
||||
pkg crypto/ecdsa, func GenerateKey(elliptic.Curve, io.Reader) (*PrivateKey, error)
|
||||
pkg crypto/ecdsa, func Sign(io.Reader, *PrivateKey, []uint8) (*big.Int, *big.Int, error)
|
||||
pkg crypto/ecdsa, func Verify(*PublicKey, []uint8, *big.Int, *big.Int) bool
|
||||
pkg crypto/ecdsa, method (PrivateKey) Add(*big.Int, *big.Int, *big.Int, *big.Int) (*big.Int, *big.Int)
|
||||
pkg crypto/ecdsa, method (PrivateKey) Double(*big.Int, *big.Int) (*big.Int, *big.Int)
|
||||
pkg crypto/ecdsa, method (PrivateKey) IsOnCurve(*big.Int, *big.Int) bool
|
||||
pkg crypto/ecdsa, method (PrivateKey) Params() *elliptic.CurveParams
|
||||
pkg crypto/ecdsa, method (PrivateKey) ScalarBaseMult([]uint8) (*big.Int, *big.Int)
|
||||
pkg crypto/ecdsa, method (PrivateKey) ScalarMult(*big.Int, *big.Int, []uint8) (*big.Int, *big.Int)
|
||||
pkg crypto/ecdsa, method (PublicKey) Add(*big.Int, *big.Int, *big.Int, *big.Int) (*big.Int, *big.Int)
|
||||
pkg crypto/ecdsa, method (PublicKey) Double(*big.Int, *big.Int) (*big.Int, *big.Int)
|
||||
pkg crypto/ecdsa, method (PublicKey) IsOnCurve(*big.Int, *big.Int) bool
|
||||
pkg crypto/ecdsa, method (PublicKey) Params() *elliptic.CurveParams
|
||||
pkg crypto/ecdsa, method (PublicKey) ScalarBaseMult([]uint8) (*big.Int, *big.Int)
|
||||
pkg crypto/ecdsa, method (PublicKey) ScalarMult(*big.Int, *big.Int, []uint8) (*big.Int, *big.Int)
|
||||
pkg crypto/ecdsa, type PrivateKey struct
|
||||
pkg crypto/ecdsa, type PrivateKey struct, D *big.Int
|
||||
pkg crypto/ecdsa, type PrivateKey struct, embedded PublicKey
|
||||
@@ -1626,7 +1614,6 @@ pkg debug/elf, method (NType) GoString() string
|
||||
pkg debug/elf, method (NType) String() string
|
||||
pkg debug/elf, method (OSABI) GoString() string
|
||||
pkg debug/elf, method (OSABI) String() string
|
||||
pkg debug/elf, method (Prog) ReadAt([]uint8, int64) (int, error)
|
||||
pkg debug/elf, method (ProgFlag) GoString() string
|
||||
pkg debug/elf, method (ProgFlag) String() string
|
||||
pkg debug/elf, method (ProgType) GoString() string
|
||||
@@ -1643,7 +1630,6 @@ pkg debug/elf, method (R_SPARC) GoString() string
|
||||
pkg debug/elf, method (R_SPARC) String() string
|
||||
pkg debug/elf, method (R_X86_64) GoString() string
|
||||
pkg debug/elf, method (R_X86_64) String() string
|
||||
pkg debug/elf, method (Section) ReadAt([]uint8, int64) (int, error)
|
||||
pkg debug/elf, method (SectionFlag) GoString() string
|
||||
pkg debug/elf, method (SectionFlag) String() string
|
||||
pkg debug/elf, method (SectionIndex) GoString() string
|
||||
@@ -1688,7 +1674,7 @@ pkg debug/elf, type Header32 struct
|
||||
pkg debug/elf, type Header32 struct, Ehsize uint16
|
||||
pkg debug/elf, type Header32 struct, Entry uint32
|
||||
pkg debug/elf, type Header32 struct, Flags uint32
|
||||
pkg debug/elf, type Header32 struct, Ident [16]uint8
|
||||
pkg debug/elf, type Header32 struct, Ident [EI_NIDENT]uint8
|
||||
pkg debug/elf, type Header32 struct, Machine uint16
|
||||
pkg debug/elf, type Header32 struct, Phentsize uint16
|
||||
pkg debug/elf, type Header32 struct, Phnum uint16
|
||||
@@ -1703,7 +1689,7 @@ pkg debug/elf, type Header64 struct
|
||||
pkg debug/elf, type Header64 struct, Ehsize uint16
|
||||
pkg debug/elf, type Header64 struct, Entry uint64
|
||||
pkg debug/elf, type Header64 struct, Flags uint32
|
||||
pkg debug/elf, type Header64 struct, Ident [16]uint8
|
||||
pkg debug/elf, type Header64 struct, Ident [EI_NIDENT]uint8
|
||||
pkg debug/elf, type Header64 struct, Machine uint16
|
||||
pkg debug/elf, type Header64 struct, Phentsize uint16
|
||||
pkg debug/elf, type Header64 struct, Phnum uint16
|
||||
@@ -1925,9 +1911,7 @@ pkg debug/macho, method (Dysymtab) Raw() []uint8
|
||||
pkg debug/macho, method (LoadBytes) Raw() []uint8
|
||||
pkg debug/macho, method (LoadCmd) GoString() string
|
||||
pkg debug/macho, method (LoadCmd) String() string
|
||||
pkg debug/macho, method (Section) ReadAt([]uint8, int64) (int, error)
|
||||
pkg debug/macho, method (Segment) Raw() []uint8
|
||||
pkg debug/macho, method (Segment) ReadAt([]uint8, int64) (int, error)
|
||||
pkg debug/macho, method (Symtab) Raw() []uint8
|
||||
pkg debug/macho, type Cpu uint32
|
||||
pkg debug/macho, type Dylib struct
|
||||
@@ -2170,7 +2154,6 @@ pkg debug/pe, method (*File) Section(string) *Section
|
||||
pkg debug/pe, method (*FormatError) Error() string
|
||||
pkg debug/pe, method (*Section) Data() ([]uint8, error)
|
||||
pkg debug/pe, method (*Section) Open() io.ReadSeeker
|
||||
pkg debug/pe, method (Section) ReadAt([]uint8, int64) (int, error)
|
||||
pkg debug/pe, type File struct
|
||||
pkg debug/pe, type File struct, Sections []*Section
|
||||
pkg debug/pe, type File struct, embedded FileHeader
|
||||
@@ -3676,7 +3659,7 @@ pkg image/draw, func Draw(Image, image.Rectangle, image.Image, image.Point, Op)
|
||||
pkg image/draw, func DrawMask(Image, image.Rectangle, image.Image, image.Point, image.Image, image.Point, Op)
|
||||
pkg image/draw, type Image interface { At, Bounds, ColorModel, Set }
|
||||
pkg image/draw, type Image interface, At(int, int) color.Color
|
||||
pkg image/draw, type Image interface, Bounds() image.Rectangle
|
||||
pkg image/draw, type Image interface, Bounds() Rectangle
|
||||
pkg image/draw, type Image interface, ColorModel() color.Model
|
||||
pkg image/draw, type Image interface, Set(int, int, color.Color)
|
||||
pkg image/draw, type Op int
|
||||
@@ -4181,7 +4164,7 @@ pkg math, func Trunc(float64) float64
|
||||
pkg math, func Y0(float64) float64
|
||||
pkg math, func Y1(float64) float64
|
||||
pkg math, func Yn(int, float64) float64
|
||||
pkg math/big, const MaxBase ideal-char
|
||||
pkg math/big, const MaxBase ideal-int
|
||||
pkg math/big, func NewInt(int64) *Int
|
||||
pkg math/big, func NewRat(int64, int64) *Rat
|
||||
pkg math/big, method (*Int) Abs(*Int) *Int
|
||||
@@ -5283,14 +5266,6 @@ pkg os/exec, method (*Cmd) StdoutPipe() (io.ReadCloser, error)
|
||||
pkg os/exec, method (*Cmd) Wait() error
|
||||
pkg os/exec, method (*Error) Error() string
|
||||
pkg os/exec, method (*ExitError) Error() string
|
||||
pkg os/exec, method (ExitError) Exited() bool
|
||||
pkg os/exec, method (ExitError) Pid() int
|
||||
pkg os/exec, method (ExitError) String() string
|
||||
pkg os/exec, method (ExitError) Success() bool
|
||||
pkg os/exec, method (ExitError) Sys() interface{}
|
||||
pkg os/exec, method (ExitError) SysUsage() interface{}
|
||||
pkg os/exec, method (ExitError) SystemTime() time.Duration
|
||||
pkg os/exec, method (ExitError) UserTime() time.Duration
|
||||
pkg os/exec, type Cmd struct
|
||||
pkg os/exec, type Cmd struct, Args []string
|
||||
pkg os/exec, type Cmd struct, Dir string
|
||||
@@ -5712,7 +5687,6 @@ pkg runtime, type MemProfileRecord struct, Stack0 [32]uintptr
|
||||
pkg runtime, type MemStats struct
|
||||
pkg runtime, type MemStats struct, Alloc uint64
|
||||
pkg runtime, type MemStats struct, BuckHashSys uint64
|
||||
pkg runtime, type MemStats struct, BySize [61]struct
|
||||
pkg runtime, type MemStats struct, DebugGC bool
|
||||
pkg runtime, type MemStats struct, EnableGC bool
|
||||
pkg runtime, type MemStats struct, Frees uint64
|
||||
@@ -6061,7 +6035,6 @@ pkg syscall (darwin-386), const EAUTH Errno
|
||||
pkg syscall (darwin-386), const EBADARCH Errno
|
||||
pkg syscall (darwin-386), const EBADEXEC Errno
|
||||
pkg syscall (darwin-386), const EBADMACHO Errno
|
||||
pkg syscall (darwin-386), const EBADMSG Errno
|
||||
pkg syscall (darwin-386), const EBADRPC Errno
|
||||
pkg syscall (darwin-386), const ECHO ideal-int
|
||||
pkg syscall (darwin-386), const ECHOCTL ideal-int
|
||||
@@ -6073,11 +6046,9 @@ pkg syscall (darwin-386), const ECHOPRT ideal-int
|
||||
pkg syscall (darwin-386), const EDEVERR Errno
|
||||
pkg syscall (darwin-386), const EFTYPE Errno
|
||||
pkg syscall (darwin-386), const ELAST Errno
|
||||
pkg syscall (darwin-386), const EMULTIHOP Errno
|
||||
pkg syscall (darwin-386), const ENEEDAUTH Errno
|
||||
pkg syscall (darwin-386), const ENOATTR Errno
|
||||
pkg syscall (darwin-386), const ENODATA Errno
|
||||
pkg syscall (darwin-386), const ENOLINK Errno
|
||||
pkg syscall (darwin-386), const ENOPOLICY Errno
|
||||
pkg syscall (darwin-386), const ENOSR Errno
|
||||
pkg syscall (darwin-386), const ENOSTR Errno
|
||||
@@ -6087,7 +6058,6 @@ pkg syscall (darwin-386), const EPROCLIM Errno
|
||||
pkg syscall (darwin-386), const EPROCUNAVAIL Errno
|
||||
pkg syscall (darwin-386), const EPROGMISMATCH Errno
|
||||
pkg syscall (darwin-386), const EPROGUNAVAIL Errno
|
||||
pkg syscall (darwin-386), const EPROTO Errno
|
||||
pkg syscall (darwin-386), const EPWROFF Errno
|
||||
pkg syscall (darwin-386), const ERPCMISMATCH Errno
|
||||
pkg syscall (darwin-386), const ESHLIBVERS Errno
|
||||
@@ -7883,7 +7853,6 @@ pkg syscall (darwin-386-cgo), const EAUTH Errno
|
||||
pkg syscall (darwin-386-cgo), const EBADARCH Errno
|
||||
pkg syscall (darwin-386-cgo), const EBADEXEC Errno
|
||||
pkg syscall (darwin-386-cgo), const EBADMACHO Errno
|
||||
pkg syscall (darwin-386-cgo), const EBADMSG Errno
|
||||
pkg syscall (darwin-386-cgo), const EBADRPC Errno
|
||||
pkg syscall (darwin-386-cgo), const ECHO ideal-int
|
||||
pkg syscall (darwin-386-cgo), const ECHOCTL ideal-int
|
||||
@@ -7895,11 +7864,9 @@ pkg syscall (darwin-386-cgo), const ECHOPRT ideal-int
|
||||
pkg syscall (darwin-386-cgo), const EDEVERR Errno
|
||||
pkg syscall (darwin-386-cgo), const EFTYPE Errno
|
||||
pkg syscall (darwin-386-cgo), const ELAST Errno
|
||||
pkg syscall (darwin-386-cgo), const EMULTIHOP Errno
|
||||
pkg syscall (darwin-386-cgo), const ENEEDAUTH Errno
|
||||
pkg syscall (darwin-386-cgo), const ENOATTR Errno
|
||||
pkg syscall (darwin-386-cgo), const ENODATA Errno
|
||||
pkg syscall (darwin-386-cgo), const ENOLINK Errno
|
||||
pkg syscall (darwin-386-cgo), const ENOPOLICY Errno
|
||||
pkg syscall (darwin-386-cgo), const ENOSR Errno
|
||||
pkg syscall (darwin-386-cgo), const ENOSTR Errno
|
||||
@@ -7909,7 +7876,6 @@ pkg syscall (darwin-386-cgo), const EPROCLIM Errno
|
||||
pkg syscall (darwin-386-cgo), const EPROCUNAVAIL Errno
|
||||
pkg syscall (darwin-386-cgo), const EPROGMISMATCH Errno
|
||||
pkg syscall (darwin-386-cgo), const EPROGUNAVAIL Errno
|
||||
pkg syscall (darwin-386-cgo), const EPROTO Errno
|
||||
pkg syscall (darwin-386-cgo), const EPWROFF Errno
|
||||
pkg syscall (darwin-386-cgo), const ERPCMISMATCH Errno
|
||||
pkg syscall (darwin-386-cgo), const ESHLIBVERS Errno
|
||||
@@ -9705,7 +9671,6 @@ pkg syscall (darwin-amd64), const EAUTH Errno
|
||||
pkg syscall (darwin-amd64), const EBADARCH Errno
|
||||
pkg syscall (darwin-amd64), const EBADEXEC Errno
|
||||
pkg syscall (darwin-amd64), const EBADMACHO Errno
|
||||
pkg syscall (darwin-amd64), const EBADMSG Errno
|
||||
pkg syscall (darwin-amd64), const EBADRPC Errno
|
||||
pkg syscall (darwin-amd64), const ECHO ideal-int
|
||||
pkg syscall (darwin-amd64), const ECHOCTL ideal-int
|
||||
@@ -9717,11 +9682,9 @@ pkg syscall (darwin-amd64), const ECHOPRT ideal-int
|
||||
pkg syscall (darwin-amd64), const EDEVERR Errno
|
||||
pkg syscall (darwin-amd64), const EFTYPE Errno
|
||||
pkg syscall (darwin-amd64), const ELAST Errno
|
||||
pkg syscall (darwin-amd64), const EMULTIHOP Errno
|
||||
pkg syscall (darwin-amd64), const ENEEDAUTH Errno
|
||||
pkg syscall (darwin-amd64), const ENOATTR Errno
|
||||
pkg syscall (darwin-amd64), const ENODATA Errno
|
||||
pkg syscall (darwin-amd64), const ENOLINK Errno
|
||||
pkg syscall (darwin-amd64), const ENOPOLICY Errno
|
||||
pkg syscall (darwin-amd64), const ENOSR Errno
|
||||
pkg syscall (darwin-amd64), const ENOSTR Errno
|
||||
@@ -9731,7 +9694,6 @@ pkg syscall (darwin-amd64), const EPROCLIM Errno
|
||||
pkg syscall (darwin-amd64), const EPROCUNAVAIL Errno
|
||||
pkg syscall (darwin-amd64), const EPROGMISMATCH Errno
|
||||
pkg syscall (darwin-amd64), const EPROGUNAVAIL Errno
|
||||
pkg syscall (darwin-amd64), const EPROTO Errno
|
||||
pkg syscall (darwin-amd64), const EPWROFF Errno
|
||||
pkg syscall (darwin-amd64), const ERPCMISMATCH Errno
|
||||
pkg syscall (darwin-amd64), const ESHLIBVERS Errno
|
||||
@@ -11534,7 +11496,6 @@ pkg syscall (darwin-amd64-cgo), const EAUTH Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EBADARCH Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EBADEXEC Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EBADMACHO Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EBADMSG Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EBADRPC Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ECHO ideal-int
|
||||
pkg syscall (darwin-amd64-cgo), const ECHOCTL ideal-int
|
||||
@@ -11546,11 +11507,9 @@ pkg syscall (darwin-amd64-cgo), const ECHOPRT ideal-int
|
||||
pkg syscall (darwin-amd64-cgo), const EDEVERR Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EFTYPE Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ELAST Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EMULTIHOP Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ENEEDAUTH Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ENOATTR Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ENODATA Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ENOLINK Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ENOPOLICY Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ENOSR Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ENOSTR Errno
|
||||
@@ -11560,7 +11519,6 @@ pkg syscall (darwin-amd64-cgo), const EPROCLIM Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EPROCUNAVAIL Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EPROGMISMATCH Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EPROGUNAVAIL Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EPROTO Errno
|
||||
pkg syscall (darwin-amd64-cgo), const EPWROFF Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ERPCMISMATCH Errno
|
||||
pkg syscall (darwin-amd64-cgo), const ESHLIBVERS Errno
|
||||
@@ -13525,7 +13483,6 @@ pkg syscall (freebsd-386), const DT_SOCK ideal-int
|
||||
pkg syscall (freebsd-386), const DT_UNKNOWN ideal-int
|
||||
pkg syscall (freebsd-386), const DT_WHT ideal-int
|
||||
pkg syscall (freebsd-386), const EAUTH Errno
|
||||
pkg syscall (freebsd-386), const EBADMSG Errno
|
||||
pkg syscall (freebsd-386), const EBADRPC Errno
|
||||
pkg syscall (freebsd-386), const ECHO ideal-int
|
||||
pkg syscall (freebsd-386), const ECHOCTL ideal-int
|
||||
@@ -13537,16 +13494,13 @@ pkg syscall (freebsd-386), const ECHOPRT ideal-int
|
||||
pkg syscall (freebsd-386), const EDOOFUS Errno
|
||||
pkg syscall (freebsd-386), const EFTYPE Errno
|
||||
pkg syscall (freebsd-386), const ELAST Errno
|
||||
pkg syscall (freebsd-386), const EMULTIHOP Errno
|
||||
pkg syscall (freebsd-386), const ENEEDAUTH Errno
|
||||
pkg syscall (freebsd-386), const ENOATTR Errno
|
||||
pkg syscall (freebsd-386), const ENOLINK Errno
|
||||
pkg syscall (freebsd-386), const ENOTCAPABLE Errno
|
||||
pkg syscall (freebsd-386), const EPROCLIM Errno
|
||||
pkg syscall (freebsd-386), const EPROCUNAVAIL Errno
|
||||
pkg syscall (freebsd-386), const EPROGMISMATCH Errno
|
||||
pkg syscall (freebsd-386), const EPROGUNAVAIL Errno
|
||||
pkg syscall (freebsd-386), const EPROTO Errno
|
||||
pkg syscall (freebsd-386), const ERPCMISMATCH Errno
|
||||
pkg syscall (freebsd-386), const EVFILT_AIO ideal-int
|
||||
pkg syscall (freebsd-386), const EVFILT_FS ideal-int
|
||||
@@ -15501,7 +15455,6 @@ pkg syscall (freebsd-amd64), const DT_SOCK ideal-int
|
||||
pkg syscall (freebsd-amd64), const DT_UNKNOWN ideal-int
|
||||
pkg syscall (freebsd-amd64), const DT_WHT ideal-int
|
||||
pkg syscall (freebsd-amd64), const EAUTH Errno
|
||||
pkg syscall (freebsd-amd64), const EBADMSG Errno
|
||||
pkg syscall (freebsd-amd64), const EBADRPC Errno
|
||||
pkg syscall (freebsd-amd64), const ECHO ideal-int
|
||||
pkg syscall (freebsd-amd64), const ECHOCTL ideal-int
|
||||
@@ -15513,16 +15466,13 @@ pkg syscall (freebsd-amd64), const ECHOPRT ideal-int
|
||||
pkg syscall (freebsd-amd64), const EDOOFUS Errno
|
||||
pkg syscall (freebsd-amd64), const EFTYPE Errno
|
||||
pkg syscall (freebsd-amd64), const ELAST Errno
|
||||
pkg syscall (freebsd-amd64), const EMULTIHOP Errno
|
||||
pkg syscall (freebsd-amd64), const ENEEDAUTH Errno
|
||||
pkg syscall (freebsd-amd64), const ENOATTR Errno
|
||||
pkg syscall (freebsd-amd64), const ENOLINK Errno
|
||||
pkg syscall (freebsd-amd64), const ENOTCAPABLE Errno
|
||||
pkg syscall (freebsd-amd64), const EPROCLIM Errno
|
||||
pkg syscall (freebsd-amd64), const EPROCUNAVAIL Errno
|
||||
pkg syscall (freebsd-amd64), const EPROGMISMATCH Errno
|
||||
pkg syscall (freebsd-amd64), const EPROGUNAVAIL Errno
|
||||
pkg syscall (freebsd-amd64), const EPROTO Errno
|
||||
pkg syscall (freebsd-amd64), const ERPCMISMATCH Errno
|
||||
pkg syscall (freebsd-amd64), const EVFILT_AIO ideal-int
|
||||
pkg syscall (freebsd-amd64), const EVFILT_FS ideal-int
|
||||
@@ -17365,7 +17315,6 @@ pkg syscall (linux-386), const DT_WHT ideal-int
|
||||
pkg syscall (linux-386), const EADV Errno
|
||||
pkg syscall (linux-386), const EBADE Errno
|
||||
pkg syscall (linux-386), const EBADFD Errno
|
||||
pkg syscall (linux-386), const EBADMSG Errno
|
||||
pkg syscall (linux-386), const EBADR Errno
|
||||
pkg syscall (linux-386), const EBADRQC Errno
|
||||
pkg syscall (linux-386), const EBADSLT Errno
|
||||
@@ -17396,13 +17345,11 @@ pkg syscall (linux-386), const ELIBMAX Errno
|
||||
pkg syscall (linux-386), const ELIBSCN Errno
|
||||
pkg syscall (linux-386), const ELNRNG Errno
|
||||
pkg syscall (linux-386), const EMEDIUMTYPE Errno
|
||||
pkg syscall (linux-386), const EMULTIHOP Errno
|
||||
pkg syscall (linux-386), const ENAVAIL Errno
|
||||
pkg syscall (linux-386), const ENOANO Errno
|
||||
pkg syscall (linux-386), const ENOCSI Errno
|
||||
pkg syscall (linux-386), const ENODATA Errno
|
||||
pkg syscall (linux-386), const ENOKEY Errno
|
||||
pkg syscall (linux-386), const ENOLINK Errno
|
||||
pkg syscall (linux-386), const ENOMEDIUM Errno
|
||||
pkg syscall (linux-386), const ENONET Errno
|
||||
pkg syscall (linux-386), const ENOPKG Errno
|
||||
@@ -17430,7 +17377,6 @@ pkg syscall (linux-386), const EPOLL_CTL_ADD ideal-int
|
||||
pkg syscall (linux-386), const EPOLL_CTL_DEL ideal-int
|
||||
pkg syscall (linux-386), const EPOLL_CTL_MOD ideal-int
|
||||
pkg syscall (linux-386), const EPOLL_NONBLOCK ideal-int
|
||||
pkg syscall (linux-386), const EPROTO Errno
|
||||
pkg syscall (linux-386), const EREMCHG Errno
|
||||
pkg syscall (linux-386), const EREMOTEIO Errno
|
||||
pkg syscall (linux-386), const ERESTART Errno
|
||||
@@ -19554,7 +19500,6 @@ pkg syscall (linux-386-cgo), const DT_WHT ideal-int
|
||||
pkg syscall (linux-386-cgo), const EADV Errno
|
||||
pkg syscall (linux-386-cgo), const EBADE Errno
|
||||
pkg syscall (linux-386-cgo), const EBADFD Errno
|
||||
pkg syscall (linux-386-cgo), const EBADMSG Errno
|
||||
pkg syscall (linux-386-cgo), const EBADR Errno
|
||||
pkg syscall (linux-386-cgo), const EBADRQC Errno
|
||||
pkg syscall (linux-386-cgo), const EBADSLT Errno
|
||||
@@ -19585,13 +19530,11 @@ pkg syscall (linux-386-cgo), const ELIBMAX Errno
|
||||
pkg syscall (linux-386-cgo), const ELIBSCN Errno
|
||||
pkg syscall (linux-386-cgo), const ELNRNG Errno
|
||||
pkg syscall (linux-386-cgo), const EMEDIUMTYPE Errno
|
||||
pkg syscall (linux-386-cgo), const EMULTIHOP Errno
|
||||
pkg syscall (linux-386-cgo), const ENAVAIL Errno
|
||||
pkg syscall (linux-386-cgo), const ENOANO Errno
|
||||
pkg syscall (linux-386-cgo), const ENOCSI Errno
|
||||
pkg syscall (linux-386-cgo), const ENODATA Errno
|
||||
pkg syscall (linux-386-cgo), const ENOKEY Errno
|
||||
pkg syscall (linux-386-cgo), const ENOLINK Errno
|
||||
pkg syscall (linux-386-cgo), const ENOMEDIUM Errno
|
||||
pkg syscall (linux-386-cgo), const ENONET Errno
|
||||
pkg syscall (linux-386-cgo), const ENOPKG Errno
|
||||
@@ -19619,7 +19562,6 @@ pkg syscall (linux-386-cgo), const EPOLL_CTL_ADD ideal-int
|
||||
pkg syscall (linux-386-cgo), const EPOLL_CTL_DEL ideal-int
|
||||
pkg syscall (linux-386-cgo), const EPOLL_CTL_MOD ideal-int
|
||||
pkg syscall (linux-386-cgo), const EPOLL_NONBLOCK ideal-int
|
||||
pkg syscall (linux-386-cgo), const EPROTO Errno
|
||||
pkg syscall (linux-386-cgo), const EREMCHG Errno
|
||||
pkg syscall (linux-386-cgo), const EREMOTEIO Errno
|
||||
pkg syscall (linux-386-cgo), const ERESTART Errno
|
||||
@@ -21743,7 +21685,6 @@ pkg syscall (linux-amd64), const DT_WHT ideal-int
|
||||
pkg syscall (linux-amd64), const EADV Errno
|
||||
pkg syscall (linux-amd64), const EBADE Errno
|
||||
pkg syscall (linux-amd64), const EBADFD Errno
|
||||
pkg syscall (linux-amd64), const EBADMSG Errno
|
||||
pkg syscall (linux-amd64), const EBADR Errno
|
||||
pkg syscall (linux-amd64), const EBADRQC Errno
|
||||
pkg syscall (linux-amd64), const EBADSLT Errno
|
||||
@@ -21774,13 +21715,11 @@ pkg syscall (linux-amd64), const ELIBMAX Errno
|
||||
pkg syscall (linux-amd64), const ELIBSCN Errno
|
||||
pkg syscall (linux-amd64), const ELNRNG Errno
|
||||
pkg syscall (linux-amd64), const EMEDIUMTYPE Errno
|
||||
pkg syscall (linux-amd64), const EMULTIHOP Errno
|
||||
pkg syscall (linux-amd64), const ENAVAIL Errno
|
||||
pkg syscall (linux-amd64), const ENOANO Errno
|
||||
pkg syscall (linux-amd64), const ENOCSI Errno
|
||||
pkg syscall (linux-amd64), const ENODATA Errno
|
||||
pkg syscall (linux-amd64), const ENOKEY Errno
|
||||
pkg syscall (linux-amd64), const ENOLINK Errno
|
||||
pkg syscall (linux-amd64), const ENOMEDIUM Errno
|
||||
pkg syscall (linux-amd64), const ENONET Errno
|
||||
pkg syscall (linux-amd64), const ENOPKG Errno
|
||||
@@ -21808,7 +21747,6 @@ pkg syscall (linux-amd64), const EPOLL_CTL_ADD ideal-int
|
||||
pkg syscall (linux-amd64), const EPOLL_CTL_DEL ideal-int
|
||||
pkg syscall (linux-amd64), const EPOLL_CTL_MOD ideal-int
|
||||
pkg syscall (linux-amd64), const EPOLL_NONBLOCK ideal-int
|
||||
pkg syscall (linux-amd64), const EPROTO Errno
|
||||
pkg syscall (linux-amd64), const EREMCHG Errno
|
||||
pkg syscall (linux-amd64), const EREMOTEIO Errno
|
||||
pkg syscall (linux-amd64), const ERESTART Errno
|
||||
@@ -23914,7 +23852,6 @@ pkg syscall (linux-amd64-cgo), const DT_WHT ideal-int
|
||||
pkg syscall (linux-amd64-cgo), const EADV Errno
|
||||
pkg syscall (linux-amd64-cgo), const EBADE Errno
|
||||
pkg syscall (linux-amd64-cgo), const EBADFD Errno
|
||||
pkg syscall (linux-amd64-cgo), const EBADMSG Errno
|
||||
pkg syscall (linux-amd64-cgo), const EBADR Errno
|
||||
pkg syscall (linux-amd64-cgo), const EBADRQC Errno
|
||||
pkg syscall (linux-amd64-cgo), const EBADSLT Errno
|
||||
@@ -23945,13 +23882,11 @@ pkg syscall (linux-amd64-cgo), const ELIBMAX Errno
|
||||
pkg syscall (linux-amd64-cgo), const ELIBSCN Errno
|
||||
pkg syscall (linux-amd64-cgo), const ELNRNG Errno
|
||||
pkg syscall (linux-amd64-cgo), const EMEDIUMTYPE Errno
|
||||
pkg syscall (linux-amd64-cgo), const EMULTIHOP Errno
|
||||
pkg syscall (linux-amd64-cgo), const ENAVAIL Errno
|
||||
pkg syscall (linux-amd64-cgo), const ENOANO Errno
|
||||
pkg syscall (linux-amd64-cgo), const ENOCSI Errno
|
||||
pkg syscall (linux-amd64-cgo), const ENODATA Errno
|
||||
pkg syscall (linux-amd64-cgo), const ENOKEY Errno
|
||||
pkg syscall (linux-amd64-cgo), const ENOLINK Errno
|
||||
pkg syscall (linux-amd64-cgo), const ENOMEDIUM Errno
|
||||
pkg syscall (linux-amd64-cgo), const ENONET Errno
|
||||
pkg syscall (linux-amd64-cgo), const ENOPKG Errno
|
||||
@@ -23979,7 +23914,6 @@ pkg syscall (linux-amd64-cgo), const EPOLL_CTL_ADD ideal-int
|
||||
pkg syscall (linux-amd64-cgo), const EPOLL_CTL_DEL ideal-int
|
||||
pkg syscall (linux-amd64-cgo), const EPOLL_CTL_MOD ideal-int
|
||||
pkg syscall (linux-amd64-cgo), const EPOLL_NONBLOCK ideal-int
|
||||
pkg syscall (linux-amd64-cgo), const EPROTO Errno
|
||||
pkg syscall (linux-amd64-cgo), const EREMCHG Errno
|
||||
pkg syscall (linux-amd64-cgo), const EREMOTEIO Errno
|
||||
pkg syscall (linux-amd64-cgo), const ERESTART Errno
|
||||
@@ -26085,7 +26019,6 @@ pkg syscall (linux-arm), const DT_WHT ideal-int
|
||||
pkg syscall (linux-arm), const EADV Errno
|
||||
pkg syscall (linux-arm), const EBADE Errno
|
||||
pkg syscall (linux-arm), const EBADFD Errno
|
||||
pkg syscall (linux-arm), const EBADMSG Errno
|
||||
pkg syscall (linux-arm), const EBADR Errno
|
||||
pkg syscall (linux-arm), const EBADRQC Errno
|
||||
pkg syscall (linux-arm), const EBADSLT Errno
|
||||
@@ -26119,13 +26052,11 @@ pkg syscall (linux-arm), const ELIBMAX Errno
|
||||
pkg syscall (linux-arm), const ELIBSCN Errno
|
||||
pkg syscall (linux-arm), const ELNRNG Errno
|
||||
pkg syscall (linux-arm), const EMEDIUMTYPE Errno
|
||||
pkg syscall (linux-arm), const EMULTIHOP Errno
|
||||
pkg syscall (linux-arm), const ENAVAIL Errno
|
||||
pkg syscall (linux-arm), const ENOANO Errno
|
||||
pkg syscall (linux-arm), const ENOCSI Errno
|
||||
pkg syscall (linux-arm), const ENODATA Errno
|
||||
pkg syscall (linux-arm), const ENOKEY Errno
|
||||
pkg syscall (linux-arm), const ENOLINK Errno
|
||||
pkg syscall (linux-arm), const ENOMEDIUM Errno
|
||||
pkg syscall (linux-arm), const ENONET Errno
|
||||
pkg syscall (linux-arm), const ENOPKG Errno
|
||||
@@ -26153,7 +26084,6 @@ pkg syscall (linux-arm), const EPOLL_CTL_ADD ideal-int
|
||||
pkg syscall (linux-arm), const EPOLL_CTL_DEL ideal-int
|
||||
pkg syscall (linux-arm), const EPOLL_CTL_MOD ideal-int
|
||||
pkg syscall (linux-arm), const EPOLL_NONBLOCK ideal-int
|
||||
pkg syscall (linux-arm), const EPROTO Errno
|
||||
pkg syscall (linux-arm), const EREMCHG Errno
|
||||
pkg syscall (linux-arm), const EREMOTEIO Errno
|
||||
pkg syscall (linux-arm), const ERESTART Errno
|
||||
@@ -28208,7 +28138,6 @@ pkg syscall (windows-386), const DUPLICATE_SAME_ACCESS ideal-int
|
||||
pkg syscall (windows-386), const EADV Errno
|
||||
pkg syscall (windows-386), const EBADE Errno
|
||||
pkg syscall (windows-386), const EBADFD Errno
|
||||
pkg syscall (windows-386), const EBADMSG Errno
|
||||
pkg syscall (windows-386), const EBADR Errno
|
||||
pkg syscall (windows-386), const EBADRQC Errno
|
||||
pkg syscall (windows-386), const EBADSLT Errno
|
||||
@@ -28232,13 +28161,11 @@ pkg syscall (windows-386), const ELIBMAX Errno
|
||||
pkg syscall (windows-386), const ELIBSCN Errno
|
||||
pkg syscall (windows-386), const ELNRNG Errno
|
||||
pkg syscall (windows-386), const EMEDIUMTYPE Errno
|
||||
pkg syscall (windows-386), const EMULTIHOP Errno
|
||||
pkg syscall (windows-386), const ENAVAIL Errno
|
||||
pkg syscall (windows-386), const ENOANO Errno
|
||||
pkg syscall (windows-386), const ENOCSI Errno
|
||||
pkg syscall (windows-386), const ENODATA Errno
|
||||
pkg syscall (windows-386), const ENOKEY Errno
|
||||
pkg syscall (windows-386), const ENOLINK Errno
|
||||
pkg syscall (windows-386), const ENOMEDIUM Errno
|
||||
pkg syscall (windows-386), const ENONET Errno
|
||||
pkg syscall (windows-386), const ENOPKG Errno
|
||||
@@ -28248,7 +28175,6 @@ pkg syscall (windows-386), const ENOTNAM Errno
|
||||
pkg syscall (windows-386), const ENOTRECOVERABLE Errno
|
||||
pkg syscall (windows-386), const ENOTUNIQ Errno
|
||||
pkg syscall (windows-386), const EOWNERDEAD Errno
|
||||
pkg syscall (windows-386), const EPROTO Errno
|
||||
pkg syscall (windows-386), const EREMCHG Errno
|
||||
pkg syscall (windows-386), const EREMOTEIO Errno
|
||||
pkg syscall (windows-386), const ERESTART Errno
|
||||
@@ -28829,12 +28755,12 @@ pkg syscall (windows-386), type InterfaceInfo struct, BroadcastAddress SockaddrG
|
||||
pkg syscall (windows-386), type InterfaceInfo struct, Flags uint32
|
||||
pkg syscall (windows-386), type InterfaceInfo struct, Netmask SockaddrGen
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, AdapterName [260]uint8
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, Address [8]uint8
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, AdapterName [MAX_ADAPTER_NAME_LENGTH + 4]uint8
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, Address [MAX_ADAPTER_ADDRESS_LENGTH]uint8
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, AddressLength uint32
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, ComboIndex uint32
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, CurrentIpAddress *IpAddrString
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, Description [132]uint8
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, Description [MAX_ADAPTER_DESCRIPTION_LENGTH + 4]uint8
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, DhcpEnabled uint32
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, DhcpServer IpAddrString
|
||||
pkg syscall (windows-386), type IpAdapterInfo struct, GatewayList IpAddrString
|
||||
@@ -28854,14 +28780,14 @@ pkg syscall (windows-386), type IpAddrString struct, IpMask IpMaskString
|
||||
pkg syscall (windows-386), type IpAddrString struct, Next *IpAddrString
|
||||
pkg syscall (windows-386), type IpAddressString struct
|
||||
pkg syscall (windows-386), type IpAddressString struct, String [16]uint8
|
||||
pkg syscall (windows-386), type IpMaskString struct
|
||||
pkg syscall (windows-386), type IpMaskString IpAddressString
|
||||
pkg syscall (windows-386), type LazyDLL struct
|
||||
pkg syscall (windows-386), type LazyDLL struct, Name string
|
||||
pkg syscall (windows-386), type LazyProc struct
|
||||
pkg syscall (windows-386), type LazyProc struct, Name string
|
||||
pkg syscall (windows-386), type MibIfRow struct
|
||||
pkg syscall (windows-386), type MibIfRow struct, AdminStatus uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, Descr [256]uint8
|
||||
pkg syscall (windows-386), type MibIfRow struct, Descr [MAXLEN_IFDESCR]uint8
|
||||
pkg syscall (windows-386), type MibIfRow struct, DescrLen uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, InDiscards uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, InErrors uint32
|
||||
@@ -28872,7 +28798,7 @@ pkg syscall (windows-386), type MibIfRow struct, InUnknownProtos uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, Index uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, LastChange uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, Mtu uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, Name [256]uint16
|
||||
pkg syscall (windows-386), type MibIfRow struct, Name [MAX_INTERFACE_NAME_LEN]uint16
|
||||
pkg syscall (windows-386), type MibIfRow struct, OperStatus uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, OutDiscards uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, OutErrors uint32
|
||||
@@ -28880,7 +28806,7 @@ pkg syscall (windows-386), type MibIfRow struct, OutNUcastPkts uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, OutOctets uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, OutQLen uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, OutUcastPkts uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, PhysAddr [8]uint8
|
||||
pkg syscall (windows-386), type MibIfRow struct, PhysAddr [MAXLEN_PHYSADDR]uint8
|
||||
pkg syscall (windows-386), type MibIfRow struct, PhysAddrLen uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, Speed uint32
|
||||
pkg syscall (windows-386), type MibIfRow struct, Type uint32
|
||||
@@ -28969,7 +28895,7 @@ pkg syscall (windows-386), type Timezoneinformation struct, DaylightName [32]uin
|
||||
pkg syscall (windows-386), type Timezoneinformation struct, StandardBias int32
|
||||
pkg syscall (windows-386), type Timezoneinformation struct, StandardDate Systemtime
|
||||
pkg syscall (windows-386), type Timezoneinformation struct, StandardName [32]uint16
|
||||
pkg syscall (windows-386), type Token uintptr
|
||||
pkg syscall (windows-386), type Token Handle
|
||||
pkg syscall (windows-386), type Tokenprimarygroup struct
|
||||
pkg syscall (windows-386), type Tokenprimarygroup struct, PrimaryGroup *SID
|
||||
pkg syscall (windows-386), type Tokenuser struct
|
||||
@@ -28988,11 +28914,11 @@ pkg syscall (windows-386), type WSABuf struct
|
||||
pkg syscall (windows-386), type WSABuf struct, Buf *uint8
|
||||
pkg syscall (windows-386), type WSABuf struct, Len uint32
|
||||
pkg syscall (windows-386), type WSAData struct
|
||||
pkg syscall (windows-386), type WSAData struct, Description [257]uint8
|
||||
pkg syscall (windows-386), type WSAData struct, Description [WSADESCRIPTION_LEN + 1]uint8
|
||||
pkg syscall (windows-386), type WSAData struct, HighVersion uint16
|
||||
pkg syscall (windows-386), type WSAData struct, MaxSockets uint16
|
||||
pkg syscall (windows-386), type WSAData struct, MaxUdpDg uint16
|
||||
pkg syscall (windows-386), type WSAData struct, SystemStatus [129]uint8
|
||||
pkg syscall (windows-386), type WSAData struct, SystemStatus [WSASYS_STATUS_LEN + 1]uint8
|
||||
pkg syscall (windows-386), type WSAData struct, VendorInfo *uint8
|
||||
pkg syscall (windows-386), type WSAData struct, Version uint16
|
||||
pkg syscall (windows-386), type WaitStatus struct
|
||||
@@ -29008,7 +28934,7 @@ pkg syscall (windows-386), type Win32finddata struct
|
||||
pkg syscall (windows-386), type Win32finddata struct, AlternateFileName [13]uint16
|
||||
pkg syscall (windows-386), type Win32finddata struct, CreationTime Filetime
|
||||
pkg syscall (windows-386), type Win32finddata struct, FileAttributes uint32
|
||||
pkg syscall (windows-386), type Win32finddata struct, FileName [259]uint16
|
||||
pkg syscall (windows-386), type Win32finddata struct, FileName [MAX_PATH - 1]uint16
|
||||
pkg syscall (windows-386), type Win32finddata struct, FileSizeHigh uint32
|
||||
pkg syscall (windows-386), type Win32finddata struct, FileSizeLow uint32
|
||||
pkg syscall (windows-386), type Win32finddata struct, LastAccessTime Filetime
|
||||
@@ -29137,7 +29063,6 @@ pkg syscall (windows-amd64), const DUPLICATE_SAME_ACCESS ideal-int
|
||||
pkg syscall (windows-amd64), const EADV Errno
|
||||
pkg syscall (windows-amd64), const EBADE Errno
|
||||
pkg syscall (windows-amd64), const EBADFD Errno
|
||||
pkg syscall (windows-amd64), const EBADMSG Errno
|
||||
pkg syscall (windows-amd64), const EBADR Errno
|
||||
pkg syscall (windows-amd64), const EBADRQC Errno
|
||||
pkg syscall (windows-amd64), const EBADSLT Errno
|
||||
@@ -29161,13 +29086,11 @@ pkg syscall (windows-amd64), const ELIBMAX Errno
|
||||
pkg syscall (windows-amd64), const ELIBSCN Errno
|
||||
pkg syscall (windows-amd64), const ELNRNG Errno
|
||||
pkg syscall (windows-amd64), const EMEDIUMTYPE Errno
|
||||
pkg syscall (windows-amd64), const EMULTIHOP Errno
|
||||
pkg syscall (windows-amd64), const ENAVAIL Errno
|
||||
pkg syscall (windows-amd64), const ENOANO Errno
|
||||
pkg syscall (windows-amd64), const ENOCSI Errno
|
||||
pkg syscall (windows-amd64), const ENODATA Errno
|
||||
pkg syscall (windows-amd64), const ENOKEY Errno
|
||||
pkg syscall (windows-amd64), const ENOLINK Errno
|
||||
pkg syscall (windows-amd64), const ENOMEDIUM Errno
|
||||
pkg syscall (windows-amd64), const ENONET Errno
|
||||
pkg syscall (windows-amd64), const ENOPKG Errno
|
||||
@@ -29177,7 +29100,6 @@ pkg syscall (windows-amd64), const ENOTNAM Errno
|
||||
pkg syscall (windows-amd64), const ENOTRECOVERABLE Errno
|
||||
pkg syscall (windows-amd64), const ENOTUNIQ Errno
|
||||
pkg syscall (windows-amd64), const EOWNERDEAD Errno
|
||||
pkg syscall (windows-amd64), const EPROTO Errno
|
||||
pkg syscall (windows-amd64), const EREMCHG Errno
|
||||
pkg syscall (windows-amd64), const EREMOTEIO Errno
|
||||
pkg syscall (windows-amd64), const ERESTART Errno
|
||||
@@ -29758,12 +29680,12 @@ pkg syscall (windows-amd64), type InterfaceInfo struct, BroadcastAddress Sockadd
|
||||
pkg syscall (windows-amd64), type InterfaceInfo struct, Flags uint32
|
||||
pkg syscall (windows-amd64), type InterfaceInfo struct, Netmask SockaddrGen
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, AdapterName [260]uint8
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, Address [8]uint8
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, AdapterName [MAX_ADAPTER_NAME_LENGTH + 4]uint8
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, Address [MAX_ADAPTER_ADDRESS_LENGTH]uint8
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, AddressLength uint32
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, ComboIndex uint32
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, CurrentIpAddress *IpAddrString
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, Description [132]uint8
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, Description [MAX_ADAPTER_DESCRIPTION_LENGTH + 4]uint8
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, DhcpEnabled uint32
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, DhcpServer IpAddrString
|
||||
pkg syscall (windows-amd64), type IpAdapterInfo struct, GatewayList IpAddrString
|
||||
@@ -29783,14 +29705,14 @@ pkg syscall (windows-amd64), type IpAddrString struct, IpMask IpMaskString
|
||||
pkg syscall (windows-amd64), type IpAddrString struct, Next *IpAddrString
|
||||
pkg syscall (windows-amd64), type IpAddressString struct
|
||||
pkg syscall (windows-amd64), type IpAddressString struct, String [16]uint8
|
||||
pkg syscall (windows-amd64), type IpMaskString struct
|
||||
pkg syscall (windows-amd64), type IpMaskString IpAddressString
|
||||
pkg syscall (windows-amd64), type LazyDLL struct
|
||||
pkg syscall (windows-amd64), type LazyDLL struct, Name string
|
||||
pkg syscall (windows-amd64), type LazyProc struct
|
||||
pkg syscall (windows-amd64), type LazyProc struct, Name string
|
||||
pkg syscall (windows-amd64), type MibIfRow struct
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, AdminStatus uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, Descr [256]uint8
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, Descr [MAXLEN_IFDESCR]uint8
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, DescrLen uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, InDiscards uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, InErrors uint32
|
||||
@@ -29801,7 +29723,7 @@ pkg syscall (windows-amd64), type MibIfRow struct, InUnknownProtos uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, Index uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, LastChange uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, Mtu uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, Name [256]uint16
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, Name [MAX_INTERFACE_NAME_LEN]uint16
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, OperStatus uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, OutDiscards uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, OutErrors uint32
|
||||
@@ -29809,7 +29731,7 @@ pkg syscall (windows-amd64), type MibIfRow struct, OutNUcastPkts uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, OutOctets uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, OutQLen uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, OutUcastPkts uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, PhysAddr [8]uint8
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, PhysAddr [MAXLEN_PHYSADDR]uint8
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, PhysAddrLen uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, Speed uint32
|
||||
pkg syscall (windows-amd64), type MibIfRow struct, Type uint32
|
||||
@@ -29898,7 +29820,7 @@ pkg syscall (windows-amd64), type Timezoneinformation struct, DaylightName [32]u
|
||||
pkg syscall (windows-amd64), type Timezoneinformation struct, StandardBias int32
|
||||
pkg syscall (windows-amd64), type Timezoneinformation struct, StandardDate Systemtime
|
||||
pkg syscall (windows-amd64), type Timezoneinformation struct, StandardName [32]uint16
|
||||
pkg syscall (windows-amd64), type Token uintptr
|
||||
pkg syscall (windows-amd64), type Token Handle
|
||||
pkg syscall (windows-amd64), type Tokenprimarygroup struct
|
||||
pkg syscall (windows-amd64), type Tokenprimarygroup struct, PrimaryGroup *SID
|
||||
pkg syscall (windows-amd64), type Tokenuser struct
|
||||
@@ -29917,11 +29839,11 @@ pkg syscall (windows-amd64), type WSABuf struct
|
||||
pkg syscall (windows-amd64), type WSABuf struct, Buf *uint8
|
||||
pkg syscall (windows-amd64), type WSABuf struct, Len uint32
|
||||
pkg syscall (windows-amd64), type WSAData struct
|
||||
pkg syscall (windows-amd64), type WSAData struct, Description [257]uint8
|
||||
pkg syscall (windows-amd64), type WSAData struct, Description [WSADESCRIPTION_LEN + 1]uint8
|
||||
pkg syscall (windows-amd64), type WSAData struct, HighVersion uint16
|
||||
pkg syscall (windows-amd64), type WSAData struct, MaxSockets uint16
|
||||
pkg syscall (windows-amd64), type WSAData struct, MaxUdpDg uint16
|
||||
pkg syscall (windows-amd64), type WSAData struct, SystemStatus [129]uint8
|
||||
pkg syscall (windows-amd64), type WSAData struct, SystemStatus [WSASYS_STATUS_LEN + 1]uint8
|
||||
pkg syscall (windows-amd64), type WSAData struct, VendorInfo *uint8
|
||||
pkg syscall (windows-amd64), type WSAData struct, Version uint16
|
||||
pkg syscall (windows-amd64), type WaitStatus struct
|
||||
@@ -29937,7 +29859,7 @@ pkg syscall (windows-amd64), type Win32finddata struct
|
||||
pkg syscall (windows-amd64), type Win32finddata struct, AlternateFileName [13]uint16
|
||||
pkg syscall (windows-amd64), type Win32finddata struct, CreationTime Filetime
|
||||
pkg syscall (windows-amd64), type Win32finddata struct, FileAttributes uint32
|
||||
pkg syscall (windows-amd64), type Win32finddata struct, FileName [259]uint16
|
||||
pkg syscall (windows-amd64), type Win32finddata struct, FileName [MAX_PATH - 1]uint16
|
||||
pkg syscall (windows-amd64), type Win32finddata struct, FileSizeHigh uint32
|
||||
pkg syscall (windows-amd64), type Win32finddata struct, FileSizeLow uint32
|
||||
pkg syscall (windows-amd64), type Win32finddata struct, LastAccessTime Filetime
|
||||
@@ -29962,6 +29884,7 @@ pkg syscall, const EAFNOSUPPORT Errno
|
||||
pkg syscall, const EAGAIN Errno
|
||||
pkg syscall, const EALREADY Errno
|
||||
pkg syscall, const EBADF Errno
|
||||
pkg syscall, const EBADMSG Errno
|
||||
pkg syscall, const EBUSY Errno
|
||||
pkg syscall, const ECANCELED Errno
|
||||
pkg syscall, const ECHILD Errno
|
||||
@@ -29989,6 +29912,7 @@ pkg syscall, const ELOOP Errno
|
||||
pkg syscall, const EMFILE Errno
|
||||
pkg syscall, const EMLINK Errno
|
||||
pkg syscall, const EMSGSIZE Errno
|
||||
pkg syscall, const EMULTIHOP Errno
|
||||
pkg syscall, const ENAMETOOLONG Errno
|
||||
pkg syscall, const ENETDOWN Errno
|
||||
pkg syscall, const ENETRESET Errno
|
||||
@@ -29999,6 +29923,7 @@ pkg syscall, const ENODEV Errno
|
||||
pkg syscall, const ENOENT Errno
|
||||
pkg syscall, const ENOEXEC Errno
|
||||
pkg syscall, const ENOLCK Errno
|
||||
pkg syscall, const ENOLINK Errno
|
||||
pkg syscall, const ENOMEM Errno
|
||||
pkg syscall, const ENOMSG Errno
|
||||
pkg syscall, const ENOPROTOOPT Errno
|
||||
@@ -30017,6 +29942,7 @@ pkg syscall, const EOVERFLOW Errno
|
||||
pkg syscall, const EPERM Errno
|
||||
pkg syscall, const EPFNOSUPPORT Errno
|
||||
pkg syscall, const EPIPE Errno
|
||||
pkg syscall, const EPROTO Errno
|
||||
pkg syscall, const EPROTONOSUPPORT Errno
|
||||
pkg syscall, const EPROTOTYPE Errno
|
||||
pkg syscall, const ERANGE Errno
|
||||
@@ -30055,7 +29981,7 @@ pkg syscall, const IP_MULTICAST_LOOP ideal-int
|
||||
pkg syscall, const IP_MULTICAST_TTL ideal-int
|
||||
pkg syscall, const IP_TOS ideal-int
|
||||
pkg syscall, const IP_TTL ideal-int
|
||||
pkg syscall, const ImplementsGetwd ideal-bool
|
||||
pkg syscall, const ImplementsGetwd bool
|
||||
pkg syscall, const O_APPEND ideal-int
|
||||
pkg syscall, const O_ASYNC ideal-int
|
||||
pkg syscall, const O_CLOEXEC ideal-int
|
||||
@@ -30622,7 +30548,7 @@ pkg unicode, const MaxRune ideal-char
|
||||
pkg unicode, const ReplacementChar ideal-char
|
||||
pkg unicode, const TitleCase ideal-int
|
||||
pkg unicode, const UpperCase ideal-int
|
||||
pkg unicode, const UpperLower ideal-char
|
||||
pkg unicode, const UpperLower ideal-int
|
||||
pkg unicode, const Version ideal-string
|
||||
pkg unicode, func Is(*RangeTable, int32) bool
|
||||
pkg unicode, func IsControl(int32) bool
|
||||
@@ -30869,3 +30795,8 @@ pkg unicode/utf8, func RuneLen(int32) int
|
||||
pkg unicode/utf8, func RuneStart(uint8) bool
|
||||
pkg unicode/utf8, func Valid([]uint8) bool
|
||||
pkg unicode/utf8, func ValidString(string) bool
|
||||
pkg unsafe, func Alignof(ArbitraryType) uintptr
|
||||
pkg unsafe, func Offsetof(ArbitraryType) uintptr
|
||||
pkg unsafe, func Sizeof(ArbitraryType) uintptr
|
||||
pkg unsafe, type ArbitraryType int
|
||||
pkg unsafe, type Pointer *ArbitraryType
|
||||
|
||||
32
doc/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
# Copyright 2009 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.
|
||||
|
||||
RAWHTML=\
|
||||
articles/defer_panic_recover.rawhtml\
|
||||
articles/error_handling.rawhtml\
|
||||
articles/slices_usage_and_internals.rawhtml\
|
||||
articles/laws_of_reflection.rawhtml\
|
||||
articles/c_go_cgo.rawhtml\
|
||||
articles/concurrency_patterns.rawhtml\
|
||||
articles/godoc_documenting_go_code.rawhtml\
|
||||
articles/gobs_of_data.rawhtml\
|
||||
articles/json_and_go.rawhtml\
|
||||
articles/json_rpc_tale_of_interfaces.rawhtml\
|
||||
articles/image_draw.rawhtml\
|
||||
articles/image_package.rawhtml\
|
||||
effective_go.rawhtml\
|
||||
go1.rawhtml\
|
||||
|
||||
all: $(RAWHTML)
|
||||
|
||||
%.rawhtml: %.html
|
||||
godoc -url /doc/$< >$@
|
||||
|
||||
clean:
|
||||
rm -f $(RAWHTML)
|
||||
|
||||
compare:
|
||||
for i in $(RAWHTML); do \
|
||||
godoc -url /doc/$${i/.rawhtml/.html} | diff -u $$i -; \
|
||||
done
|
||||
179
doc/articles/c_go_cgo.html
Normal file
@@ -0,0 +1,179 @@
|
||||
<!--{
|
||||
"Title": "C? Go? Cgo!",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
Cgo lets Go packages call C code. Given a Go source file written with some
|
||||
special features, cgo outputs Go and C files that can be combined into a
|
||||
single Go package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To lead with an example, here's a Go package that provides two functions -
|
||||
<code>Random</code> and <code>Seed</code> - that wrap C's <code>random</code>
|
||||
and <code>srandom</code> functions.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/cgo1.go" `/package rand/` `/END/`}}
|
||||
|
||||
<p>
|
||||
Let's look at what's happening here, starting with the import statement.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>rand</code> package imports <code>"C"</code>, but you'll find there's
|
||||
no such package in the standard Go library. That's because <code>C</code> is a
|
||||
"pseudo-package", a special name interpreted by cgo as a reference to C's
|
||||
name space.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>rand</code> package contains four references to the <code>C</code>
|
||||
package: the calls to <code>C.random</code> and <code>C.srandom</code>, the
|
||||
conversion <code>C.uint(i)</code>, and the <code>import</code> statement.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>Random</code> function calls the standard C library's <code>random</code>
|
||||
function and returns the result. In C, <code>random</code> returns a value of the
|
||||
C type <code>long</code>, which cgo represents as the type <code>C.long</code>.
|
||||
It must be converted to a Go type before it can be used by Go code outside this
|
||||
package, using an ordinary Go type conversion:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/cgo1.go" `/func Random/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Here's an equivalent function that uses a temporary variable to illustrate
|
||||
the type conversion more explicitly:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/cgo2.go" `/func Random/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The <code>Seed</code> function does the reverse, in a way. It takes a
|
||||
regular Go <code>int</code>, converts it to the C <code>unsigned int</code>
|
||||
type, and passes it to the C function <code>srandom</code>.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/cgo1.go" `/func Seed/` `/END/`}}
|
||||
|
||||
<p>
|
||||
Note that cgo knows the <code>unsigned int</code> type as <code>C.uint</code>;
|
||||
see the <a href="/cmd/cgo">cgo documentation</a> for a complete list of
|
||||
these numeric type names.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The one detail of this example we haven't examined yet is the comment
|
||||
above the <code>import</code> statement.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/cgo1.go" `/\/\*/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Cgo recognizes this comment. Any lines starting
|
||||
with <code>#cgo</code>
|
||||
followed
|
||||
by a space character are removed; these become directives for cgo.
|
||||
The remaining lines are used as a header when compiling the C parts of
|
||||
the package. In this case those lines are just a
|
||||
single <code>#include</code>
|
||||
statement, but they can be almost any C code. The <code>#cgo</code>
|
||||
directives are
|
||||
used to provide flags for the compiler and linker when building the C
|
||||
parts of the package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There is a limitation: if your program uses any <code>//export</code>
|
||||
directives, then the C code in the comment may only include declarations
|
||||
(<code>extern int f();</code>), not definitions (<code>int f() {
|
||||
return 1; }</code>). You can use <code>//export</code> directives to
|
||||
make Go functions accessible to C code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>#cgo</code> and <code>//export</code> directives are
|
||||
documented in
|
||||
the <a href="/cmd/cgo/">cgo documentation</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Strings and things</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Unlike Go, C doesn't have an explicit string type. Strings in C are
|
||||
represented by a zero-terminated array of chars.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Conversion between Go and C strings is done with the
|
||||
<code>C.CString</code>, <code>C.GoString</code>, and
|
||||
<code>C.GoStringN</code> functions. These conversions make a copy of the
|
||||
string data.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This next example implements a <code>Print</code> function that writes a
|
||||
string to standard output using C's <code>fputs</code> function from the
|
||||
<code>stdio</code> library:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/cgo3.go" `/package print/` `/END/`}}
|
||||
|
||||
<p>
|
||||
Memory allocations made by C code are not known to Go's memory manager.
|
||||
When you create a C string with <code>C.CString</code> (or any C memory
|
||||
allocation) you must remember to free the memory when you're done with it
|
||||
by calling <code>C.free</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The call to <code>C.CString</code> returns a pointer to the start of the
|
||||
char array, so before the function exits we convert it to an
|
||||
<a href="/pkg/unsafe/#Pointer"><code>unsafe.Pointer</code></a> and release
|
||||
the memory allocation with <code>C.free</code>. A common idiom in cgo programs
|
||||
is to <a href="/doc/articles/defer_panic_recover.html"><code>defer</code></a>
|
||||
the free immediately after allocating (especially when the code that follows
|
||||
is more complex than a single function call), as in this rewrite of
|
||||
<code>Print</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/cgo4.go" `/func Print/` `/END/`}}
|
||||
|
||||
<p>
|
||||
<b>Building cgo packages</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To build cgo packages, just use <a href="/cmd/go/#hdr-Compile_packages_and_dependencies">"
|
||||
<code>go build</code>"</a> or
|
||||
<a href="/cmd/go/#hdr-Compile_and_install_packages_and_dependencies">"<code>go install</code>
|
||||
"</a> as usual. The go tool recognizes the special <code>"C"</code> import and automatically
|
||||
uses cgo for those files.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>More cgo resources</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <a href="/cmd/cgo/">cgo command</a> documentation has more detail about
|
||||
the C pseudo-package and the build process. The <a href="/misc/cgo/">cgo examples</a>
|
||||
in the Go tree demonstrate more advanced concepts.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For a simple, idiomatic example of a cgo-based package, see Russ Cox's <a
|
||||
href="http://code.google.com/p/gosqlite/source/browse/sqlite/sqlite.go">gosqlite</a>.
|
||||
Also, the <a href="http://code.google.com/p/go-wiki/wiki/Projects">Go Community Wiki</a>
|
||||
lists many packages, some of which use cgo.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Finally, if you're curious as to how all this works internally, take a look
|
||||
at the introductory comment of the runtime package's <a href="/src/pkg/runtime/cgocall.c">cgocall.c</a>.
|
||||
</p>
|
||||
79
doc/articles/concurrency_patterns.html
Normal file
@@ -0,0 +1,79 @@
|
||||
<!--{
|
||||
"Title": "Go Concurrency Patterns: Timing out, moving on",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
Concurrent programming has its own idioms. A good example is timeouts. Although
|
||||
Go's channels do not support them directly, they are easy to implement. Say we
|
||||
want to receive from the channel <code>ch</code>, but want to wait at most one
|
||||
second for the value to arrive. We would start by creating a signalling channel
|
||||
and launching a goroutine that sleeps before sending on the channel:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/timeout1.go" `/timeout :=/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
We can then use a <code>select</code> statement to receive from either
|
||||
<code>ch</code> or <code>timeout</code>. If nothing arrives on <code>ch</code>
|
||||
after one second, the timeout case is selected and the attempt to read from
|
||||
<code>ch</code> is abandoned.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/timeout1.go" `/select {/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The <code>timeout</code> channel is buffered with space for 1 value, allowing
|
||||
the timeout goroutine to send to the channel and then exit. The goroutine
|
||||
doesn't know (or care) whether the value is received. This means the goroutine
|
||||
won't hang around forever if the <code>ch</code> receive happens before the
|
||||
timeout is reached. The <code>timeout</code> channel will eventually be
|
||||
deallocated by the garbage collector.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
(In this example we used <code>time.Sleep</code> to demonstrate the mechanics
|
||||
of goroutines and channels. In real programs you should use <code>
|
||||
<a href="/pkg/time/#After">time.After</a></code>, a function that returns
|
||||
a channel and sends on that channel after the specified duration.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Let's look at another variation of this pattern. In this example we have a
|
||||
program that reads from multiple replicated databases simultaneously. The
|
||||
program needs only one of the answers, and it should accept the answer that
|
||||
arrives first.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The function <code>Query</code> takes a slice of database connections and a
|
||||
<code>query</code> string. It queries each of the databases in parallel and
|
||||
returns the first response it receives:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/timeout2.go" `/func Query/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
In this example, the closure does a non-blocking send, which it achieves by
|
||||
using the send operation in <code>select</code> statement with a
|
||||
<code>default</code> case. If the send cannot go through immediately the
|
||||
default case will be selected. Making the send non-blocking guarantees that
|
||||
none of the goroutines launched in the loop will hang around. However, if the
|
||||
result arrives before the main function has made it to the receive, the send
|
||||
could fail since no one is ready.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This problem is a textbook example of what is known as a
|
||||
<a href="https://en.wikipedia.org/wiki/Race_condition">race condition</a>, but
|
||||
the fix is trivial. We just make sure to buffer the channel <code>ch</code> (by
|
||||
adding the buffer length as the second argument to <a href="/pkg/builtin/#make">make</a>),
|
||||
guaranteeing that the first send has a place to put the value. This ensures the
|
||||
send will always succeed, and the first value to arrive will be retrieved
|
||||
regardless of the order of execution.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
These two examples demonstrate the simplicity with which Go can express complex
|
||||
interactions between goroutines.
|
||||
</p>
|
||||
197
doc/articles/defer_panic_recover.html
Normal file
@@ -0,0 +1,197 @@
|
||||
<!--{
|
||||
"Title": "Defer, Panic, and Recover",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
Go has the usual mechanisms for control flow: if, for, switch, goto. It also
|
||||
has the go statement to run code in a separate goroutine. Here I'd like to
|
||||
discuss some of the less common ones: defer, panic, and recover.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <b>defer statement</b> pushes a function call onto a list. The list of saved
|
||||
calls is executed after the surrounding function returns. Defer is commonly
|
||||
used to simplify functions that perform various clean-up actions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For example, let's look at a function that opens two files and copies the
|
||||
contents of one file to the other:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/defer.go" `/func CopyFile/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
This works, but there is a bug. If the call to os.Create fails, the
|
||||
function will return without closing the source file. This can be easily
|
||||
remedied by putting a call to src.Close before the second return statement,
|
||||
but if the function were more complex the problem might not be so easily
|
||||
noticed and resolved. By introducing defer statements we can ensure that the
|
||||
files are always closed:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/defer2.go" `/func CopyFile/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Defer statements allow us to think about closing each file right after opening
|
||||
it, guaranteeing that, regardless of the number of return statements in the
|
||||
function, the files <i>will</i> be closed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The behavior of defer statements is straightforward and predictable. There are
|
||||
three simple rules:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
1. <i>A deferred function's arguments are evaluated when the defer statement is
|
||||
evaluated.</i>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In this example, the expression "i" is evaluated when the Println call is
|
||||
deferred. The deferred call will print "0" after the function returns.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/defer.go" `/func a/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
2. <i>Deferred function calls are executed in Last In First Out order
|
||||
</i>after<i> the surrounding function returns.</i>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This function prints "3210":
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/defer.go" `/func b/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
3. <i>Deferred functions may read and assign to the returning function's named
|
||||
return values.</i>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In this example, a deferred function increments the return value i <i>after</i>
|
||||
the surrounding function returns. Thus, this function returns 2:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/defer.go" `/func c/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
This is convenient for modifying the error return value of a function; we will
|
||||
see an example of this shortly.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Panic</b> is a built-in function that stops the ordinary flow of control and
|
||||
begins <i>panicking</i>. When the function F calls panic, execution of F stops,
|
||||
any deferred functions in F are executed normally, and then F returns to its
|
||||
caller. To the caller, F then behaves like a call to panic. The process
|
||||
continues up the stack until all functions in the current goroutine have
|
||||
returned, at which point the program crashes. Panics can be initiated by
|
||||
invoking panic directly. They can also be caused by runtime errors, such as
|
||||
out-of-bounds array accesses.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Recover</b> is a built-in function that regains control of a panicking
|
||||
goroutine. Recover is only useful inside deferred functions. During normal
|
||||
execution, a call to recover will return nil and have no other effect. If the
|
||||
current goroutine is panicking, a call to recover will capture the value given
|
||||
to panic and resume normal execution.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Here's an example program that demonstrates the mechanics of panic and defer:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/defer2.go" `/package main/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The function g takes the int i, and panics if i is greater than 3, or else it
|
||||
calls itself with the argument i+1. The function f defers a function that calls
|
||||
recover and prints the recovered value (if it is non-nil). Try to picture what
|
||||
the output of this program might be before reading on.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The program will output:
|
||||
</p>
|
||||
|
||||
<pre>Calling g.
|
||||
Printing in g 0
|
||||
Printing in g 1
|
||||
Printing in g 2
|
||||
Printing in g 3
|
||||
Panicking!
|
||||
Defer in g 3
|
||||
Defer in g 2
|
||||
Defer in g 1
|
||||
Defer in g 0
|
||||
Recovered in f 4
|
||||
Returned normally from f.</pre>
|
||||
|
||||
<p>
|
||||
If we remove the deferred function from f the panic is not recovered and
|
||||
reaches the top of the goroutine's call stack, terminating the program. This
|
||||
modified program will output:
|
||||
</p>
|
||||
|
||||
<pre>Calling g.
|
||||
Printing in g 0
|
||||
Printing in g 1
|
||||
Printing in g 2
|
||||
Printing in g 3
|
||||
Panicking!
|
||||
Defer in g 3
|
||||
Defer in g 2
|
||||
Defer in g 1
|
||||
Defer in g 0
|
||||
panic: 4
|
||||
|
||||
panic PC=0x2a9cd8
|
||||
[stack trace omitted]</pre>
|
||||
|
||||
<p>
|
||||
For a real-world example of <b>panic</b> and <b>recover</b>, see the
|
||||
<a href="/pkg/encoding/json/">json package</a> from the Go standard library.
|
||||
It decodes JSON-encoded data with a set of recursive functions.
|
||||
When malformed JSON is encountered, the parser calls panic to unwind the
|
||||
stack to the top-level function call, which recovers from the panic and returns
|
||||
an appropriate error value (see the 'error' and 'unmarshal' methods of
|
||||
the decodeState type in
|
||||
<a href="/src/pkg/encoding/json/decode.go">decode.go</a>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The convention in the Go libraries is that even when a package uses panic
|
||||
internally, its external API still presents explicit error return values.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Other uses of <b>defer</b> (beyond the file.Close example given earlier)
|
||||
include releasing a mutex:
|
||||
</p>
|
||||
|
||||
<pre>mu.Lock()
|
||||
defer mu.Unlock()</pre>
|
||||
|
||||
<p>
|
||||
printing a footer:
|
||||
</p>
|
||||
|
||||
<pre>printHeader()
|
||||
defer printFooter()</pre>
|
||||
|
||||
<p>
|
||||
and more.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In summary, the defer statement (with or without panic and recover) provides an
|
||||
unusual and powerful mechanism for control flow. It can be used to model a
|
||||
number of features implemented by special-purpose structures in other
|
||||
programming languages. Try it out.
|
||||
</p>
|
||||
316
doc/articles/error_handling.html
Normal file
@@ -0,0 +1,316 @@
|
||||
<!--{
|
||||
"Title": "Error Handling and Go",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
If you have written any Go code you have probably encountered the built-in
|
||||
<code>error</code> type. Go code uses <code>error</code> values to
|
||||
indicate an abnormal state. For example, the <code>os.Open</code> function
|
||||
returns a non-nil <code>error</code> value when it fails to open a file.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/func Open/`}}
|
||||
|
||||
<p>
|
||||
The following code uses <code>os.Open</code> to open a file. If an error
|
||||
occurs it calls <code>log.Fatal</code> to print the error message and stop.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/func openFile/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
You can get a lot done in Go knowing just this about the <code>error</code>
|
||||
type, but in this article we'll take a closer look at <code>error</code> and
|
||||
discuss some good practices for error handling in Go.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>The error type</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>error</code> type is an interface type. An <code>error</code>
|
||||
variable represents any value that can describe itself as a string. Here is the
|
||||
interface's declaration:
|
||||
</p>
|
||||
|
||||
<pre>type error interface {
|
||||
Error() string
|
||||
}</pre>
|
||||
|
||||
<p>
|
||||
The <code>error</code> type, as with all built in types, is
|
||||
<a href="/doc/go_spec.html#Predeclared_identifiers">predeclared</a> in the
|
||||
<a href="/doc/go_spec.html#Blocks">universe block</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The most commonly-used <code>error</code> implementation is the
|
||||
<a href="/pkg/errors/">errors</a> package's unexported <code>errorString</code> type.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/errorString/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
You can construct one of these values with the <code>errors.New</code>
|
||||
function. It takes a string that it converts to an <code>errors.errorString</code>
|
||||
and returns as an <code>error</code> value.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/New/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Here's how you might use <code>errors.New</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/func Sqrt/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
A caller passing a negative argument to <code>Sqrt</code> receives a non-nil
|
||||
<code>error</code> value (whose concrete representation is an
|
||||
<code>errors.errorString</code> value). The caller can access the error string
|
||||
("math: square root of...") by calling the <code>error</code>'s
|
||||
<code>Error</code> method, or by just printing it:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/func printErr/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The <a href="/pkg/fmt/">fmt</a> package formats an <code>error</code> value
|
||||
by calling its <code>Error() string</code> method.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
It is the error implementation's responsibility to summarize the context.
|
||||
The error returned by <code>os.Open</code> formats as "open /etc/passwd:
|
||||
permission denied," not just "permission denied." The error returned by our
|
||||
<code>Sqrt</code> is missing information about the invalid argument.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To add that information, a useful function is the <code>fmt</code> package's
|
||||
<code>Errorf</code>. It formats a string according to <code>Printf</code>'s
|
||||
rules and returns it as an <code>error</code> created by
|
||||
<code>errors.New</code>.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/fmtError/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
In many cases <code>fmt.Errorf</code> is good enough, but since
|
||||
<code>error</code> is an interface, you can use arbitrary data structures as
|
||||
error values, to allow callers to inspect the details of the error.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For instance, our hypothetical callers might want to recover the invalid
|
||||
argument passed to <code>Sqrt</code>. We can enable that by defining a new
|
||||
error implementation instead of using <code>errors.errorString</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/type NegativeSqrtError/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
A sophisticated caller can then use a
|
||||
<a href="/doc/go_spec.html#Type_assertions">type assertion</a> to check for a
|
||||
<code>NegativeSqrtError</code> and handle it specially, while callers that just
|
||||
pass the error to <code>fmt.Println</code> or <code>log.Fatal</code> will see
|
||||
no change in behavior.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
As another example, the <a href="/pkg/encoding/json/">json</a> package specifies a
|
||||
<code>SyntaxError</code> type that the <code>json.Decode</code> function
|
||||
returns when it encounters a syntax error parsing a JSON blob.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/type SyntaxError/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The <code>Offset</code> field isn't even shown in the default formatting of the
|
||||
error, but callers can use it to add file and line information to their error
|
||||
messages:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/func decodeError/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
(This is a slightly simplified version of some
|
||||
<a href="http://golang.org/s/camjsondecode">actual code</a>
|
||||
from the <a href="http://camlistore.org">Camlistore</a> project.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>error</code> interface requires only a <code>Error</code> method;
|
||||
specific error implementations might have additional methods. For instance, the
|
||||
<a href="/pkg/net/">net</a> package returns errors of type
|
||||
<code>error</code>, following the usual convention, but some of the error
|
||||
implementations have additional methods defined by the <code>net.Error</code>
|
||||
interface:
|
||||
</p>
|
||||
|
||||
<pre>package net
|
||||
|
||||
type Error interface {
|
||||
error
|
||||
Timeout() bool // Is the error a timeout?
|
||||
Temporary() bool // Is the error temporary?
|
||||
}</pre>
|
||||
|
||||
<p>
|
||||
Client code can test for a <code>net.Error</code> with a type assertion and
|
||||
then distinguish transient network errors from permanent ones. For instance, a
|
||||
web crawler might sleep and retry when it encounters a temporary error and give
|
||||
up otherwise.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error.go" `/func netError/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
<b>Simplifying repetitive error handling</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In Go, error handling is important. The language's design and conventions
|
||||
encourage you to explicitly check for errors where they occur (as distinct from
|
||||
the convention in other languages of throwing exceptions and sometimes catching
|
||||
them). In some cases this makes Go code verbose, but fortunately there are some
|
||||
techniques you can use to minimize repetitive error handling.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Consider an <a href="http://code.google.com/appengine/docs/go/">App Engine</a>
|
||||
application with an HTTP handler that retrieves a record from the datastore and
|
||||
formats it with a template.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error2.go" `/func init/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
This function handles errors returned by the <code>datastore.Get</code>
|
||||
function and <code>viewTemplate</code>'s <code>Execute</code> method. In both
|
||||
cases, it presents a simple error message to the user with the HTTP status code
|
||||
500 ("Internal Server Error"). This looks like a manageable amount of code, but
|
||||
add some more HTTP handlers and you quickly end up with many copies of
|
||||
identical error handling code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To reduce the repetition we can define our own HTTP <code>appHandler</code>
|
||||
type that includes an <code>error</code> return value:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error3.go" `/type appHandler/`}}
|
||||
|
||||
<p>
|
||||
Then we can change our <code>viewRecord</code> function to return errors:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error3.go" `/func viewRecord/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
This is simpler than the original version, but the <a
|
||||
href="/pkg/net/http/">http</a> package doesn't understand functions that return
|
||||
<code>error</code>.
|
||||
To fix this we can implement the <code>http.Handler</code> interface's
|
||||
<code>ServeHTTP</code> method on <code>appHandler</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error3.go" `/ServeHTTP/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The <code>ServeHTTP</code> method calls the <code>appHandler</code> function
|
||||
and displays the returned error (if any) to the user. Notice that the method's
|
||||
receiver, <code>fn</code>, is a function. (Go can do that!) The method invokes
|
||||
the function by calling the receiver in the expression <code>fn(w, r)</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Now when registering <code>viewRecord</code> with the http package we use the
|
||||
<code>Handle</code> function (instead of <code>HandleFunc</code>) as
|
||||
<code>appHandler</code> is an <code>http.Handler</code> (not an
|
||||
<code>http.HandlerFunc</code>).
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error3.go" `/func init/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
With this basic error handling infrastructure in place, we can make it more
|
||||
user friendly. Rather than just displaying the error string, it would be better
|
||||
to give the user a simple error message with an appropriate HTTP status code,
|
||||
while logging the full error to the App Engine developer console for debugging
|
||||
purposes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To do this we create an <code>appError</code> struct containing an
|
||||
<code>error</code> and some other fields:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error4.go" `/type appError/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Next we modify the appHandler type to return <code>*appError</code> values:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error4.go" `/type appHandler/`}}
|
||||
|
||||
<p>
|
||||
(It's usually a mistake to pass back the concrete type of an error rather than
|
||||
<code>error</code>,
|
||||
for reasons discussed in <a href="/doc/go_faq.html#nil_error">the Go FAQ</a>,
|
||||
but it's the right thing to do here because <code>ServeHTTP</code> is the only
|
||||
place that sees the value and uses its contents.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
And make <code>appHandler</code>'s <code>ServeHTTP</code> method display the
|
||||
<code>appError</code>'s <code>Message</code> to the user with the correct HTTP
|
||||
status <code>Code</code> and log the full <code>Error</code> to the developer
|
||||
console:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error4.go" `/ServeHTTP/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Finally, we update <code>viewRecord</code> to the new function signature and
|
||||
have it return more context when it encounters an error:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/error4.go" `/func viewRecord/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
This version of <code>viewRecord</code> is the same length as the original, but
|
||||
now each of those lines has specific meaning and we are providing a friendlier
|
||||
user experience.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
It doesn't end there; we can further improve the error handling in our
|
||||
application. Some ideas:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>give the error handler a pretty HTML template,
|
||||
<li>make debugging easier by writing the stack trace to the HTTP response when
|
||||
the user is an administrator,
|
||||
<li>write a constructor function for <code>appError</code> that stores the
|
||||
stack trace for easier debugging,
|
||||
<li>recover from panics inside the <code>appHandler</code>, logging the error
|
||||
to the console as "Critical," while telling the user "a serious error
|
||||
has occurred." This is a nice touch to avoid exposing the user to inscrutable
|
||||
error messages caused by programming errors.
|
||||
See the <a href="defer_panic_recover.html">Defer, Panic, and Recover</a>
|
||||
article for more details.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<b>Conclusion</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Proper error handling is an essential requirement of good software. By
|
||||
employing the techniques described in this post you should be able to write
|
||||
more reliable and succinct Go code.
|
||||
</p>
|
||||
@@ -78,18 +78,17 @@ well-established conventions.</p>
|
||||
source code. For Bitbucket, GitHub, Google Code, and Launchpad, the
|
||||
root directory of the repository is identified by the repository's
|
||||
main URL, without the <code>http://</code> prefix. Subdirectories are named by
|
||||
adding to that path.
|
||||
For example, the Go example programs are obtained by running</p>
|
||||
adding to that path. For example, the supplemental networking
|
||||
libraries for Go are obtained by running</p>
|
||||
|
||||
<pre>
|
||||
git clone https://github.com/golang/example
|
||||
hg clone http://code.google.com/p/go.net
|
||||
</pre>
|
||||
|
||||
<p>and thus the import path for the root directory of that repository is
|
||||
"<code>github.com/golang/example</code>".
|
||||
The <a href="https://godoc.org/github.com/golang/example/stringutil">stringutil</a>
|
||||
package is stored in a subdirectory, so its import path is
|
||||
"<code>github.com/golang/example/stringutil</code>".</p>
|
||||
"<code>code.google.com/p/go.net</code>". The websocket package is stored in a
|
||||
subdirectory, so its import path is
|
||||
"<code>code.google.com/p/go.net/websocket</code>".</p>
|
||||
|
||||
<p>These paths are on the long side, but in exchange we get an
|
||||
automatically managed name space for import paths and the ability for
|
||||
@@ -97,14 +96,13 @@ a tool like the go command to look at an unfamiliar import path and
|
||||
deduce where to obtain the source code.</p>
|
||||
|
||||
<p>Second, the place to store sources in the local file system is derived
|
||||
in a known way from the import path, specifically
|
||||
<code>$GOPATH/src/<import-path></code>.
|
||||
If unset, <code>$GOPATH</code> defaults to a subdirectory
|
||||
named <code>go</code> in the user's home directory.
|
||||
in a known way from the import path. Specifically, the first choice
|
||||
is <code>$GOPATH/src/<import-path></code>. If <code>$GOPATH</code> is
|
||||
unset, the go command will fall back to storing source code alongside the
|
||||
standard Go packages, in <code>$GOROOT/src/pkg/<import-path></code>.
|
||||
If <code>$GOPATH</code> is set to a list of paths, the go command tries
|
||||
<code><dir>/src/<import-path></code> for each of the directories in
|
||||
that list.
|
||||
</p>
|
||||
that list.</p>
|
||||
|
||||
<p>Each of those trees contains, by convention, a top-level directory named
|
||||
"<code>bin</code>", for holding compiled executables, and a top-level directory
|
||||
@@ -138,26 +136,41 @@ to the use of a specific tool chain.</p>
|
||||
|
||||
<h2>Getting started with the go command</h2>
|
||||
|
||||
<p>Finally, a quick tour of how to use the go command.
|
||||
As mentioned above, the default <code>$GOPATH</code> on Unix is <code>$HOME/go</code>.
|
||||
We'll store our programs there.
|
||||
To use a different location, you can set <code>$GOPATH</code>;
|
||||
see <a href="/doc/code.html">How to Write Go Code</a> for details.
|
||||
<p>Finally, a quick tour of how to use the go command, to supplement
|
||||
the information in <a href="/doc/code.html">How to Write Go Code</a>,
|
||||
which you might want to read first. Assuming you want
|
||||
to keep your source code separate from the Go distribution source
|
||||
tree, the first step is to set <code>$GOPATH</code>, the one piece of global
|
||||
configuration that the go command needs. The <code>$GOPATH</code> can be a
|
||||
list of directories, but by far the most common usage should be to set it to a
|
||||
single directory. In particular, you do not need a separate entry in
|
||||
<code>$GOPATH</code> for each of your projects. One <code>$GOPATH</code> can
|
||||
support many projects.</p>
|
||||
|
||||
<p>We first add some source code. Suppose we want to use
|
||||
<p>Here’s an example. Let’s say we decide to keep our Go code in the directory
|
||||
<code>$HOME/mygo</code>. We need to create that directory and set
|
||||
<code>$GOPATH</code> accordingly.</p>
|
||||
|
||||
<pre>
|
||||
$ mkdir $HOME/mygo
|
||||
$ export GOPATH=$HOME/mygo
|
||||
$
|
||||
</pre>
|
||||
|
||||
<p>Into this directory, we now add some source code. Suppose we want to use
|
||||
the indexing library from the codesearch project along with a left-leaning
|
||||
red-black tree. We can install both with the "<code>go get</code>"
|
||||
subcommand:</p>
|
||||
|
||||
<pre>
|
||||
$ go get github.com/google/codesearch/index
|
||||
$ go get code.google.com/p/codesearch/index
|
||||
$ go get github.com/petar/GoLLRB/llrb
|
||||
$
|
||||
</pre>
|
||||
|
||||
<p>Both of these projects are now downloaded and installed into <code>$HOME/go</code>,
|
||||
which contains the two directories
|
||||
<code>src/github.com/google/codesearch/index/</code> and
|
||||
<p>Both of these projects are now downloaded and installed into our
|
||||
<code>$GOPATH</code> directory. The one tree now contains the two directories
|
||||
<code>src/code.google.com/p/codesearch/index/</code> and
|
||||
<code>src/github.com/petar/GoLLRB/llrb/</code>, along with the compiled
|
||||
packages (in <code>pkg/</code>) for those libraries and their dependencies.</p>
|
||||
|
||||
@@ -170,14 +183,13 @@ the pattern "<code>./...</code>" means start in the current directory
|
||||
("<code>...</code>"):</p>
|
||||
|
||||
<pre>
|
||||
$ cd $HOME/go/src
|
||||
$ go list ./...
|
||||
github.com/google/codesearch/cmd/cgrep
|
||||
github.com/google/codesearch/cmd/cindex
|
||||
github.com/google/codesearch/cmd/csearch
|
||||
github.com/google/codesearch/index
|
||||
github.com/google/codesearch/regexp
|
||||
github.com/google/codesearch/sparse
|
||||
code.google.com/p/codesearch/cmd/cgrep
|
||||
code.google.com/p/codesearch/cmd/cindex
|
||||
code.google.com/p/codesearch/cmd/csearch
|
||||
code.google.com/p/codesearch/index
|
||||
code.google.com/p/codesearch/regexp
|
||||
code.google.com/p/codesearch/sparse
|
||||
github.com/petar/GoLLRB/example
|
||||
github.com/petar/GoLLRB/llrb
|
||||
$
|
||||
@@ -187,12 +199,12 @@ $
|
||||
|
||||
<pre>
|
||||
$ go test ./...
|
||||
? github.com/google/codesearch/cmd/cgrep [no test files]
|
||||
? github.com/google/codesearch/cmd/cindex [no test files]
|
||||
? github.com/google/codesearch/cmd/csearch [no test files]
|
||||
ok github.com/google/codesearch/index 0.203s
|
||||
ok github.com/google/codesearch/regexp 0.017s
|
||||
? github.com/google/codesearch/sparse [no test files]
|
||||
? code.google.com/p/codesearch/cmd/cgrep [no test files]
|
||||
? code.google.com/p/codesearch/cmd/cindex [no test files]
|
||||
? code.google.com/p/codesearch/cmd/csearch [no test files]
|
||||
ok code.google.com/p/codesearch/index 0.239s
|
||||
ok code.google.com/p/codesearch/regexp 0.021s
|
||||
? code.google.com/p/codesearch/sparse [no test files]
|
||||
? github.com/petar/GoLLRB/example [no test files]
|
||||
ok github.com/petar/GoLLRB/llrb 0.231s
|
||||
$
|
||||
@@ -202,18 +214,18 @@ $
|
||||
current directory:</p>
|
||||
|
||||
<pre>
|
||||
$ cd github.com/google/codesearch/regexp
|
||||
$ cd $GOPATH/src/code.google.com/p/codesearch/regexp
|
||||
$ go list
|
||||
github.com/google/codesearch/regexp
|
||||
code.google.com/p/codesearch/regexp
|
||||
$ go test -v
|
||||
=== RUN TestNstateEnc
|
||||
--- PASS: TestNstateEnc (0.00s)
|
||||
=== RUN TestMatch
|
||||
--- PASS: TestMatch (0.00s)
|
||||
=== RUN TestGrep
|
||||
--- PASS: TestGrep (0.00s)
|
||||
=== RUN TestNstateEnc
|
||||
--- PASS: TestNstateEnc (0.00 seconds)
|
||||
=== RUN TestMatch
|
||||
--- PASS: TestMatch (0.01 seconds)
|
||||
=== RUN TestGrep
|
||||
--- PASS: TestGrep (0.00 seconds)
|
||||
PASS
|
||||
ok github.com/google/codesearch/regexp 0.018s
|
||||
ok code.google.com/p/codesearch/regexp 0.021s
|
||||
$ go install
|
||||
$
|
||||
</pre>
|
||||
@@ -231,18 +243,17 @@ pick such a long name, but that ability would require additional configuration
|
||||
and complexity in the tool. Typing an extra directory name or two is a small
|
||||
price to pay for the increased simplicity and power.</p>
|
||||
|
||||
<p>As the example shows, it’s fine to work with packages from many different
|
||||
projects at once within a single <code>$GOPATH</code> root directory.</p>
|
||||
|
||||
<h2>Limitations</h2>
|
||||
|
||||
<p>As mentioned above, the go command is not a general-purpose build
|
||||
tool.
|
||||
In particular, it does not have any facility for generating Go
|
||||
source files <em>during</em> a build, although it does provide
|
||||
<a href="/cmd/go/#hdr-Generate_Go_files_by_processing_source"><code>go</code>
|
||||
<code>generate</code></a>,
|
||||
which can automate the creation of Go files <em>before</em> the build.
|
||||
For more advanced build setups, you may need to write a
|
||||
tool. In particular, it does not have any facility for generating Go
|
||||
source files during a build. Instead, if you want to use a tool like
|
||||
yacc or the protocol buffer compiler, you will need to write a
|
||||
makefile (or a configuration file for the build tool of your choice)
|
||||
to run whatever tool creates the Go files and then check those generated source files
|
||||
to generate the Go files and then check those generated source files
|
||||
into your repository. This is more work for you, the package author,
|
||||
but it is significantly less work for your users, who can use
|
||||
"<code>go get</code>" without needing to obtain and build
|
||||
|
||||
315
doc/articles/gobs_of_data.html
Normal file
@@ -0,0 +1,315 @@
|
||||
<!--{
|
||||
"Title": "Gobs of data",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
To transmit a data structure across a network or to store it in a file, it must
|
||||
be encoded and then decoded again. There are many encodings available, of
|
||||
course: <a href="http://www.json.org/">JSON</a>,
|
||||
<a href="http://www.w3.org/XML/">XML</a>, Google's
|
||||
<a href="http://code.google.com/p/protobuf">protocol buffers</a>, and more.
|
||||
And now there's another, provided by Go's <a href="/pkg/encoding/gob/">gob</a>
|
||||
package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Why define a new encoding? It's a lot of work and redundant at that. Why not
|
||||
just use one of the existing formats? Well, for one thing, we do! Go has
|
||||
<a href="/pkg/">packages</a> supporting all the encodings just mentioned (the
|
||||
<a href="http://code.google.com/p/goprotobuf">protocol buffer package</a> is in
|
||||
a separate repository but it's one of the most frequently downloaded). And for
|
||||
many purposes, including communicating with tools and systems written in other
|
||||
languages, they're the right choice.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
But for a Go-specific environment, such as communicating between two servers
|
||||
written in Go, there's an opportunity to build something much easier to use and
|
||||
possibly more efficient.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Gobs work with the language in a way that an externally-defined,
|
||||
language-independent encoding cannot. At the same time, there are lessons to be
|
||||
learned from the existing systems.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Goals</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The gob package was designed with a number of goals in mind.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
First, and most obvious, it had to be very easy to use. First, because Go has
|
||||
reflection, there is no need for a separate interface definition language or
|
||||
"protocol compiler". The data structure itself is all the package should need
|
||||
to figure out how to encode and decode it. On the other hand, this approach
|
||||
means that gobs will never work as well with other languages, but that's OK:
|
||||
gobs are unashamedly Go-centric.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Efficiency is also important. Textual representations, exemplified by XML and
|
||||
JSON, are too slow to put at the center of an efficient communications network.
|
||||
A binary encoding is necessary.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Gob streams must be self-describing. Each gob stream, read from the beginning,
|
||||
contains sufficient information that the entire stream can be parsed by an
|
||||
agent that knows nothing a priori about its contents. This property means that
|
||||
you will always be able to decode a gob stream stored in a file, even long
|
||||
after you've forgotten what data it represents.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There were also some things to learn from our experiences with Google protocol
|
||||
buffers.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Protocol buffer misfeatures</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Protocol buffers had a major effect on the design of gobs, but have three
|
||||
features that were deliberately avoided. (Leaving aside the property that
|
||||
protocol buffers aren't self-describing: if you don't know the data definition
|
||||
used to encode a protocol buffer, you might not be able to parse it.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
First, protocol buffers only work on the data type we call a struct in Go. You
|
||||
can't encode an integer or array at the top level, only a struct with fields
|
||||
inside it. That seems a pointless restriction, at least in Go. If all you want
|
||||
to send is an array of integers, why should you have to put it into a
|
||||
struct first?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Next, a protocol buffer definition may specify that fields <code>T.x</code> and
|
||||
<code>T.y</code> are required to be present whenever a value of type
|
||||
<code>T</code> is encoded or decoded. Although such required fields may seem
|
||||
like a good idea, they are costly to implement because the codec must maintain a
|
||||
separate data structure while encoding and decoding, to be able to report when
|
||||
required fields are missing. They're also a maintenance problem. Over time, one
|
||||
may want to modify the data definition to remove a required field, but that may
|
||||
cause existing clients of the data to crash. It's better not to have them in the
|
||||
encoding at all. (Protocol buffers also have optional fields. But if we don't
|
||||
have required fields, all fields are optional and that's that. There will be
|
||||
more to say about optional fields a little later.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The third protocol buffer misfeature is default values. If a protocol buffer
|
||||
omits the value for a "defaulted" field, then the decoded structure behaves as
|
||||
if the field were set to that value. This idea works nicely when you have
|
||||
getter and setter methods to control access to the field, but is harder to
|
||||
handle cleanly when the container is just a plain idiomatic struct. Required
|
||||
fields are also tricky to implement: where does one define the default values,
|
||||
what types do they have (is text UTF-8? uninterpreted bytes? how many bits in a
|
||||
float?) and despite the apparent simplicity, there were a number of
|
||||
complications in their design and implementation for protocol buffers. We
|
||||
decided to leave them out of gobs and fall back to Go's trivial but effective
|
||||
defaulting rule: unless you set something otherwise, it has the "zero value"
|
||||
for that type - and it doesn't need to be transmitted.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
So gobs end up looking like a sort of generalized, simplified protocol buffer.
|
||||
How do they work?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Values</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The encoded gob data isn't about <code>int8</code>s and <code>uint16</code>s.
|
||||
Instead, somewhat analogous to constants in Go, its integer values are abstract,
|
||||
sizeless numbers, either signed or unsigned. When you encode an
|
||||
<code>int8</code>, its value is transmitted as an unsized, variable-length
|
||||
integer. When you encode an <code>int64</code>, its value is also transmitted as
|
||||
an unsized, variable-length integer. (Signed and unsigned are treated
|
||||
distinctly, but the same unsized-ness applies to unsigned values too.) If both
|
||||
have the value 7, the bits sent on the wire will be identical. When the receiver
|
||||
decodes that value, it puts it into the receiver's variable, which may be of
|
||||
arbitrary integer type. Thus an encoder may send a 7 that came from an
|
||||
<code>int8</code>, but the receiver may store it in an <code>int64</code>. This
|
||||
is fine: the value is an integer and as a long as it fits, everything works. (If
|
||||
it doesn't fit, an error results.) This decoupling from the size of the variable
|
||||
gives some flexibility to the encoding: we can expand the type of the integer
|
||||
variable as the software evolves, but still be able to decode old data.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This flexibility also applies to pointers. Before transmission, all pointers are
|
||||
flattened. Values of type <code>int8</code>, <code>*int8</code>,
|
||||
<code>**int8</code>, <code>****int8</code>, etc. are all transmitted as an
|
||||
integer value, which may then be stored in <code>int</code> of any size, or
|
||||
<code>*int</code>, or <code>******int</code>, etc. Again, this allows for
|
||||
flexibility.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Flexibility also happens because, when decoding a struct, only those fields
|
||||
that are sent by the encoder are stored in the destination. Given the value
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/gobs1.go" `/type T/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
the encoding of <code>t</code> sends only the 7 and 8. Because it's zero, the
|
||||
value of <code>Y</code> isn't even sent; there's no need to send a zero value.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The receiver could instead decode the value into this structure:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/gobs1.go" `/type U/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
and acquire a value of <code>u</code> with only <code>X</code> set (to the
|
||||
address of an <code>int8</code> variable set to 7); the <code>Z</code> field is
|
||||
ignored - where would you put it? When decoding structs, fields are matched by
|
||||
name and compatible type, and only fields that exist in both are affected. This
|
||||
simple approach finesses the "optional field" problem: as the type
|
||||
<code>T</code> evolves by adding fields, out of date receivers will still
|
||||
function with the part of the type they recognize. Thus gobs provide the
|
||||
important result of optional fields - extensibility - without any additional
|
||||
mechanism or notation.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
From integers we can build all the other types: bytes, strings, arrays, slices,
|
||||
maps, even floats. Floating-point values are represented by their IEEE 754
|
||||
floating-point bit pattern, stored as an integer, which works fine as long as
|
||||
you know their type, which we always do. By the way, that integer is sent in
|
||||
byte-reversed order because common values of floating-point numbers, such as
|
||||
small integers, have a lot of zeros at the low end that we can avoid
|
||||
transmitting.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
One nice feature of gobs that Go makes possible is that they allow you to define
|
||||
your own encoding by having your type satisfy the
|
||||
<a href="/pkg/encoding/gob/#GobEncoder">GobEncoder</a> and
|
||||
<a href="/pkg/encoding/gob/#GobDecoder">GobDecoder</a> interfaces, in a manner
|
||||
analogous to the <a href="/pkg/encoding/json/">JSON</a> package's
|
||||
<a href="/pkg/encoding/json/#Marshaler">Marshaler</a> and
|
||||
<a href="/pkg/encoding/json/#Unmarshaler">Unmarshaler</a> and also to the
|
||||
<a href="/pkg/fmt/#Stringer">Stringer</a> interface from
|
||||
<a href="/pkg/fmt/">package fmt</a>. This facility makes it possible to
|
||||
represent special features, enforce constraints, or hide secrets when you
|
||||
transmit data. See the <a href="/pkg/encoding/gob/">documentation</a> for
|
||||
details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Types on the wire</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The first time you send a given type, the gob package includes in the data
|
||||
stream a description of that type. In fact, what happens is that the encoder is
|
||||
used to encode, in the standard gob encoding format, an internal struct that
|
||||
describes the type and gives it a unique number. (Basic types, plus the layout
|
||||
of the type description structure, are predefined by the software for
|
||||
bootstrapping.) After the type is described, it can be referenced by its type
|
||||
number.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Thus when we send our first type <code>T</code>, the gob encoder sends a
|
||||
description of <code>T</code> and tags it with a type number, say 127. All
|
||||
values, including the first, are then prefixed by that number, so a stream of
|
||||
<code>T</code> values looks like:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
("define type id" 127, definition of type T)(127, T value)(127, T value), ...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
These type numbers make it possible to describe recursive types and send values
|
||||
of those types. Thus gobs can encode types such as trees:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/gobs1.go" `/type Node/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
(It's an exercise for the reader to discover how the zero-defaulting rule makes
|
||||
this work, even though gobs don't represent pointers.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
With the type information, a gob stream is fully self-describing except for the
|
||||
set of bootstrap types, which is a well-defined starting point.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Compiling a machine</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The first time you encode a value of a given type, the gob package builds a
|
||||
little interpreted machine specific to that data type. It uses reflection on
|
||||
the type to construct that machine, but once the machine is built it does not
|
||||
depend on reflection. The machine uses package unsafe and some trickery to
|
||||
convert the data into the encoded bytes at high speed. It could use reflection
|
||||
and avoid unsafe, but would be significantly slower. (A similar high-speed
|
||||
approach is taken by the protocol buffer support for Go, whose design was
|
||||
influenced by the implementation of gobs.) Subsequent values of the same type
|
||||
use the already-compiled machine, so they can be encoded right away.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Decoding is similar but harder. When you decode a value, the gob package holds
|
||||
a byte slice representing a value of a given encoder-defined type to decode,
|
||||
plus a Go value into which to decode it. The gob package builds a machine for
|
||||
that pair: the gob type sent on the wire crossed with the Go type provided for
|
||||
decoding. Once that decoding machine is built, though, it's again a
|
||||
reflectionless engine that uses unsafe methods to get maximum speed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Use</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There's a lot going on under the hood, but the result is an efficient,
|
||||
easy-to-use encoding system for transmitting data. Here's a complete example
|
||||
showing differing encoded and decoded types. Note how easy it is to send and
|
||||
receive values; all you need to do is present values and variables to the
|
||||
<a href="/pkg/encoding/gob/">gob package</a> and it does all the work.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/gobs2.go" `/package main/` `$`}}
|
||||
|
||||
<p>
|
||||
You can compile and run this example code in the
|
||||
<a href="http://play.golang.org/p/_-OJV-rwMq">Go Playground</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <a href="/pkg/net/rpc/">rpc package</a> builds on gobs to turn this
|
||||
encode/decode automation into transport for method calls across the network.
|
||||
That's a subject for another article.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Details</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <a href="/pkg/encoding/gob/">gob package documentation</a>, especially the
|
||||
file <a href="/src/pkg/encoding/gob/doc.go">doc.go</a>, expands on many of the
|
||||
details described here and includes a full worked example showing how the
|
||||
encoding represents data. If you are interested in the innards of the gob
|
||||
implementation, that's a good place to start.
|
||||
</p>
|
||||
147
doc/articles/godoc_documenting_go_code.html
Normal file
@@ -0,0 +1,147 @@
|
||||
<!--{
|
||||
"Title": "Godoc: documenting Go code",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
The Go project takes documentation seriously. Documentation is a huge part of
|
||||
making software accessible and maintainable. Of course it must be well-written
|
||||
and accurate, but it also must be easy to write and to maintain. Ideally, it
|
||||
should be coupled to the code itself so the documentation evolves along with the
|
||||
code. The easier it is for programmers to produce good documentation, the better
|
||||
for everyone.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To that end, we have developed the <a href="/cmd/godoc/">godoc</a> documentation
|
||||
tool. This article describes godoc's approach to documentation, and explains how
|
||||
you can use our conventions and tools to write good documentation for your own
|
||||
projects.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Godoc parses Go source code - including comments - and produces documentation as
|
||||
HTML or plain text. The end result is documentation tightly coupled with the
|
||||
code it documents. For example, through godoc's web interface you can navigate
|
||||
from a function's <a href="/pkg/strings/#HasPrefix">documentation</a> to its
|
||||
<a href="/src/pkg/strings/strings.go?#L312">implementation</a> with one click.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Godoc is conceptually related to Python's
|
||||
<a href="http://www.python.org/dev/peps/pep-0257/">Docstring</a> and Java's
|
||||
<a href="http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html">Javadoc</a>,
|
||||
but its design is simpler. The comments read by godoc are not language
|
||||
constructs (as with Docstring) nor must they have their own machine-readable
|
||||
syntax (as with Javadoc). Godoc comments are just good comments, the sort you
|
||||
would want to read even if godoc didn't exist.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The convention is simple: to document a type, variable, constant, function, or
|
||||
even a package, write a regular comment directly preceding its declaration, with
|
||||
no intervening blank line. Godoc will then present that comment as text
|
||||
alongside the item it documents. For example, this is the documentation for the
|
||||
<code>fmt</code> package's <a href="/pkg/fmt/#Fprint"><code>Fprint</code></a>
|
||||
function:
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/fmt/print.go" `/Fprint formats using the default/` `/func Fprint/`}}
|
||||
|
||||
<p>
|
||||
Notice this comment is a complete sentence that begins with the name of the
|
||||
element it describes. This important convention allows us to generate
|
||||
documentation in a variety of formats, from plain text to HTML to UNIX man
|
||||
pages, and makes it read better when tools truncate it for brevity, such as when
|
||||
they extract the first line or sentence.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Comments on package declarations should provide general package documentation.
|
||||
These comments can be short, like the <a href="/pkg/sort/"><code>sort</code></a>
|
||||
package's brief description:
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/sort/sort.go" `/Package sort provides/` `/package sort/`}}
|
||||
|
||||
<p>
|
||||
They can also be detailed like the <a href="/pkg/encoding/gob/"><code>gob</code></a>
|
||||
package's overview. That package uses another convention for packages
|
||||
that need large amounts of introductory documentation: the package comment is
|
||||
placed in its own file, <a href="/src/pkg/encoding/gob/doc.go">doc.go</a>, which
|
||||
contains only those comments and a package clause.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When writing package comments of any size, keep in mind that their first
|
||||
sentence will appear in godoc's <a href="/pkg/">package list</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Comments that are not adjacent to a top-level declaration are omitted from
|
||||
godoc's output, with one notable exception. Top-level comments that begin with
|
||||
the word <code>"BUG(who)"</code> are recognized as known bugs, and included in
|
||||
the "Bugs" section of the package documentation. The "who" part should be the
|
||||
user name of someone who could provide more information. For example, this is a
|
||||
known issue from the <a href="/pkg/sync/atomic/#pkg-note-BUG"><code>sync/atomic</code></a> package:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// BUG(rsc): On x86-32, the 64-bit functions use instructions
|
||||
// unavailable before the Pentium MMX. On both ARM and x86-32, it is the
|
||||
// caller's responsibility to arrange for 64-bit alignment of 64-bit
|
||||
// words accessed atomically.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Godoc treats executable commands in the same way. It looks for a comment on
|
||||
package main, which is sometimes put in a separate file called <code>doc.go</code>.
|
||||
For example, see the
|
||||
<a href="/cmd/godoc/">godoc documentation</a> and its corresponding
|
||||
<a href="/src/cmd/godoc/doc.go">doc.go</a> file.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There are a few formatting rules that Godoc uses when converting comments to
|
||||
HTML:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Subsequent lines of text are considered part of the same paragraph; you must
|
||||
leave a blank line to separate paragraphs.
|
||||
</li>
|
||||
<li>
|
||||
Pre-formatted text must be indented relative to the surrounding comment text
|
||||
(see gob's <a href="/src/pkg/encoding/gob/doc.go">doc.go</a> for an example).
|
||||
</li>
|
||||
<li>
|
||||
URLs will be converted to HTML links; no special markup is necessary.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Note that none of these rules requires you to do anything out of the ordinary.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In fact, the best thing about godoc's minimal approach is how easy it is to use.
|
||||
As a result, a lot of Go code, including all of the standard library, already
|
||||
follows the conventions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Your own code can present good documentation just by having comments as
|
||||
described above. Any Go packages installed inside <code>$GOROOT/src/pkg</code>
|
||||
and any <code>GOPATH</code> work spaces will already be accessible via godoc's
|
||||
command-line and HTTP interfaces, and you can specify additional paths for
|
||||
indexing via the <code>-path</code> flag or just by running <code>"godoc ."</code>
|
||||
in the source directory. See the <a href="/cmd/godoc/">godoc documentation</a>
|
||||
for more details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Godoc recognizes example functions written according to the
|
||||
<a href="/pkg/testing/#pkg-overview"><code>testing</code></a> package's naming
|
||||
conventions and presents them appropriately.
|
||||
</p>
|
||||
348
doc/articles/gos_declaration_syntax.html
Normal file
@@ -0,0 +1,348 @@
|
||||
<!--{
|
||||
"Title": "Go's Declaration Syntax"
|
||||
}-->
|
||||
|
||||
<p>
|
||||
Newcomers to Go wonder why the declaration syntax is different from the
|
||||
tradition established in the C family. In this post we'll compare the
|
||||
two approaches and explain why Go's declarations look as they do.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>C syntax</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
First, let's talk about C syntax. C took an unusual and clever approach
|
||||
to declaration syntax. Instead of describing the types with special
|
||||
syntax, one writes an expression involving the item being declared, and
|
||||
states what type that expression will have. Thus
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int x;
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
declares x to be an int: the expression 'x' will have type int. In
|
||||
general, to figure out how to write the type of a new variable, write an
|
||||
expression involving that variable that evaluates to a basic type, then
|
||||
put the basic type on the left and the expression on the right.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Thus, the declarations
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int *p;
|
||||
int a[3];
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
state that p is a pointer to int because '*p' has type int, and that a
|
||||
is an array of ints because a[3] (ignoring the particular index value,
|
||||
which is punned to be the size of the array) has type int.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
What about functions? Originally, C's function declarations wrote the
|
||||
types of the arguments outside the parens, like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{ /* ... */ }
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Again, we see that main is a function because the expression main(argc,
|
||||
argv) returns an int. In modern notation we'd write
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int main(int argc, char *argv[]) { /* ... */ }
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
but the basic structure is the same.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This is a clever syntactic idea that works well for simple types but can
|
||||
get confusing fast. The famous example is declaring a function pointer.
|
||||
Follow the rules and you get this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int (*fp)(int a, int b);
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Here, fp is a pointer to a function because if you write the expression
|
||||
(*fp)(a, b) you'll call a function that returns int. What if one of fp's
|
||||
arguments is itself a function?
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int (*fp)(int (*ff)(int x, int y), int b)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
That's starting to get hard to read.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Of course, we can leave out the name of the parameters when we declare a
|
||||
function, so main can be declared
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int main(int, char *[])
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Recall that argv is declared like this,
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
char *argv[]
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
so you drop the name from the <em>middle</em> of its declaration to construct
|
||||
its type. It's not obvious, though, that you declare something of type
|
||||
char *[] by putting its name in the middle.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
And look what happens to fp's declaration if you don't name the
|
||||
parameters:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int (*fp)(int (*)(int, int), int)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Not only is it not obvious where to put the name inside
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int (*)(int, int)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
it's not exactly clear that it's a function pointer declaration at all.
|
||||
And what if the return type is a function pointer?
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
int (*(*fp)(int (*)(int, int), int))(int, int)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
It's hard even to see that this declaration is about fp.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You can construct more elaborate examples but these should illustrate
|
||||
some of the difficulties that C's declaration syntax can introduce.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There's one more point that needs to be made, though. Because type and
|
||||
declaration syntax are the same, it can be difficult to parse
|
||||
expressions with types in the middle. This is why, for instance, C casts
|
||||
always parenthesize the type, as in
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
(int)M_PI
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
<b>Go syntax</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Languages outside the C family usually use a distinct type syntax in
|
||||
declarations. Although it's a separate point, the name usually comes
|
||||
first, often followed by a colon. Thus our examples above become
|
||||
something like (in a fictional but illustrative language)
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
x: int
|
||||
p: pointer to int
|
||||
a: array[3] of int
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
These declarations are clear, if verbose - you just read them left to
|
||||
right. Go takes its cue from here, but in the interests of brevity it
|
||||
drops the colon and removes some of the keywords:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
x int
|
||||
p *int
|
||||
a [3]int
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
There is no direct correspondence between the look of [3]int and how to
|
||||
use a in an expression. (We'll come back to pointers in the next
|
||||
section.) You gain clarity at the cost of a separate syntax.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Now consider functions. Let's transcribe the declaration for main, even
|
||||
though the main function in Go takes no arguments:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func main(argc int, argv *[]byte) int
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Superficially that's not much different from C, but it reads well from
|
||||
left to right:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<em>function main takes an int and a pointer to a slice of bytes and returns an int.</em>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Drop the parameter names and it's just as clear - they're always first
|
||||
so there's no confusion.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func main(int, *[]byte) int
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
One value of this left-to-right style is how well it works as the types
|
||||
become more complex. Here's a declaration of a function variable
|
||||
(analogous to a function pointer in C):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
f func(func(int,int) int, int) int
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Or if f returns a function:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
f func(func(int,int) int, int) func(int, int) int
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
It still reads clearly, from left to right, and it's always obvious
|
||||
which name is being declared - the name comes first.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The distinction between type and expression syntax makes it easy to
|
||||
write and invoke closures in Go:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
sum := func(a, b int) int { return a+b } (3, 4)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
<b>Pointers</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Pointers are the exception that proves the rule. Notice that in arrays
|
||||
and slices, for instance, Go's type syntax puts the brackets on the left
|
||||
of the type but the expression syntax puts them on the right of the
|
||||
expression:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
var a []int
|
||||
x = a[1]
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
For familiarity, Go's pointers use the * notation from C, but we could
|
||||
not bring ourselves to make a similar reversal for pointer types. Thus
|
||||
pointers work like this
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
var p *int
|
||||
x = *p
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
We couldn't say
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
var p *int
|
||||
x = p*
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
because that postfix * would conflate with multiplication. We could have
|
||||
used the Pascal ^, for example:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
var p ^int
|
||||
x = p^
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
and perhaps we should have (and chosen another operator for xor),
|
||||
because the prefix asterisk on both types and expressions complicates
|
||||
things in a number of ways. For instance, although one can write
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
[]int("hi")
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
as a conversion, one must parenthesize the type if it starts with a *:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
(*int)(nil)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Had we been willing to give up * as pointer syntax, those parentheses
|
||||
would be unnecessary.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
So Go's pointer syntax is tied to the familiar C form, but those ties
|
||||
mean that we cannot break completely from using parentheses to
|
||||
disambiguate types and expressions in the grammar.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Overall, though, we believe Go's type syntax is easier to understand
|
||||
than C's, especially when things get complicated.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Notes</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go's declarations read left to right. It's been pointed out that C's
|
||||
read in a spiral! See <a href="http://c-faq.com/decl/spiral.anderson.html">
|
||||
The "Clockwise/Spiral Rule"</a> by David Anderson.
|
||||
</p>
|
||||
BIN
doc/articles/image-20.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
doc/articles/image-2a.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
doc/articles/image-2b.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
doc/articles/image-2c.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
doc/articles/image-2d.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
doc/articles/image-2e.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
doc/articles/image-2f.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
doc/articles/image-package-01.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
doc/articles/image-package-02.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
doc/articles/image-package-03.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
doc/articles/image-package-04.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
doc/articles/image-package-05.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
222
doc/articles/image_draw.html
Normal file
@@ -0,0 +1,222 @@
|
||||
<!--{
|
||||
"Title": "The Go image/draw package",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
<a href="/pkg/image/draw/">Package image/draw</a> defines
|
||||
only one operation: drawing a source image onto a destination
|
||||
image, through an optional mask image. This one operation is
|
||||
surprisingly versatile and can perform a number of common image
|
||||
manipulation tasks elegantly and efficiently.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Composition is performed pixel by pixel in the style of the Plan 9
|
||||
graphics library and the X Render extension. The model is based on
|
||||
the classic "Compositing Digital Images" paper by Porter and Duff,
|
||||
with an additional mask parameter: <code>dst = (src IN mask) OP dst</code>.
|
||||
For a fully opaque mask, this reduces to the original Porter-Duff
|
||||
formula: <code>dst = src OP dst</code>. In Go, a nil mask image is equivalent
|
||||
to an infinitely sized, fully opaque mask image.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The Porter-Duff paper presented
|
||||
<a href="http://www.w3.org/TR/SVGCompositing/examples/compop-porterduff-examples.png">12 different composition operators</a>,
|
||||
but with an explicit mask, only 2 of these are needed in practice:
|
||||
source-over-destination and source. In Go, these operators are
|
||||
represented by the <code>Over</code> and <code>Src</code> constants. The <code>Over</code> operator
|
||||
performs the natural layering of a source image over a destination
|
||||
image: the change to the destination image is smaller where the
|
||||
source (after masking) is more transparent (that is, has lower
|
||||
alpha). The <code>Src</code> operator merely copies the source (after masking)
|
||||
with no regard for the destination image's original content. For
|
||||
fully opaque source and mask images, the two operators produce the
|
||||
same output, but the <code>Src</code> operator is usually faster.
|
||||
</p>
|
||||
|
||||
<p><b>Geometric Alignment</b></p>
|
||||
|
||||
<p>
|
||||
Composition requires associating destination pixels with source and
|
||||
mask pixels. Obviously, this requires destination, source and mask
|
||||
images, and a composition operator, but it also requires specifying
|
||||
what rectangle of each image to use. Not every drawing should write
|
||||
to the entire destination: when updating an animating image, it is
|
||||
more efficient to only draw the parts of the image that have
|
||||
changed. Not every drawing should read from the entire source: when
|
||||
using a sprite that combines many small images into one large one,
|
||||
only a part of the image is needed. Not every drawing should read
|
||||
from the entire mask: a mask image that collects a font's glyphs is
|
||||
similar to a sprite. Thus, drawing also needs to know three
|
||||
rectangles, one for each image. Since each rectangle has the same
|
||||
width and height, it suffices to pass a destination rectangle `r`
|
||||
and two points <code>sp</code> and <code>mp</code>: the source rectangle is equal to <code>r</code>
|
||||
translated so that <code>r.Min</code> in the destination image aligns with
|
||||
<code>sp</code> in the source image, and similarly for <code>mp</code>. The effective
|
||||
rectangle is also clipped to each image's bounds in their
|
||||
respective co-ordinate space.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img src="image-20.png">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <a href="/pkg/image/draw/#DrawMask"><code>DrawMask</code></a>
|
||||
function takes seven arguments, but an explicit mask and mask-point
|
||||
are usually unnecessary, so the
|
||||
<a href="/pkg/image/draw/#Draw"><code>Draw</code></a> function takes five:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// Draw calls DrawMask with a nil mask.
|
||||
func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)
|
||||
func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point,
|
||||
mask image.Image, mp image.Point, op Op)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The destination image must be mutable, so the image/draw package
|
||||
defines a <a href="/pkg/image/draw/#Image"><code>draw.Image</code></a>
|
||||
interface which has a <code>Set</code> method.
|
||||
</p>
|
||||
|
||||
{{code "../src/pkg/image/draw/draw.go" `/type Image/` `/}/`}}
|
||||
|
||||
<p><b>Filling a Rectangle</b></p>
|
||||
|
||||
<p>
|
||||
To fill a rectangle with a solid color, use an <code>image.Uniform</code>
|
||||
source. The <code>Uniform</code> type re-interprets a <code>Color</code> as a
|
||||
practically infinite-sized <code>Image</code> of that color. For those
|
||||
familiar with the design of Plan 9's draw library, there is no need
|
||||
for an explicit "repeat bit" in Go's slice-based image types; the
|
||||
concept is subsumed by <code>Uniform</code>.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_draw.go" `/ZERO/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
To initialize a new image to all-blue:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_draw.go" `/BLUE/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
To reset an image to transparent (or black, if the destination
|
||||
image's color model cannot represent transparency), use
|
||||
<code>image.Transparent</code>, which is an <code>image.Uniform</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_draw.go" `/RESET/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
<img src="image-2a.png">
|
||||
</p>
|
||||
|
||||
|
||||
<p><b>Copying an Image</b></p>
|
||||
|
||||
<p>
|
||||
To copy from a rectangle <code>sr</code> in the source image to a rectangle
|
||||
starting at a point <code>dp</code> in the destination, convert the source
|
||||
rectangle into the destination image's co-ordinate space:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_draw.go" `/RECT/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Alternatively:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_draw.go" `/RECT2/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
To copy the entire source image, use <code>sr = src.Bounds()</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img src="image-2b.png">
|
||||
</p>
|
||||
|
||||
<p><b>Scrolling an Image</b></p>
|
||||
|
||||
<p>
|
||||
Scrolling an image is just copying an image to itself, with
|
||||
different destination and source rectangles. Overlapping
|
||||
destination and source images are perfectly valid, just as Go's
|
||||
built-in copy function can handle overlapping destination and
|
||||
source slices. To scroll an image m by 20 pixels:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_draw.go" `/SCROLL/` `/STOP/`}}
|
||||
|
||||
<p><img src="image-2c.png"></p>
|
||||
|
||||
<p><b>Converting an Image to RGBA</b></p>
|
||||
|
||||
<p>
|
||||
The result of decoding an image format might not be an
|
||||
<code>image.RGBA</code>: decoding a GIF results in an <code>image.Paletted</code>,
|
||||
decoding a JPEG results in a <code>ycbcr.YCbCr</code>, and the result of
|
||||
decoding a PNG depends on the image data. To convert any image to
|
||||
an <code>image.RGBA</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_draw.go" `/CONV/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
<img src="image-2d.png">
|
||||
</p>
|
||||
|
||||
<p><b>Drawing Through a Mask</b></p>
|
||||
|
||||
<p>
|
||||
To draw an image through a circular mask with center <code>p</code> and radius
|
||||
<code>r</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_draw.go" `/CIRCLESTRUCT/` `/STOP/`}}
|
||||
{{code "/doc/progs/image_draw.go" `/CIRCLE2/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
<img src="image-2e.png">
|
||||
</p>
|
||||
|
||||
<p><b>Drawing Font Glyphs</b></p>
|
||||
|
||||
<p>
|
||||
To draw a font glyph in blue starting from a point <code>p</code>, draw with
|
||||
an <code>image.Uniform</code> source and an <code>image.Alpha mask</code>. For
|
||||
simplicity, we aren't performing any sub-pixel positioning or
|
||||
rendering, or correcting for a font's height above a baseline.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_draw.go" `/GLYPH/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
<img src="image-2f.png">
|
||||
</p>
|
||||
|
||||
<p><b>Performance</b></p>
|
||||
|
||||
<p>
|
||||
The image/draw package implementation demonstrates how to provide
|
||||
an image manipulation function that is both general purpose, yet
|
||||
efficient for common cases. The <code>DrawMask</code> function takes arguments
|
||||
of interface types, but immediately makes type assertions that its
|
||||
arguments are of specific struct types, corresponding to common
|
||||
operations like drawing one <code>image.RGBA</code> image onto another, or
|
||||
drawing an <code>image.Alpha</code> mask (such as a font glyph) onto an
|
||||
<code>image.RGBA</code> image. If a type assertion succeeds, that type
|
||||
information is used to run a specialized implementation of the
|
||||
general algorithm. If the assertions fail, the fallback code path
|
||||
uses the generic <code>At</code> and <code>Set</code> methods. The fast-paths are purely
|
||||
a performance optimization; the resultant destination image is the
|
||||
same either way. In practice, only a small number of special cases
|
||||
are necessary to support typical applications.
|
||||
</p>
|
||||
|
||||
|
||||
312
doc/articles/image_package.html
Normal file
@@ -0,0 +1,312 @@
|
||||
<!--{
|
||||
"Title": "The Go image package",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
The <a href="/pkg/image/">image</a> and
|
||||
<a href="/pkg/image/color/">image/color</a> packages define a number of types:
|
||||
<code>color.Color</code> and <code>color.Model</code> describe colors,
|
||||
<code>image.Point</code> and <code>image.Rectangle</code> describe basic 2-D
|
||||
geometry, and <code>image.Image</code> brings the two concepts together to
|
||||
represent a rectangular grid of colors. A
|
||||
<a href="/doc/articles/image_draw.html">separate article</a> covers image
|
||||
composition with the <a href="/pkg/image/draw/">image/draw</a> package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Colors and Color Models</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/image/color/#Color">Color</a> is an interface that defines the minimal
|
||||
method set of any type that can be considered a color: one that can be converted
|
||||
to red, green, blue and alpha values. The conversion may be lossy, such as
|
||||
converting from CMYK or YCbCr color spaces.
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/image/color/color.go" `/type Color interface/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
There are three important subtleties about the return values. First, the red,
|
||||
green and blue are alpha-premultiplied: a fully saturated red that is also 25%
|
||||
transparent is represented by RGBA returning a 75% r. Second, the channels have
|
||||
a 16-bit effective range: 100% red is represented by RGBA returning an r of
|
||||
65535, not 255, so that converting from CMYK or YCbCr is not as lossy. Third,
|
||||
the type returned is <code>uint32</code>, even though the maximum value is 65535, to
|
||||
guarantee that multiplying two values together won't overflow. Such
|
||||
multiplications occur when blending two colors according to an alpha mask from a
|
||||
third color, in the style of
|
||||
<a href="https://en.wikipedia.org/wiki/Alpha_compositing">Porter and Duff's</a>
|
||||
classic algebra:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
dstr, dstg, dstb, dsta := dst.RGBA()
|
||||
srcr, srcg, srcb, srca := src.RGBA()
|
||||
_, _, _, m := mask.RGBA()
|
||||
const M = 1<<16 - 1
|
||||
// The resultant red value is a blend of dstr and srcr, and ranges in [0, M].
|
||||
// The calculation for green, blue and alpha is similar.
|
||||
dstr = (dstr*(M-m) + srcr*m) / M
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The last line of that code snippet would have been more complicated if we worked
|
||||
with non-alpha-premultiplied colors, which is why <code>Color</code> uses
|
||||
alpha-premultiplied values.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The image/color package also defines a number of concrete types that implement
|
||||
the <code>Color</code> interface. For example,
|
||||
<a href="/pkg/image/color/#RGBA"><code>RGBA</code></a> is a struct that represents
|
||||
the classic "8 bits per channel" color.
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/image/color/color.go" `/type RGBA struct/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
Note that the <code>R</code> field of an <code>RGBA</code> is an 8-bit
|
||||
alpha-premultiplied color in the range [0, 255]. <code>RGBA</code> satisfies the
|
||||
<code>Color</code> interface by multiplying that value by 0x101 to generate a
|
||||
16-bit alpha-premultiplied color in the range [0, 65535]. Similarly, the
|
||||
<a href="/pkg/image/color/#NRGBA"><code>NRGBA</code></a> struct type represents
|
||||
an 8-bit non-alpha-premultiplied color, as used by the PNG image format. When
|
||||
manipulating an <code>NRGBA</code>'s fields directly, the values are
|
||||
non-alpha-premultiplied, but when calling the <code>RGBA</code> method, the
|
||||
return values are alpha-premultiplied.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <a href="/pkg/image/color/#Model"><code>Model</code></a> is simply
|
||||
something that can convert <code>Color</code>s to other <code>Color</code>s, possibly lossily. For
|
||||
example, the <code>GrayModel</code> can convert any <code>Color</code> to a
|
||||
desaturated <a href="/pkg/image/color/#Gray"><code>Gray</code></a>. A
|
||||
<code>Palette</code> can convert any <code>Color</code> to one from a
|
||||
limited palette.
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/image/color/color.go" `/type Model interface/` `/^}/`}}
|
||||
|
||||
{{code "/src/pkg/image/color/color.go" `/type Palette \[\]Color/`}}
|
||||
|
||||
<p>
|
||||
<b>Points and Rectangles</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <a href="/pkg/image/#Point"><code>Point</code></a> is an (x, y) co-ordinate
|
||||
on the integer grid, with axes increasing right and down. It is neither a pixel
|
||||
nor a grid square. A <code>Point</code> has no intrinsic width, height or
|
||||
color, but the visualizations below use a small colored square.
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/image/geom.go" `/type Point struct/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
<img src="image-package-01.png" width="400" height="300">
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_package1.go" `/p := image.Point/`}}
|
||||
|
||||
<p>
|
||||
A <a href="/pkg/image/#Rectangle"><code>Rectangle</code></a> is an axis-aligned
|
||||
rectangle on the integer grid, defined by its top-left and bottom-right
|
||||
<code>Point</code>. A <code>Rectangle</code> also has no intrinsic color, but
|
||||
the visualizations below outline rectangles with a thin colored line, and call
|
||||
out their <code>Min</code> and <code>Max</code> <code>Point</code>s.
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/image/geom.go" `/type Rectangle struct/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
For convenience, <code>image.Rect(x0, y0, x1, y1)</code> is equivalent to
|
||||
<code>image.Rectangle{image.Point{x0, y0}, image.Point{x1, y1}}</code>, but is
|
||||
much easier to type.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <code>Rectangle</code> is inclusive at the top-left and exclusive at the
|
||||
bottom-right. For a <code>Point p</code> and a <code>Rectangle r</code>,
|
||||
<code>p.In(r)</code> if and only if
|
||||
<code>r.Min.X <= p.X && p.X < r.Max.X</code>, and similarly for <code>Y</code>. This is analogous to how
|
||||
a slice <code>s[i0:i1]</code> is inclusive at the low end and exclusive at the
|
||||
high end. (Unlike arrays and slices, a <code>Rectangle</code> often has a
|
||||
non-zero origin.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img src="image-package-02.png" width="400" height="300">
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_package2.go" `/r := image.Rect/` `/fmt.Println/`}}
|
||||
|
||||
<p>
|
||||
Adding a <code>Point</code> to a <code>Rectangle</code> translates the
|
||||
<code>Rectangle</code>. Points and Rectangles are not restricted to be in the
|
||||
bottom-right quadrant.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img src="image-package-03.png" width="400" height="300">
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_package3.go" `/r := image.Rect/` `/fmt.Println/`}}
|
||||
|
||||
<p>
|
||||
Intersecting two Rectangles yields another Rectangle, which may be empty.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img src="image-package-04.png" width="400" height="300">
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_package4.go" `/r := image.Rect/` `/fmt.Printf/`}}
|
||||
|
||||
<p>
|
||||
Points and Rectangles are passed and returned by value. A function that takes a
|
||||
<code>Rectangle</code> argument will be as efficient as a function that takes
|
||||
two <code>Point</code> arguments, or four <code>int</code> arguments.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Images</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
An <a href="/pkg/image/#Image">Image</a> maps every grid square in a
|
||||
<code>Rectangle</code> to a <code>Color</code> from a <code>Model</code>.
|
||||
"The pixel at (x, y)" refers to the color of the grid square defined by the
|
||||
points (x, y), (x+1, y), (x+1, y+1) and (x, y+1).
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/image/image.go" `/type Image interface/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
A common mistake is assuming that an <code>Image</code>'s bounds start at (0,
|
||||
0). For example, an animated GIF contains a sequence of Images, and each
|
||||
<code>Image</code> after the first typically only holds pixel data for the area
|
||||
that changed, and that area doesn't necessarily start at (0, 0). The correct
|
||||
way to iterate over an <code>Image</code> m's pixels looks like:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
b := m.Bounds()
|
||||
for y := b.Min.Y; y < b.Max.Y; y++ {
|
||||
for x := b.Min.X; x < b.Max.X; x++ {
|
||||
doStuffWith(m.At(x, y))
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
<code>Image</code> implementations do not have to be based on an in-memory
|
||||
slice of pixel data. For example, a
|
||||
<a href="/pkg/image/#Uniform"><code>Uniform</code></a> is an
|
||||
<code>Image</code> of enormous bounds and uniform color, whose in-memory
|
||||
representation is simply that color.
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/image/names.go" `/type Uniform struct/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
Typically, though, programs will want an image based on a slice. Struct types
|
||||
like <a href="/pkg/image/#RGBA"><code>RGBA</code></a> and
|
||||
<a href="/pkg/image/#Gray"><code>Gray</code></a> (which other packages refer
|
||||
to as <code>image.RGBA</code> and <code>image.Gray</code>) hold slices of pixel
|
||||
data and implement the <code>Image</code> interface.
|
||||
</p>
|
||||
|
||||
{{code "/src/pkg/image/image.go" `/type RGBA struct/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
These types also provide a <code>Set(x, y int, c color.Color)</code> method
|
||||
that allows modifying the image one pixel at a time.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/image_package5.go" `/m := image.New/` `/m.Set/`}}
|
||||
|
||||
<p>
|
||||
If you're reading or writing a lot of pixel data, it can be more efficient, but
|
||||
more complicated, to access these struct type's <code>Pix</code> field directly.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The slice-based <code>Image</code> implementations also provide a
|
||||
<code>SubImage</code> method, which returns an <code>Image</code> backed by the
|
||||
same array. Modifying the pixels of a sub-image will affect the pixels of the
|
||||
original image, analogous to how modifying the contents of a sub-slice
|
||||
<code>s[i0:i1]</code> will affect the contents of the original slice
|
||||
<code>s</code>.
|
||||
</p>
|
||||
|
||||
<img src="image-package-05.png" width="400" height="300">
|
||||
|
||||
{{code "/doc/progs/image_package6.go" `/m0 := image.New/` `/fmt.Println\(m0.Stride/`}}
|
||||
|
||||
<p>
|
||||
For low-level code that works on an image's <code>Pix</code> field, be aware
|
||||
that ranging over <code>Pix</code> can affect pixels outside an image's bounds.
|
||||
In the example above, the pixels covered by <code>m1.Pix</code> are shaded in
|
||||
blue. Higher-level code, such as the <code>At</code> and <code>Set</code>
|
||||
methods or the <a href="/pkg/image/draw/">image/draw package</a>, will clip
|
||||
their operations to the image's bounds.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Image Formats</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The standard package library supports a number of common image formats, such as
|
||||
GIF, JPEG and PNG. If you know the format of a source image file, you can
|
||||
decode from an <a href="/pkg/io/#Reader"><code>io.Reader</code></a> directly.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
import (
|
||||
"image/jpeg"
|
||||
"image/png"
|
||||
"io"
|
||||
)
|
||||
|
||||
// convertJPEGToPNG converts from JPEG to PNG.
|
||||
func convertJPEGToPNG(w io.Writer, r io.Reader) error {
|
||||
img, err := jpeg.Decode(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return png.Encode(w, img)
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If you have image data of unknown format, the
|
||||
<a href="/pkg/image/#Decode"><code>image.Decode</code></a> function can detect
|
||||
the format. The set of recognized formats is constructed at run time and is not
|
||||
limited to those in the standard package library. An image format package
|
||||
typically registers its format in an init function, and the main package will
|
||||
"underscore import" such a package solely for the side effect of format
|
||||
registration.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
import (
|
||||
"image"
|
||||
"image/png"
|
||||
"io"
|
||||
|
||||
_ "code.google.com/p/vp8-go/webp"
|
||||
_ "image/jpeg"
|
||||
)
|
||||
|
||||
// convertToPNG converts from any recognized format to PNG.
|
||||
func convertToPNG(w io.Writer, r io.Reader) error {
|
||||
img, _, err := image.Decode(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return png.Encode(w, img)
|
||||
}
|
||||
</pre>
|
||||
@@ -3,6 +3,5 @@
|
||||
}-->
|
||||
|
||||
<p>
|
||||
See the <a href="/doc/#articles">Documents page</a> and the
|
||||
<a href="/blog/index">Blog index</a> for a complete list of Go articles.
|
||||
See the <a href="/doc/#articles">Documents page</a> for a complete list of Go articles.
|
||||
</p>
|
||||
|
||||
357
doc/articles/json_and_go.html
Normal file
@@ -0,0 +1,357 @@
|
||||
<!--{
|
||||
"Title": "JSON and Go",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
JSON (JavaScript Object Notation) is a simple data interchange format.
|
||||
Syntactically it resembles the objects and lists of JavaScript. It is most
|
||||
commonly used for communication between web back-ends and JavaScript programs
|
||||
running in the browser, but it is used in many other places, too. Its home page,
|
||||
<a href="http://json.org">json.org</a>, provides a wonderfully clear and concise
|
||||
definition of the standard.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
With the <a href="/pkg/encoding/json/">json package</a> it's a snap to read and
|
||||
write JSON data from your Go programs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Encoding</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To encode JSON data we use the
|
||||
<a href="/pkg/encoding/json/#Marshal"><code>Marshal</code></a> function.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func Marshal(v interface{}) ([]byte, error)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Given the Go data structure, <code>Message</code>,
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json1.go" `/type Message/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
and an instance of <code>Message</code>
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json1.go" `/m :=/`}}
|
||||
|
||||
<p>
|
||||
we can marshal a JSON-encoded version of <code>m</code> using <code>json.Marshal</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json1.go" `/b, err :=/`}}
|
||||
|
||||
<p>
|
||||
If all is well, <code>err</code> will be <code>nil</code> and <code>b</code>
|
||||
will be a <code>[]byte</code> containing this JSON data:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
b == []byte(`{"Name":"Alice","Body":"Hello","Time":1294706395881547000}`)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Only data structures that can be represented as valid JSON will be encoded:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
JSON objects only support strings as keys; to encode a Go map type it must be
|
||||
of the form <code>map[string]T</code> (where <code>T</code> is any Go type
|
||||
supported by the json package).
|
||||
</li>
|
||||
<li>
|
||||
Channel, complex, and function types cannot be encoded.
|
||||
</li>
|
||||
<li>
|
||||
Cyclic data structures are not supported; they will cause <code>Marshal</code>
|
||||
to go into an infinite loop.
|
||||
</li>
|
||||
<li>
|
||||
Pointers will be encoded as the values they point to (or 'null' if the pointer
|
||||
is <code>nil</code>).
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The json package only accesses the exported fields of struct types (those that
|
||||
begin with an uppercase letter). Therefore only the exported fields of a struct
|
||||
will be present in the JSON output.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Decoding</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To decode JSON data we use the
|
||||
<a href="/pkg/encoding/json/#Unmarshal"><code>Unmarshal</code></a> function.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func Unmarshal(data []byte, v interface{}) error
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
We must first create a place where the decoded data will be stored
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json1.go" `/var m Message/`}}
|
||||
|
||||
<p>
|
||||
and call <code>json.Unmarshal</code>, passing it a <code>[]byte</code> of JSON
|
||||
data and a pointer to <code>m</code>
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json1.go" `/err := json.Unmarshal/`}}
|
||||
|
||||
<p>
|
||||
If <code>b</code> contains valid JSON that fits in <code>m</code>, after the
|
||||
call <code>err</code> will be <code>nil</code> and the data from <code>b</code>
|
||||
will have been stored in the struct <code>m</code>, as if by an assignment
|
||||
like:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json1.go" `/m = Message/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
How does <code>Unmarshal</code> identify the fields in which to store the
|
||||
decoded data? For a given JSON key <code>"Foo"</code>, <code>Unmarshal</code>
|
||||
will look through the destination struct's fields to find (in order of
|
||||
preference):
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
An exported field with a tag of <code>`json:"Foo"`</code> (see the
|
||||
<a href="/ref/spec#Struct_types">Go spec</a> for more on struct tags),
|
||||
</li>
|
||||
<li>
|
||||
An exported field named <code>"Foo"</code>, or
|
||||
</li>
|
||||
<li>
|
||||
An exported field named <code>"FOO"</code> or <code>"FoO"</code> or some other
|
||||
case-insensitive match of <code>"Foo"</code>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
What happens when the structure of the JSON data doesn't exactly match the Go
|
||||
type?
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json1.go" `/"Food":"Pickle"/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
<code>Unmarshal</code> will decode only the fields that it can find in the
|
||||
destination type. In this case, only the <code>Name</code> field of m will be
|
||||
populated, and the <code>Food</code> field will be ignored. This behavior is
|
||||
particularly useful when you wish to pick only a few specific fields out of a
|
||||
large JSON blob. It also means that any unexported fields in the destination
|
||||
struct will be unaffected by <code>Unmarshal</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
But what if you don't know the structure of your JSON data beforehand?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Generic JSON with <code>interface{}</code></b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>interface{}</code> (empty interface) type describes an interface with
|
||||
zero methods. Every Go type implements at least zero methods and therefore
|
||||
satisfies the empty interface.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The empty interface serves as a general container type:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json2.go" `/var i interface{}/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
A type assertion accesses the underlying concrete type:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json2.go" `/r := i/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Or, if the underlying type is unknown, a type switch determines the type:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json2.go" `/switch v/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The json package uses <code>map[string]interface{}</code> and
|
||||
<code>[]interface{}</code> values to store arbitrary JSON objects and arrays;
|
||||
it will happily unmarshal any valid JSON blob into a plain
|
||||
<code>interface{}</code> value. The default concrete Go types are:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<code>bool</code> for JSON booleans,
|
||||
</li>
|
||||
<li>
|
||||
<code>float64</code> for JSON numbers,
|
||||
</li>
|
||||
<li>
|
||||
<code>string</code> for JSON strings, and
|
||||
</li>
|
||||
<li>
|
||||
<code>nil</code> for JSON null.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<b>Decoding arbitrary data</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Consider this JSON data, stored in the variable <code>b</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json3.go" `/b :=/`}}
|
||||
|
||||
<p>
|
||||
Without knowing this data's structure, we can decode it into an
|
||||
<code>interface{}</code> value with <code>Unmarshal</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json3.go" `/var f interface/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
At this point the Go value in <code>f</code> would be a map whose keys are
|
||||
strings and whose values are themselves stored as empty interface values:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json3.go" `/f = map/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
To access this data we can use a type assertion to access <code>f</code>'s
|
||||
underlying <code>map[string]interface{}</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json3.go" `/m := f/`}}
|
||||
|
||||
<p>
|
||||
We can then iterate through the map with a range statement and use a type switch
|
||||
to access its values as their concrete types:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json3.go" `/for k, v/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
In this way you can work with unknown JSON data while still enjoying the
|
||||
benefits of type safety.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Reference Types</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Let's define a Go type to contain the data from the previous example:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json4.go" `/type FamilyMember/` `/STOP/`}}
|
||||
|
||||
{{code "/doc/progs/json4.go" `/var m FamilyMember/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Unmarshaling that data into a <code>FamilyMember</code> value works as
|
||||
expected, but if we look closely we can see a remarkable thing has happened.
|
||||
With the var statement we allocated a <code>FamilyMember</code> struct, and
|
||||
then provided a pointer to that value to <code>Unmarshal</code>, but at that
|
||||
time the <code>Parents</code> field was a <code>nil</code> slice value. To
|
||||
populate the <code>Parents</code> field, <code>Unmarshal</code> allocated a new
|
||||
slice behind the scenes. This is typical of how <code>Unmarshal</code> works
|
||||
with the supported reference types (pointers, slices, and maps).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Consider unmarshaling into this data structure:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
type Foo struct {
|
||||
Bar *Bar
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If there were a <code>Bar</code> field in the JSON object,
|
||||
<code>Unmarshal</code> would allocate a new <code>Bar</code> and populate it.
|
||||
If not, <code>Bar</code> would be left as a <code>nil</code> pointer.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
From this a useful pattern arises: if you have an application that receives a
|
||||
few distinct message types, you might define "receiver" structure like
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
type IncomingMessage struct {
|
||||
Cmd *Command
|
||||
Msg *Message
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
and the sending party can populate the <code>Cmd</code> field and/or the
|
||||
<code>Msg</code> field of the top-level JSON object, depending on the type of
|
||||
message they want to communicate. <code>Unmarshal</code>, when decoding the
|
||||
JSON into an <code>IncomingMessage</code> struct, will only allocate the data
|
||||
structures present in the JSON data. To know which messages to process, the
|
||||
programmer need simply test that either <code>Cmd</code> or <code>Msg</code> is
|
||||
not <code>nil</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Streaming Encoders and Decoders</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The json package provides <code>Decoder</code> and <code>Encoder</code> types
|
||||
to support the common operation of reading and writing streams of JSON data.
|
||||
The <code>NewDecoder</code> and <code>NewEncoder</code> functions wrap the
|
||||
<a href="/pkg/io/#Reader"><code>io.Reader</code></a> and
|
||||
<a href="/pkg/io/#Writer"><code>io.Writer</code></a> interface types.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func NewDecoder(r io.Reader) *Decoder
|
||||
func NewEncoder(w io.Writer) *Encoder
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Here's an example program that reads a series of JSON objects from standard
|
||||
input, removes all but the <code>Name</code> field from each object, and then
|
||||
writes the objects to standard output:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/json5.go" `/package main/` `$`}}
|
||||
|
||||
<p>
|
||||
Due to the ubiquity of Readers and Writers, these <code>Encoder</code> and
|
||||
<code>Decoder</code> types can be used in a broad range of scenarios, such as
|
||||
reading and writing to HTTP connections, WebSockets, or files.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>References</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For more information see the <a href="/pkg/encoding/json/">json package documentation</a>. For an example usage of
|
||||
json see the source files of the <a href="/pkg/net/rpc/jsonrpc/">jsonrpc package</a>.
|
||||
</p>
|
||||
78
doc/articles/json_rpc_tale_of_interfaces.html
Normal file
@@ -0,0 +1,78 @@
|
||||
<!--{
|
||||
"Title": "JSON-RPC: a tale of interfaces"
|
||||
}-->
|
||||
|
||||
<p>
|
||||
Here we present an example where Go's
|
||||
<a href="/doc/effective_go.html#interfaces_and_types">interfaces</a> made it
|
||||
easy to refactor some existing code to make it more flexible and extensible.
|
||||
Originally, the standard library's <a href="/pkg/net/rpc/">RPC package</a> used
|
||||
a custom wire format called <a href="/pkg/encoding/gob/">gob</a>. For a
|
||||
particular application, we wanted to use <a href="/pkg/encoding/json/">JSON</a>
|
||||
as an alternate wire format.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
We first defined a pair of interfaces to describe the functionality of the
|
||||
existing wire format, one for the client, and one for the server (depicted
|
||||
below).
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
type ServerCodec interface {
|
||||
ReadRequestHeader(*Request) error
|
||||
ReadRequestBody(interface{}) error
|
||||
WriteResponse(*Response, interface{}) error
|
||||
Close() error
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
On the server side, we then changed two internal function signatures to accept
|
||||
the <code>ServerCodec</code> interface instead of our existing
|
||||
<code>gob.Encoder</code>. Here's one of them:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func sendResponse(sending *sync.Mutex, req *Request,
|
||||
reply interface{}, enc *gob.Encoder, errmsg string)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
became
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func sendResponse(sending *sync.Mutex, req *Request,
|
||||
reply interface{}, enc ServerCodec, errmsg string)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
We then wrote a trivial <code>gobServerCodec</code> wrapper to reproduce the
|
||||
original functionality. From there it is simple to build a
|
||||
<code>jsonServerCodec</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
After some similar changes to the client side, this was the full extent of the
|
||||
work we needed to do on the RPC package. This whole exercise took about 20
|
||||
minutes! After tidying up and testing the new code, the
|
||||
<a href="http://code.google.com/p/go/source/diff?spec=svn9daf796ebf1cae97b2fcf760a4ab682f1f063f29&r=9daf796ebf1cae97b2fcf760a4ab682f1f063f29&format=side&path=/src/pkg/rpc/server.go">final changeset</a>
|
||||
was submitted.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In an inheritance-oriented language like Java or C++, the obvious path would be
|
||||
to generalize the RPC class, and create JsonRPC and GobRPC subclasses. However,
|
||||
this approach becomes tricky if you want to make a further generalization
|
||||
orthogonal to that hierarchy. (For example, if you were to implement an
|
||||
alternate RPC standard). In our Go package, we took a route that is both
|
||||
conceptually simpler and requires less code be written or changed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A vital quality for any codebase is maintainability. As needs change, it is
|
||||
essential to adapt your code easily and cleanly, lest it become unwieldy to work
|
||||
with. We believe Go's lightweight, composition-oriented type system provides a
|
||||
means of structuring code that scales.
|
||||
</p>
|
||||
649
doc/articles/laws_of_reflection.html
Normal file
@@ -0,0 +1,649 @@
|
||||
<!--{
|
||||
"Title": "The Laws of Reflection",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
Reflection in computing is the
|
||||
ability of a program to examine its own structure, particularly
|
||||
through types; it's a form of metaprogramming. It's also a great
|
||||
source of confusion.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In this article we attempt to clarify things by explaining how
|
||||
reflection works in Go. Each language's reflection model is
|
||||
different (and many languages don't support it at all), but
|
||||
this article is about Go, so for the rest of this article the word
|
||||
"reflection" should be taken to mean "reflection in Go".
|
||||
</p>
|
||||
|
||||
<p><b>Types and interfaces</b></p>
|
||||
|
||||
<p>
|
||||
Because reflection builds on the type system, let's start with a
|
||||
refresher about types in Go.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go is statically typed. Every variable has a static type, that is,
|
||||
exactly one type known and fixed at compile time: <code>int</code>,
|
||||
<code>float32</code>, <code>*MyType</code>, <code>[]byte</code>,
|
||||
and so on. If we declare
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface.go" `/type MyInt/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
then <code>i</code> has type <code>int</code> and <code>j</code>
|
||||
has type <code>MyInt</code>. The variables <code>i</code> and
|
||||
<code>j</code> have distinct static types and, although they have
|
||||
the same underlying type, they cannot be assigned to one another
|
||||
without a conversion.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
One important category of type is interface types, which represent
|
||||
fixed sets of methods. An interface variable can store any concrete
|
||||
(non-interface) value as long as that value implements the
|
||||
interface's methods. A well-known pair of examples is
|
||||
<code>io.Reader</code> and <code>io.Writer</code>, the types
|
||||
<code>Reader</code> and <code>Writer</code> from the
|
||||
<a href="/pkg/io/">io package</a>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface.go" `/// Reader/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Any type that implements a <code>Read</code> (or
|
||||
<code>Write</code>) method with this signature is said to implement
|
||||
<code>io.Reader</code> (or <code>io.Writer</code>). For the
|
||||
purposes of this discussion, that means that a variable of type
|
||||
<code>io.Reader</code> can hold any value whose type has a
|
||||
<code>Read</code> method:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface.go" `/func readers/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
It's important to be clear that whatever concrete value
|
||||
<code>r</code> may hold, <code>r</code>'s type is always
|
||||
<code>io.Reader</code>: Go is statically typed and the static type
|
||||
of <code>r</code> is <code>io.Reader</code>.</p>
|
||||
|
||||
<p>
|
||||
An extremely important example of an interface type is the empty
|
||||
interface:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
interface{}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
It represents the empty set of methods and is satisfied by any
|
||||
value at all, since any value has zero or more methods.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Some people say that Go's interfaces are dynamically typed, but
|
||||
that is misleading. They are statically typed: a variable of
|
||||
interface type always has the same static type, and even though at
|
||||
run time the value stored in the interface variable may change
|
||||
type, that value will always satisfy the interface.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
We need to be precise about all this because reflection and
|
||||
interfaces are closely related.
|
||||
</p>
|
||||
|
||||
<p><b>The representation of an interface</b></p>
|
||||
|
||||
<p>
|
||||
Russ Cox has written a
|
||||
<a href="http://research.swtch.com/2009/12/go-data-structures-interfaces.html">detailed blog post</a>
|
||||
about the representation of interface values in Go. It's not necessary to
|
||||
repeat the full story here, but a simplified summary is in order.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A variable of interface type stores a pair: the concrete value
|
||||
assigned to the variable, and that value's type descriptor.
|
||||
To be more precise, the value is the underlying concrete data item
|
||||
that implements the interface and the type describes the full type
|
||||
of that item. For instance, after
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface.go" `/func typeAssertions/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
<code>r</code> contains, schematically, the (value, type) pair,
|
||||
(<code>tty</code>, <code>*os.File</code>). Notice that the type
|
||||
<code>*os.File</code> implements methods other than
|
||||
<code>Read</code>; even though the interface value provides access
|
||||
only to the <code>Read</code> method, the value inside carries all
|
||||
the type information about that value. That's why we can do things
|
||||
like this:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface.go" `/var w io.Writer/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The expression in this assignment is a type assertion; what it
|
||||
asserts is that the item inside <code>r</code> also implements
|
||||
<code>io.Writer</code>, and so we can assign it to <code>w</code>.
|
||||
After the assignment, <code>w</code> will contain the pair
|
||||
(<code>tty</code>, <code>*os.File</code>). That's the same pair as
|
||||
was held in <code>r</code>. The static type of the interface
|
||||
determines what methods may be invoked with an interface variable,
|
||||
even though the concrete value inside may have a larger set of
|
||||
methods.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Continuing, we can do this:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface.go" `/var empty interface{}/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
and our empty interface value <code>e</code> will again contain
|
||||
that same pair, (<code>tty</code>, <code>*os.File</code>). That's
|
||||
handy: an empty interface can hold any value and contains all the
|
||||
information we could ever need about that value.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
(We don't need a type assertion here because it's known statically
|
||||
that <code>w</code> satisfies the empty interface. In the example
|
||||
where we moved a value from a <code>Reader</code> to a
|
||||
<code>Writer</code>, we needed to be explicit and use a type
|
||||
assertion because <code>Writer</code>'s methods are not a
|
||||
subset of <code>Reader</code>'s.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
One important detail is that the pair inside an interface always
|
||||
has the form (value, concrete type) and cannot have the form
|
||||
(value, interface type). Interfaces do not hold interface
|
||||
values.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Now we're ready to reflect.
|
||||
</p>
|
||||
|
||||
<p><b>The first law of reflection</b></p>
|
||||
|
||||
<p><b>1. Reflection goes from interface value to reflection object.</b></p>
|
||||
|
||||
<p>
|
||||
At the basic level, reflection is just a mechanism to examine the
|
||||
type and value pair stored inside an interface variable. To get
|
||||
started, there are two types we need to know about in
|
||||
<a href="/pkg/reflect/">package reflect</a>:
|
||||
<a href="/pkg/reflect/#Type">Type</a> and
|
||||
<a href="/pkg/reflect/#Value">Value</a>. Those two types
|
||||
give access to the contents of an interface variable, and two
|
||||
simple functions, called <code>reflect.TypeOf</code> and
|
||||
<code>reflect.ValueOf</code>, retrieve <code>reflect.Type</code>
|
||||
and <code>reflect.Value</code> pieces out of an interface value.
|
||||
(Also, from the <code>reflect.Value</code> it's easy to get
|
||||
to the <code>reflect.Type</code>, but let's keep the
|
||||
<code>Value</code> and <code>Type</code> concepts separate for
|
||||
now.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Let's start with <code>TypeOf</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/package main/` `/STOP main/`}}
|
||||
|
||||
<p>
|
||||
This program prints
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
type: float64
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
You might be wondering where the interface is here, since the program looks
|
||||
like it's passing the <code>float64</code> variable <code>x</code>, not an
|
||||
interface value, to <code>reflect.TypeOf</code>. But it's there; as
|
||||
<a href="/pkg/reflect/#TypeOf">godoc reports</a>, the signature of
|
||||
<code>reflect.TypeOf</code> includes an empty interface:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// TypeOf returns the reflection Type of the value in the interface{}.
|
||||
func TypeOf(i interface{}) Type
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
When we call <code>reflect.TypeOf(x)</code>, <code>x</code> is
|
||||
first stored in an empty interface, which is then passed as the
|
||||
argument; <code>reflect.TypeOf</code> unpacks that empty interface
|
||||
to recover the type information.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>reflect.ValueOf</code> function, of course, recovers the
|
||||
value (from here on we'll elide the boilerplate and focus just on
|
||||
the executable code):
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f9/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
prints
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
value: <float64 Value>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Both <code>reflect.Type</code> and <code>reflect.Value</code> have
|
||||
lots of methods to let us examine and manipulate them. One
|
||||
important example is that <code>Value</code> has a
|
||||
<code>Type</code> method that returns the <code>Type</code> of a
|
||||
<code>reflect.Value</code>. Another is that both <code>Type</code>
|
||||
and <code>Value</code> have a <code>Kind</code> method that returns
|
||||
a constant indicating what sort of item is stored:
|
||||
<code>Uint</code>, <code>Float64</code>, <code>Slice</code>, and so
|
||||
on. Also methods on <code>Value</code> with names like
|
||||
<code>Int</code> and <code>Float</code> let us grab values (as
|
||||
<code>int64</code> and <code>float64</code>) stored inside:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f1/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
prints
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
type: float64
|
||||
kind is float64: true
|
||||
value: 3.4
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
There are also methods like <code>SetInt</code> and
|
||||
<code>SetFloat</code> but to use them we need to understand
|
||||
settability, the subject of the third law of reflection, discussed
|
||||
below.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The reflection library has a couple of properties worth singling
|
||||
out. First, to keep the API simple, the "getter" and "setter"
|
||||
methods of <code>Value</code> operate on the largest type that can
|
||||
hold the value: <code>int64</code> for all the signed integers, for
|
||||
instance. That is, the <code>Int</code> method of
|
||||
<code>Value</code> returns an <code>int64</code> and the
|
||||
<code>SetInt</code> value takes an <code>int64</code>; it may be
|
||||
necessary to convert to the actual type involved:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f2/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The second property is that the <code>Kind</code> of a reflection
|
||||
object describes the underlying type, not the static type. If a
|
||||
reflection object contains a value of a user-defined integer type,
|
||||
as in
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f3/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
the <code>Kind</code> of <code>v</code> is still
|
||||
<code>reflect.Int</code>, even though the static type of
|
||||
<code>x</code> is <code>MyInt</code>, not <code>int</code>. In
|
||||
other words, the <code>Kind</code> cannot discriminate an int from
|
||||
a <code>MyInt</code> even though the <code>Type</code> can.
|
||||
</p>
|
||||
|
||||
<p><b>The second law of reflection</b></p>
|
||||
|
||||
<p><b>2. Reflection goes from reflection object to interface
|
||||
value.</b></p>
|
||||
|
||||
<p>
|
||||
Like physical reflection, reflection in Go generates its own
|
||||
inverse.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Given a <code>reflect.Value</code> we can recover an interface
|
||||
value using the <code>Interface</code> method; in effect the method
|
||||
packs the type and value information back into an interface
|
||||
representation and returns the result:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// Interface returns v's value as an interface{}.
|
||||
func (v Value) Interface() interface{}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
As a consequence we can say
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f3b/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
to print the <code>float64</code> value represented by the
|
||||
reflection object <code>v</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
We can do even better, though. The arguments to
|
||||
<code>fmt.Println</code>, <code>fmt.Printf</code> and so on are all
|
||||
passed as empty interface values, which are then unpacked by the
|
||||
<code>fmt</code> package internally just as we have been doing in
|
||||
the previous examples. Therefore all it takes to print the contents
|
||||
of a <code>reflect.Value</code> correctly is to pass the result of
|
||||
the <code>Interface</code> method to the formatted print
|
||||
routine:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f3c/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
(Why not <code>fmt.Println(v)</code>? Because <code>v</code> is a
|
||||
<code>reflect.Value</code>; we want the concrete value it holds.)
|
||||
Since our value is a <code>float64</code>, we can even use a
|
||||
floating-point format if we want:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f3d/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
and get in this case
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
3.4e+00
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Again, there's no need to type-assert the result of
|
||||
<code>v.Interface()</code> to <code>float64</code>; the empty
|
||||
interface value has the concrete value's type information inside
|
||||
and <code>Printf</code> will recover it.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In short, the <code>Interface</code> method is the inverse of the
|
||||
<code>ValueOf</code> function, except that its result is always of
|
||||
static type <code>interface{}</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Reiterating: Reflection goes from interface values to reflection
|
||||
objects and back again.
|
||||
</p>
|
||||
|
||||
<p><b>The third law of reflection</b></p>
|
||||
|
||||
<p><b>3. To modify a reflection object, the value must be settable.</b></p>
|
||||
|
||||
<p>
|
||||
The third law is the most subtle and confusing, but it's easy
|
||||
enough to understand if we start from first principles.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Here is some code that does not work, but is worth studying.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f4/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
If you run this code, it will panic with the cryptic message
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
panic: reflect.Value.SetFloat using unaddressable value
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The problem is not that the value <code>7.1</code> is not
|
||||
addressable; it's that <code>v</code> is not settable. Settability
|
||||
is a property of a reflection <code>Value</code>, and not all
|
||||
reflection <code>Values</code> have it.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>CanSet</code> method of <code>Value</code> reports the
|
||||
settability of a <code>Value</code>; in our case,
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f5/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
prints
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
settability of v: false
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
It is an error to call a <code>Set</code> method on an non-settable
|
||||
<code>Value</code>. But what is settability?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Settability is a bit like addressability, but stricter. It's the
|
||||
property that a reflection object can modify the actual storage
|
||||
that was used to create the reflection object. Settability is
|
||||
determined by whether the reflection object holds the original
|
||||
item. When we say
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f6/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
we pass a <em>copy</em> of <code>x</code> to
|
||||
<code>reflect.ValueOf</code>, so the interface value created as the
|
||||
argument to <code>reflect.ValueOf</code> is a <em>copy</em> of
|
||||
<code>x</code>, not <code>x</code> itself. Thus, if the
|
||||
statement
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f6b/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
were allowed to succeed, it would not update <code>x</code>, even
|
||||
though <code>v</code> looks like it was created from
|
||||
<code>x</code>. Instead, it would update the copy of <code>x</code>
|
||||
stored inside the reflection value and <code>x</code> itself would
|
||||
be unaffected. That would be confusing and useless, so it is
|
||||
illegal, and settability is the property used to avoid this
|
||||
issue.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If this seems bizarre, it's not. It's actually a familiar situation
|
||||
in unusual garb. Think of passing <code>x</code> to a
|
||||
function:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
f(x)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
We would not expect <code>f</code> to be able to modify
|
||||
<code>x</code> because we passed a copy of <code>x</code>'s value,
|
||||
not <code>x</code> itself. If we want <code>f</code> to modify
|
||||
<code>x</code> directly we must pass our function the address of
|
||||
<code>x</code> (that is, a pointer to <code>x</code>):</p>
|
||||
|
||||
<p>
|
||||
<code>f(&x)</code>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This is straightforward and familiar, and reflection works the same
|
||||
way. If we want to modify <code>x</code> by reflection, we must
|
||||
give the reflection library a pointer to the value we want to
|
||||
modify.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Let's do that. First we initialize <code>x</code> as usual
|
||||
and then create a reflection value that points to it, called
|
||||
<code>p</code>.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f7/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The output so far is
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
type of p: *float64
|
||||
settability of p: false
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The reflection object <code>p</code> isn't settable, but it's not
|
||||
<code>p</code> we want to set, it's (in effect) <code>*p</code>. To
|
||||
get to what <code>p</code> points to, we call the <code>Elem</code>
|
||||
method of <code>Value</code>, which indirects through the pointer,
|
||||
and save the result in a reflection <code>Value</code> called
|
||||
<code>v</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f7b/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
Now <code>v</code> is a settable reflection object, as the output
|
||||
demonstrates,
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
settability of v: true
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
and since it represents <code>x</code>, we are finally able to use
|
||||
<code>v.SetFloat</code> to modify the value of
|
||||
<code>x</code>:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f7c/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The output, as expected, is
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
7.1
|
||||
7.1
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Reflection can be hard to understand but it's doing exactly what
|
||||
the language does, albeit through reflection <code>Types</code> and
|
||||
<code>Values</code> that can disguise what's going on. Just keep in
|
||||
mind that reflection Values need the address of something in order
|
||||
to modify what they represent.
|
||||
</p>
|
||||
|
||||
<p><b>Structs</b></p>
|
||||
|
||||
<p>
|
||||
In our previous example <code>v</code> wasn't a pointer itself, it
|
||||
was just derived from one. A common way for this situation to arise
|
||||
is when using reflection to modify the fields of a structure. As
|
||||
long as we have the address of the structure, we can modify its
|
||||
fields.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Here's a simple example that analyzes a struct value, <code>t</code>. We create
|
||||
the reflection object with the address of the struct because we'll want to
|
||||
modify it later. Then we set <code>typeOfT</code> to its type and iterate over
|
||||
the fields using straightforward method calls
|
||||
(see <a href="/pkg/reflect/">package reflect</a> for details).
|
||||
Note that we extract the names of the fields from the struct type, but the
|
||||
fields themselves are regular <code>reflect.Value</code> objects.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f8/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
The output of this program is
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
0: A int = 23
|
||||
1: B string = skidoo
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
There's one more point about settability introduced in
|
||||
passing here: the field names of <code>T</code> are upper case
|
||||
(exported) because only exported fields of a struct are
|
||||
settable.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Because <code>s</code> contains a settable reflection object, we
|
||||
can modify the fields of the structure.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/interface2.go" `/START f8b/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
And here's the result:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
t is now {77 Sunset Strip}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If we modified the program so that <code>s</code> was created from
|
||||
<code>t</code>, not <code>&t</code>, the calls to
|
||||
<code>SetInt</code> and <code>SetString</code> would fail as the
|
||||
fields of <code>t</code> would not be settable.
|
||||
</p>
|
||||
|
||||
<p><b>Conclusion</b></p>
|
||||
|
||||
<p>
|
||||
Here again are the laws of reflection:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li>Reflection goes from interface value to reflection
|
||||
object.</li>
|
||||
<li>Reflection goes from reflection object to interface
|
||||
value.</li>
|
||||
<li>To modify a reflection object, the value must be settable.</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
Once you understand these laws reflection in Go becomes much easier
|
||||
to use, although it remains subtle. It's a powerful tool that
|
||||
should be used with care and avoided unless strictly
|
||||
necessary.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There's plenty more to reflection that we haven't covered —
|
||||
sending and receiving on channels, allocating memory, using slices
|
||||
and maps, calling methods and functions — but this post is
|
||||
long enough. We'll cover some of those topics in a later
|
||||
article.
|
||||
</p>
|
||||
@@ -57,35 +57,35 @@ Here is an example:
|
||||
WARNING: DATA RACE
|
||||
Read by goroutine 185:
|
||||
net.(*pollServer).AddFD()
|
||||
src/net/fd_unix.go:89 +0x398
|
||||
src/pkg/net/fd_unix.go:89 +0x398
|
||||
net.(*pollServer).WaitWrite()
|
||||
src/net/fd_unix.go:247 +0x45
|
||||
src/pkg/net/fd_unix.go:247 +0x45
|
||||
net.(*netFD).Write()
|
||||
src/net/fd_unix.go:540 +0x4d4
|
||||
src/pkg/net/fd_unix.go:540 +0x4d4
|
||||
net.(*conn).Write()
|
||||
src/net/net.go:129 +0x101
|
||||
src/pkg/net/net.go:129 +0x101
|
||||
net.func·060()
|
||||
src/net/timeout_test.go:603 +0xaf
|
||||
src/pkg/net/timeout_test.go:603 +0xaf
|
||||
|
||||
Previous write by goroutine 184:
|
||||
net.setWriteDeadline()
|
||||
src/net/sockopt_posix.go:135 +0xdf
|
||||
src/pkg/net/sockopt_posix.go:135 +0xdf
|
||||
net.setDeadline()
|
||||
src/net/sockopt_posix.go:144 +0x9c
|
||||
src/pkg/net/sockopt_posix.go:144 +0x9c
|
||||
net.(*conn).SetDeadline()
|
||||
src/net/net.go:161 +0xe3
|
||||
src/pkg/net/net.go:161 +0xe3
|
||||
net.func·061()
|
||||
src/net/timeout_test.go:616 +0x3ed
|
||||
src/pkg/net/timeout_test.go:616 +0x3ed
|
||||
|
||||
Goroutine 185 (running) created at:
|
||||
net.func·061()
|
||||
src/net/timeout_test.go:609 +0x288
|
||||
src/pkg/net/timeout_test.go:609 +0x288
|
||||
|
||||
Goroutine 184 (running) created at:
|
||||
net.TestProlongTimeout()
|
||||
src/net/timeout_test.go:618 +0x298
|
||||
src/pkg/net/timeout_test.go:618 +0x298
|
||||
testing.tRunner()
|
||||
src/testing/testing.go:301 +0xe8
|
||||
src/pkg/testing/testing.go:301 +0xe8
|
||||
</pre>
|
||||
|
||||
<h2 id="Options">Options</h2>
|
||||
@@ -128,11 +128,6 @@ access history is <code>32K * 2**history_size elements</code>.
|
||||
Increasing this value can avoid a "failed to restore the stack" error in reports, at the
|
||||
cost of increased memory usage.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>halt_on_error</code> (default <code>0</code>): Controls whether the program
|
||||
exits after reporting first data race.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
@@ -377,8 +372,7 @@ func (w *Watchdog) Start() {
|
||||
<h2 id="Supported_Systems">Supported Systems</h2>
|
||||
|
||||
<p>
|
||||
The race detector runs on <code>darwin/amd64</code>, <code>freebsd/amd64</code>,
|
||||
<code>linux/amd64</code>, and <code>windows/amd64</code>.
|
||||
The race detector runs on <code>darwin/amd64</code>, <code>linux/amd64</code>, and <code>windows/amd64</code>.
|
||||
</p>
|
||||
|
||||
<h2 id="Runtime_Overheads">Runtime Overhead</h2>
|
||||
|
||||
BIN
doc/articles/slice-1.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
doc/articles/slice-2.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
doc/articles/slice-3.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
doc/articles/slice-array.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
doc/articles/slice-struct.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
438
doc/articles/slices_usage_and_internals.html
Normal file
@@ -0,0 +1,438 @@
|
||||
<!--{
|
||||
"Title": "Slices: usage and internals",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<p>
|
||||
Go's slice type provides a convenient and efficient means of working with
|
||||
sequences of typed data. Slices are analogous to arrays in other languages, but
|
||||
have some unusual properties. This article will look at what slices are and how
|
||||
they are used.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Arrays</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The slice type is an abstraction built on top of Go's array type, and so to
|
||||
understand slices we must first understand arrays.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
An array type definition specifies a length and an element type. For example,
|
||||
the type <code>[4]int</code> represents an array of four integers. An array's
|
||||
size is fixed; its length is part of its type (<code>[4]int</code> and
|
||||
<code>[5]int</code> are distinct, incompatible types). Arrays can be indexed in
|
||||
the usual way, so the expression <code>s[n]</code> accesses the <i>n</i>th
|
||||
element:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
var a [4]int
|
||||
a[0] = 1
|
||||
i := a[0]
|
||||
// i == 1
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Arrays do not need to be initialized explicitly; the zero value of an array is
|
||||
a ready-to-use array whose elements are themselves zeroed:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// a[2] == 0, the zero value of the int type
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The in-memory representation of <code>[4]int</code> is just four integer values laid out sequentially:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img src="slice-array.png">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go's arrays are values. An array variable denotes the entire array; it is not a
|
||||
pointer to the first array element (as would be the case in C). This means
|
||||
that when you assign or pass around an array value you will make a copy of its
|
||||
contents. (To avoid the copy you could pass a <i>pointer</i> to the array, but
|
||||
then that's a pointer to an array, not an array.) One way to think about arrays
|
||||
is as a sort of struct but with indexed rather than named fields: a fixed-size
|
||||
composite value.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
An array literal can be specified like so:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
b := [2]string{"Penn", "Teller"}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Or, you can have the compiler count the array elements for you:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
b := [...]string{"Penn", "Teller"}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
In both cases, the type of <code>b</code> is <code>[2]string</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Slices</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Arrays have their place, but they're a bit inflexible, so you don't see them
|
||||
too often in Go code. Slices, though, are everywhere. They build on arrays to
|
||||
provide great power and convenience.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The type specification for a slice is <code>[]T</code>, where <code>T</code> is
|
||||
the type of the elements of the slice. Unlike an array type, a slice type has
|
||||
no specified length.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A slice literal is declared just like an array literal, except you leave out
|
||||
the element count:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
letters := []string{"a", "b", "c", "d"}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
A slice can be created with the built-in function called <code>make</code>,
|
||||
which has the signature,
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func make([]T, len, cap) []T
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
where T stands for the element type of the slice to be created. The
|
||||
<code>make</code> function takes a type, a length, and an optional capacity.
|
||||
When called, <code>make</code> allocates an array and returns a slice that
|
||||
refers to that array.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
var s []byte
|
||||
s = make([]byte, 5, 5)
|
||||
// s == []byte{0, 0, 0, 0, 0}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
When the capacity argument is omitted, it defaults to the specified length.
|
||||
Here's a more succinct version of the same code:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
s := make([]byte, 5)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The length and capacity of a slice can be inspected using the built-in
|
||||
<code>len</code> and <code>cap</code> functions.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
len(s) == 5
|
||||
cap(s) == 5
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The next two sections discuss the relationship between length and capacity.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The zero value of a slice is <code>nil</code>. The <code>len</code> and
|
||||
<code>cap</code> functions will both return 0 for a nil slice.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A slice can also be formed by "slicing" an existing slice or array. Slicing is
|
||||
done by specifying a half-open range with two indices separated by a colon. For
|
||||
example, the expression <code>b[1:4]</code> creates a slice including elements
|
||||
1 through 3 of <code>b</code> (the indices of the resulting slice will be 0
|
||||
through 2).
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
b := []byte{'g', 'o', 'l', 'a', 'n', 'g'}
|
||||
// b[1:4] == []byte{'o', 'l', 'a'}, sharing the same storage as b
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The start and end indices of a slice expression are optional; they default to zero and the slice's length respectively:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// b[:2] == []byte{'g', 'o'}
|
||||
// b[2:] == []byte{'l', 'a', 'n', 'g'}
|
||||
// b[:] == b
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
This is also the syntax to create a slice given an array:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
x := [3]string{"Лайка", "Белка", "Стрелка"}
|
||||
s := x[:] // a slice referencing the storage of x
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
<b>Slice internals</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A slice is a descriptor of an array segment. It consists of a pointer to the
|
||||
array, the length of the segment, and its capacity (the maximum length of the
|
||||
segment).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img src="slice-struct.png">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Our variable <code>s</code>, created earlier by <code>make([]byte, 5)</code>,
|
||||
is structured like this:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<img src="slice-1.png">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The length is the number of elements referred to by the slice. The capacity is
|
||||
the number of elements in the underlying array (beginning at the element
|
||||
referred to by the slice pointer). The distinction between length and capacity
|
||||
will be made clear as we walk through the next few examples.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
As we slice <code>s</code>, observe the changes in the slice data structure and
|
||||
their relation to the underlying array:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
s = s[2:4]
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
<img src="slice-2.png">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Slicing does not copy the slice's data. It creates a new slice value that
|
||||
points to the original array. This makes slice operations as efficient as
|
||||
manipulating array indices. Therefore, modifying the <i>elements</i> (not the
|
||||
slice itself) of a re-slice modifies the elements of the original slice:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
d := []byte{'r', 'o', 'a', 'd'}
|
||||
e := d[2:]
|
||||
// e == []byte{'a', 'd'}
|
||||
e[1] = 'm'
|
||||
// e == []byte{'a', 'm'}
|
||||
// d == []byte{'r', 'o', 'a', 'm'}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Earlier we sliced <code>s</code> to a length shorter than its capacity. We can
|
||||
grow s to its capacity by slicing it again:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
s = s[:cap(s)]
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
<img src="slice-3.png">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A slice cannot be grown beyond its capacity. Attempting to do so will cause a
|
||||
runtime panic, just as when indexing outside the bounds of a slice or array.
|
||||
Similarly, slices cannot be re-sliced below zero to access earlier elements in
|
||||
the array.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Growing slices (the copy and append functions)</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To increase the capacity of a slice one must create a new, larger slice and
|
||||
copy the contents of the original slice into it. This technique is how dynamic
|
||||
array implementations from other languages work behind the scenes. The next
|
||||
example doubles the capacity of <code>s</code> by making a new slice,
|
||||
<code>t</code>, copying the contents of <code>s</code> into <code>t</code>, and
|
||||
then assigning the slice value <code>t</code> to <code>s</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
t := make([]byte, len(s), (cap(s)+1)*2) // +1 in case cap(s) == 0
|
||||
for i := range s {
|
||||
t[i] = s[i]
|
||||
}
|
||||
s = t
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The looping piece of this common operation is made easier by the built-in copy
|
||||
function. As the name suggests, copy copies data from a source slice to a
|
||||
destination slice. It returns the number of elements copied.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func copy(dst, src []T) int
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The <code>copy</code> function supports copying between slices of different
|
||||
lengths (it will copy only up to the smaller number of elements). In addition,
|
||||
<code>copy</code> can handle source and destination slices that share the same
|
||||
underlying array, handling overlapping slices correctly.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Using <code>copy</code>, we can simplify the code snippet above:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
t := make([]byte, len(s), (cap(s)+1)*2)
|
||||
copy(t, s)
|
||||
s = t
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
A common operation is to append data to the end of a slice. This function
|
||||
appends byte elements to a slice of bytes, growing the slice if necessary, and
|
||||
returns the updated slice value:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/slices.go" `/AppendByte/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
One could use <code>AppendByte</code> like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
p := []byte{2, 3, 5}
|
||||
p = AppendByte(p, 7, 11, 13)
|
||||
// p == []byte{2, 3, 5, 7, 11, 13}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Functions like <code>AppendByte</code> are useful because they offer complete
|
||||
control over the way the slice is grown. Depending on the characteristics of
|
||||
the program, it may be desirable to allocate in smaller or larger chunks, or to
|
||||
put a ceiling on the size of a reallocation.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
But most programs don't need complete control, so Go provides a built-in
|
||||
<code>append</code> function that's good for most purposes; it has the
|
||||
signature
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func append(s []T, x ...T) []T
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The <code>append</code> function appends the elements <code>x</code> to the end
|
||||
of the slice <code>s</code>, and grows the slice if a greater capacity is
|
||||
needed.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
a := make([]int, 1)
|
||||
// a == []int{0}
|
||||
a = append(a, 1, 2, 3)
|
||||
// a == []int{0, 1, 2, 3}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
To append one slice to another, use <code>...</code> to expand the second
|
||||
argument to a list of arguments.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
a := []string{"John", "Paul"}
|
||||
b := []string{"George", "Ringo", "Pete"}
|
||||
a = append(a, b...) // equivalent to "append(a, b[0], b[1], b[2])"
|
||||
// a == []string{"John", "Paul", "George", "Ringo", "Pete"}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Since the zero value of a slice (<code>nil</code>) acts like a zero-length
|
||||
slice, you can declare a slice variable and then append to it in a loop:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/slices.go" `/Filter/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
<b>A possible "gotcha"</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
As mentioned earlier, re-slicing a slice doesn't make a copy of the underlying
|
||||
array. The full array will be kept in memory until it is no longer referenced.
|
||||
Occasionally this can cause the program to hold all the data in memory when
|
||||
only a small piece of it is needed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For example, this <code>FindDigits</code> function loads a file into memory and
|
||||
searches it for the first group of consecutive numeric digits, returning them
|
||||
as a new slice.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/slices.go" `/digit/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
This code behaves as advertised, but the returned <code>[]byte</code> points
|
||||
into an array containing the entire file. Since the slice references the
|
||||
original array, as long as the slice is kept around the garbage collector can't
|
||||
release the array; the few useful bytes of the file keep the entire contents in
|
||||
memory.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To fix this problem one can copy the interesting data to a new slice before
|
||||
returning it:
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/slices.go" `/CopyDigits/` `/STOP/`}}
|
||||
|
||||
<p>
|
||||
A more concise version of this function could be constructed by using
|
||||
<code>append</code>. This is left as an exercise for the reader.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Further Reading</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/doc/effective_go.html">Effective Go</a> contains an
|
||||
in-depth treatment of <a href="/doc/effective_go.html#slices">slices</a>
|
||||
and <a href="/doc/effective_go.html#arrays">arrays</a>,
|
||||
and the Go <a href="/doc/go_spec.html">language specification</a>
|
||||
defines <a href="/doc/go_spec.html#Slice_types">slices</a> and their
|
||||
<a href="/doc/go_spec.html#Length_and_capacity">associated</a>
|
||||
<a href="/doc/go_spec.html#Making_slices_maps_and_channels">helper</a>
|
||||
<a href="/doc/go_spec.html#Appending_and_copying_slices">functions</a>.
|
||||
</p>
|
||||
20
doc/articles/wiki/Makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright 2010 The Go Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
all: index.html
|
||||
|
||||
CLEANFILES:=srcextract.bin htmlify.bin get.bin
|
||||
|
||||
index.html: wiki.html srcextract.bin htmlify.bin
|
||||
PATH=.:$$PATH awk '/^!/{system(substr($$0,2)); next} {print}' < wiki.html | tr -d '\r' > index.html
|
||||
|
||||
test: get.bin
|
||||
bash ./test.sh
|
||||
rm -f get.6 get.bin
|
||||
|
||||
%.bin: %.go
|
||||
go build -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(CLEANFILES)
|
||||
@@ -83,15 +83,17 @@ func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) {
|
||||
}
|
||||
}
|
||||
|
||||
var validPath = regexp.MustCompile("^/(edit|save|view)/([a-zA-Z0-9]+)$")
|
||||
const lenPath = len("/view/")
|
||||
|
||||
func getTitle(w http.ResponseWriter, r *http.Request) (string, error) {
|
||||
m := validPath.FindStringSubmatch(r.URL.Path)
|
||||
if m == nil {
|
||||
var titleValidator = regexp.MustCompile("^[a-zA-Z0-9]+$")
|
||||
|
||||
func getTitle(w http.ResponseWriter, r *http.Request) (title string, err error) {
|
||||
title = r.URL.Path[lenPath:]
|
||||
if !titleValidator.MatchString(title) {
|
||||
http.NotFound(w, r)
|
||||
return "", errors.New("Invalid Page Title")
|
||||
err = errors.New("Invalid Page Title")
|
||||
}
|
||||
return m[2], nil // The title is the second subexpression.
|
||||
return
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -29,8 +29,10 @@ func loadPage(title string) (*Page, error) {
|
||||
return &Page{Title: title, Body: body}, nil
|
||||
}
|
||||
|
||||
const lenPath = len("/view/")
|
||||
|
||||
func editHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/edit/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, err := loadPage(title)
|
||||
if err != nil {
|
||||
p = &Page{Title: title}
|
||||
@@ -40,7 +42,7 @@ func editHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func viewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/view/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, _ := loadPage(title)
|
||||
t, _ := template.ParseFiles("view.html")
|
||||
t.Execute(w, p)
|
||||
|
||||
@@ -70,16 +70,18 @@ func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) {
|
||||
}
|
||||
}
|
||||
|
||||
var validPath = regexp.MustCompile("^/(edit|save|view)/([a-zA-Z0-9]+)$")
|
||||
const lenPath = len("/view/")
|
||||
|
||||
var titleValidator = regexp.MustCompile("^[a-zA-Z0-9]+$")
|
||||
|
||||
func makeHandler(fn func(http.ResponseWriter, *http.Request, string)) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
m := validPath.FindStringSubmatch(r.URL.Path)
|
||||
if m == nil {
|
||||
title := r.URL.Path[lenPath:]
|
||||
if !titleValidator.MatchString(title) {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
fn(w, r, m[2])
|
||||
fn(w, r, title)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,10 @@ func loadPage(title string) (*Page, error) {
|
||||
return &Page{Title: title, Body: body}, nil
|
||||
}
|
||||
|
||||
const lenPath = len("/view/")
|
||||
|
||||
func editHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/edit/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, err := loadPage(title)
|
||||
if err != nil {
|
||||
p = &Page{Title: title}
|
||||
@@ -39,13 +41,13 @@ func editHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func viewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/view/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, _ := loadPage(title)
|
||||
renderTemplate(w, "view", p)
|
||||
}
|
||||
|
||||
func saveHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/save/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
body := r.FormValue("body")
|
||||
p := &Page{Title: title, Body: []byte(body)}
|
||||
p.save()
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
*** 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
|
||||
}
|
||||
@@ -67,16 +67,18 @@ func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) {
|
||||
}
|
||||
}
|
||||
|
||||
var validPath = regexp.MustCompile("^/(edit|save|view)/([a-zA-Z0-9]+)$")
|
||||
const lenPath = len("/view/")
|
||||
|
||||
var titleValidator = regexp.MustCompile("^[a-zA-Z0-9]+$")
|
||||
|
||||
func makeHandler(fn func(http.ResponseWriter, *http.Request, string)) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
m := validPath.FindStringSubmatch(r.URL.Path)
|
||||
if m == nil {
|
||||
title := r.URL.Path[lenPath:]
|
||||
if !titleValidator.MatchString(title) {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
fn(w, r, m[2])
|
||||
fn(w, r, title)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +86,5 @@ func main() {
|
||||
http.HandleFunc("/view/", makeHandler(viewHandler))
|
||||
http.HandleFunc("/edit/", makeHandler(editHandler))
|
||||
http.HandleFunc("/save/", makeHandler(saveHandler))
|
||||
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
16
doc/articles/wiki/htmlify.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2010 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
func main() {
|
||||
b, _ := ioutil.ReadAll(os.Stdin)
|
||||
template.HTMLEscape(os.Stdout, b)
|
||||
}
|
||||
@@ -128,10 +128,11 @@ In addition to saving pages, we will want to load pages, too:
|
||||
{{code "doc/articles/wiki/part1-noerror.go" `/^func loadPage/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
The function <code>loadPage</code> constructs the file name from the title
|
||||
parameter, reads the file's contents into a new variable <code>body</code>, and
|
||||
returns a pointer to a <code>Page</code> literal constructed with the proper
|
||||
title and body values.
|
||||
The function <code>loadPage</code> constructs the file name from
|
||||
the title parameter, reads the file's contents into a new
|
||||
variable <code>body</code>, and returns two values: a pointer to a
|
||||
<code>Page</code> literal constructed with the proper title and body
|
||||
values and <code>nil</code> for the error value.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -260,15 +261,18 @@ Let's create a handler, <code>viewHandler</code> that will allow users to
|
||||
view a wiki page. It will handle URLs prefixed with "/view/".
|
||||
</p>
|
||||
|
||||
{{code "doc/articles/wiki/part2.go" `/^const lenPath/`}}
|
||||
|
||||
{{code "doc/articles/wiki/part2.go" `/^func viewHandler/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
First, this function extracts the page title from <code>r.URL.Path</code>,
|
||||
the path component of the request URL.
|
||||
The <code>Path</code> is re-sliced with <code>[len("/view/"):]</code> to drop
|
||||
the leading <code>"/view/"</code> component of the request path.
|
||||
This is because the path will invariably begin with <code>"/view/"</code>,
|
||||
which is not part of the page's title.
|
||||
the path component of the request URL. The global constant
|
||||
<code>lenPath</code> is the length of the leading <code>"/view/"</code>
|
||||
component of the request path.
|
||||
The <code>Path</code> is re-sliced with <code>[lenPath:]</code> to drop the
|
||||
first 6 characters of the string. This is because the path will invariably
|
||||
begin with <code>"/view/"</code>, which is not part of the page's title.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -428,11 +432,6 @@ to its own function:
|
||||
</p>
|
||||
|
||||
{{code "doc/articles/wiki/final-template.go" `/^func renderTemplate/` `/^}/`}}
|
||||
|
||||
<p>
|
||||
And modify the handlers to use that function:
|
||||
</p>
|
||||
|
||||
{{code "doc/articles/wiki/final-template.go" `/^func viewHandler/` `/^}/`}}
|
||||
{{code "doc/articles/wiki/final-template.go" `/^func editHandler/` `/^}/`}}
|
||||
|
||||
@@ -466,7 +465,7 @@ header to the HTTP response.
|
||||
<p>
|
||||
The function <code>saveHandler</code> will handle the submission of forms
|
||||
located on the edit pages. After uncommenting the related line in
|
||||
<code>main</code>, let's implement the handler:
|
||||
<code>main</code>, let's implement the the handler:
|
||||
</p>
|
||||
|
||||
{{code "doc/articles/wiki/final-template.go" `/^func saveHandler/` `/^}/`}}
|
||||
@@ -575,11 +574,10 @@ this, we can write a function to validate the title with a regular expression.
|
||||
|
||||
<p>
|
||||
First, add <code>"regexp"</code> to the <code>import</code> list.
|
||||
Then we can create a global variable to store our validation
|
||||
expression:
|
||||
Then we can create a global variable to store our validation regexp:
|
||||
</p>
|
||||
|
||||
{{code "doc/articles/wiki/final-noclosure.go" `/^var validPath/`}}
|
||||
{{code "doc/articles/wiki/final-noclosure.go" `/^var titleValidator/`}}
|
||||
|
||||
<p>
|
||||
The function <code>regexp.MustCompile</code> will parse and compile the
|
||||
@@ -590,8 +588,9 @@ an <code>error</code> as a second parameter.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Now, let's write a function that uses the <code>validPath</code>
|
||||
expression to validate path and extract the page title:
|
||||
Now, let's write a function, <code>getTitle</code>, that extracts the title
|
||||
string from the request URL, and tests it against our
|
||||
<code>TitleValidator</code> expression:
|
||||
</p>
|
||||
|
||||
{{code "doc/articles/wiki/final-noclosure.go" `/func getTitle/` `/^}/`}}
|
||||
@@ -618,7 +617,7 @@ Let's put a call to <code>getTitle</code> in each of the handlers:
|
||||
Catching the error condition in each handler introduces a lot of repeated code.
|
||||
What if we could wrap each of the handlers in a function that does this
|
||||
validation and error checking? Go's
|
||||
<a href="/ref/spec#Function_literals">function
|
||||
<a href="/ref/spec#Function_declarations">function
|
||||
literals</a> provide a powerful means of abstracting functionality
|
||||
that can help us here.
|
||||
</p>
|
||||
|
||||
@@ -29,14 +29,16 @@ func loadPage(title string) (*Page, error) {
|
||||
return &Page{Title: title, Body: body}, nil
|
||||
}
|
||||
|
||||
const lenPath = len("/view/")
|
||||
|
||||
func viewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/view/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, _ := loadPage(title)
|
||||
fmt.Fprintf(w, "<h1>%s</h1><div>%s</div>", p.Title, p.Body)
|
||||
}
|
||||
|
||||
func editHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/edit/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, err := loadPage(title)
|
||||
if err != nil {
|
||||
p = &Page{Title: title}
|
||||
|
||||
@@ -29,8 +29,10 @@ func loadPage(title string) (*Page, error) {
|
||||
return &Page{Title: title, Body: body}, nil
|
||||
}
|
||||
|
||||
const lenPath = len("/view/")
|
||||
|
||||
func viewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/view/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, _ := loadPage(title)
|
||||
fmt.Fprintf(w, "<h1>%s</h1><div>%s</div>", p.Title, p.Body)
|
||||
}
|
||||
|
||||
@@ -29,13 +29,15 @@ func loadPage(title string) (*Page, error) {
|
||||
return &Page{Title: title, Body: body}, nil
|
||||
}
|
||||
|
||||
const lenPath = len("/view/")
|
||||
|
||||
func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) {
|
||||
t, _ := template.ParseFiles(tmpl + ".html")
|
||||
t.Execute(w, p)
|
||||
}
|
||||
|
||||
func viewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/view/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, err := loadPage(title)
|
||||
if err != nil {
|
||||
http.Redirect(w, r, "/edit/"+title, http.StatusFound)
|
||||
@@ -45,7 +47,7 @@ func viewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func editHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/edit/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, err := loadPage(title)
|
||||
if err != nil {
|
||||
p = &Page{Title: title}
|
||||
@@ -54,7 +56,7 @@ func editHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func saveHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/save/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
body := r.FormValue("body")
|
||||
p := &Page{Title: title, Body: []byte(body)}
|
||||
err := p.save()
|
||||
|
||||
@@ -29,19 +29,21 @@ func loadPage(title string) (*Page, error) {
|
||||
return &Page{Title: title, Body: body}, nil
|
||||
}
|
||||
|
||||
const lenPath = len("/view/")
|
||||
|
||||
func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) {
|
||||
t, _ := template.ParseFiles(tmpl + ".html")
|
||||
t.Execute(w, p)
|
||||
}
|
||||
|
||||
func viewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/view/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, _ := loadPage(title)
|
||||
renderTemplate(w, "view", p)
|
||||
}
|
||||
|
||||
func editHandler(w http.ResponseWriter, r *http.Request) {
|
||||
title := r.URL.Path[len("/edit/"):]
|
||||
title := r.URL.Path[lenPath:]
|
||||
p, err := loadPage(title)
|
||||
if err != nil {
|
||||
p = &Page{Title: title}
|
||||
|
||||
76
doc/articles/wiki/srcextract.go
Normal file
@@ -0,0 +1,76 @@
|
||||
// Copyright 2010 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"go/ast"
|
||||
"go/parser"
|
||||
"go/printer"
|
||||
"go/token"
|
||||
"log"
|
||||
"os"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
var (
|
||||
srcFn = flag.String("src", "", "source filename")
|
||||
getName = flag.String("name", "", "func/type name to output")
|
||||
html = flag.Bool("html", true, "output HTML")
|
||||
showPkg = flag.Bool("pkg", false, "show package in output")
|
||||
)
|
||||
|
||||
func main() {
|
||||
// handle input
|
||||
flag.Parse()
|
||||
if *srcFn == "" || *getName == "" {
|
||||
flag.Usage()
|
||||
os.Exit(2)
|
||||
}
|
||||
// load file
|
||||
fs := token.NewFileSet()
|
||||
file, err := parser.ParseFile(fs, *srcFn, nil, 0)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
// create filter
|
||||
filter := func(name string) bool {
|
||||
return name == *getName
|
||||
}
|
||||
// filter
|
||||
if !ast.FilterFile(file, filter) {
|
||||
os.Exit(1)
|
||||
}
|
||||
// print the AST
|
||||
var b bytes.Buffer
|
||||
printer.Fprint(&b, fs, file)
|
||||
// drop package declaration
|
||||
if !*showPkg {
|
||||
for {
|
||||
c, err := b.ReadByte()
|
||||
if c == '\n' || err != nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
// drop leading newlines
|
||||
for {
|
||||
b, err := b.ReadByte()
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
if b != '\n' {
|
||||
os.Stdout.Write([]byte{b})
|
||||
break
|
||||
}
|
||||
}
|
||||
// output
|
||||
if *html {
|
||||
template.HTMLEscape(os.Stdout, b.Bytes())
|
||||
} else {
|
||||
b.WriteTo(os.Stdout)
|
||||
}
|
||||
}
|
||||
@@ -4,50 +4,21 @@
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
set -e
|
||||
|
||||
if ! which patch > /dev/null; then
|
||||
echo "Skipping test; patch command not found."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
wiki_pid=
|
||||
cleanup() {
|
||||
kill $wiki_pid
|
||||
rm -f test_*.out Test.txt final-test.go final-test.bin final-test-port.txt a.out get.bin
|
||||
rm -f test_*.out Test.txt final-test.bin final-test.go
|
||||
}
|
||||
trap cleanup 0 INT
|
||||
|
||||
rm -f get.bin final-test.bin a.out
|
||||
|
||||
# If called with -all, check that all code snippets compile.
|
||||
if [ "$1" = "-all" ]; then
|
||||
for fn in *.go; do
|
||||
go build -o a.out $fn
|
||||
done
|
||||
fi
|
||||
|
||||
go build -o get.bin get.go
|
||||
cp final.go final-test.go
|
||||
patch final-test.go final-test.patch > /dev/null
|
||||
addr=$(./get.bin -addr)
|
||||
sed s/:8080/$addr/ < final.go > final-test.go
|
||||
go build -o final-test.bin final-test.go
|
||||
./final-test.bin &
|
||||
(./final-test.bin) &
|
||||
wiki_pid=$!
|
||||
|
||||
l=0
|
||||
while [ ! -f ./final-test-port.txt ]
|
||||
do
|
||||
l=$(($l+1))
|
||||
if [ "$l" -gt 5 ]
|
||||
then
|
||||
echo "port not available within 5 seconds"
|
||||
exit 1
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
addr=$(cat final-test-port.txt)
|
||||
./get.bin http://$addr/edit/Test > test_edit.out
|
||||
./get.bin --wait_for_port=5s http://$addr/edit/Test > test_edit.out
|
||||
diff -u test_edit.out test_edit.good
|
||||
./get.bin -post=body=some%20content http://$addr/save/Test > test_save.out
|
||||
diff -u test_save.out test_view.good # should be the same as viewing
|
||||
|
||||
910
doc/asm.html
@@ -1,910 +0,0 @@
|
||||
<!--{
|
||||
"Title": "A Quick Guide to Go's Assembler",
|
||||
"Path": "/doc/asm"
|
||||
}-->
|
||||
|
||||
<h2 id="introduction">A Quick Guide to Go's Assembler</h2>
|
||||
|
||||
<p>
|
||||
This document is a quick outline of the unusual form of assembly language used by the <code>gc</code> Go compiler.
|
||||
The document is not comprehensive.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The assembler is based on the input style of the Plan 9 assemblers, which is documented in detail
|
||||
<a href="https://9p.io/sys/doc/asm.html">elsewhere</a>.
|
||||
If you plan to write assembly language, you should read that document although much of it is Plan 9-specific.
|
||||
The current document provides a summary of the syntax and the differences with
|
||||
what is explained in that document, and
|
||||
describes the peculiarities that apply when writing assembly code to interact with Go.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The most important thing to know about Go's assembler is that it is not a direct representation of the underlying machine.
|
||||
Some of the details map precisely to the machine, but some do not.
|
||||
This is because the compiler suite (see
|
||||
<a href="https://9p.io/sys/doc/compiler.html">this description</a>)
|
||||
needs no assembler pass in the usual pipeline.
|
||||
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 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
|
||||
memory move and subroutine call and return are more abstract.
|
||||
The details vary with architecture, and we apologize for the imprecision; the situation is not well-defined.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The assembler program is a way to parse a description of that
|
||||
semi-abstract instruction set and turn it into instructions to be
|
||||
input to the linker.
|
||||
If you want to see what the instructions look like in assembly for a given architecture, say amd64, there
|
||||
are many examples in the sources of the standard library, in packages such as
|
||||
<a href="/pkg/runtime/"><code>runtime</code></a> and
|
||||
<a href="/pkg/math/big/"><code>math/big</code></a>.
|
||||
You can also examine what the compiler emits as assembly code
|
||||
(the actual output may differ from what you see here):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ cat x.go
|
||||
package main
|
||||
|
||||
func main() {
|
||||
println(3)
|
||||
}
|
||||
$ GOOS=linux GOARCH=amd64 go tool compile -S x.go # or: go build -gcflags -S x.go
|
||||
|
||||
--- prog list "main" ---
|
||||
0000 (x.go:3) TEXT main+0(SB),$8-0
|
||||
0001 (x.go:3) FUNCDATA $0,gcargs·0+0(SB)
|
||||
0002 (x.go:3) FUNCDATA $1,gclocals·0+0(SB)
|
||||
0003 (x.go:4) MOVQ $3,(SP)
|
||||
0004 (x.go:4) PCDATA $0,$8
|
||||
0005 (x.go:4) CALL ,runtime.printint+0(SB)
|
||||
0006 (x.go:4) PCDATA $0,$-1
|
||||
0007 (x.go:4) PCDATA $0,$0
|
||||
0008 (x.go:4) CALL ,runtime.printnl+0(SB)
|
||||
0009 (x.go:4) PCDATA $0,$-1
|
||||
0010 (x.go:5) RET ,
|
||||
...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The <code>FUNCDATA</code> and <code>PCDATA</code> directives contain information
|
||||
for use by the garbage collector; they are introduced by the compiler.
|
||||
</p>
|
||||
|
||||
<!-- Commenting out because the feature is gone but it's popular and may come back.
|
||||
|
||||
<p>
|
||||
To see what gets put in the binary after linking, add the <code>-a</code> flag to the linker:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go tool 6l -a x.6 # or: go build -ldflags -a x.go
|
||||
codeblk [0x2000,0x1d059) at offset 0x1000
|
||||
002000 main.main | (3) TEXT main.main+0(SB),$8
|
||||
002000 65488b0c25a0080000 | (3) MOVQ 2208(GS),CX
|
||||
002009 483b21 | (3) CMPQ SP,(CX)
|
||||
00200c 7707 | (3) JHI ,2015
|
||||
00200e e83da20100 | (3) CALL ,1c250+runtime.morestack00
|
||||
002013 ebeb | (3) JMP ,2000
|
||||
002015 4883ec08 | (3) SUBQ $8,SP
|
||||
002019 | (3) FUNCDATA $0,main.gcargs·0+0(SB)
|
||||
002019 | (3) FUNCDATA $1,main.gclocals·0+0(SB)
|
||||
002019 48c7042403000000 | (4) MOVQ $3,(SP)
|
||||
002021 | (4) PCDATA $0,$8
|
||||
002021 e8aad20000 | (4) CALL ,f2d0+runtime.printint
|
||||
002026 | (4) PCDATA $0,$-1
|
||||
002026 | (4) PCDATA $0,$0
|
||||
002026 e865d40000 | (4) CALL ,f490+runtime.printnl
|
||||
00202b | (4) PCDATA $0,$-1
|
||||
00202b 4883c408 | (5) ADDQ $8,SP
|
||||
00202f c3 | (5) RET ,
|
||||
...
|
||||
</pre>
|
||||
|
||||
-->
|
||||
|
||||
<h3 id="constants">Constants</h3>
|
||||
|
||||
<p>
|
||||
Although the assembler takes its guidance from the Plan 9 assemblers,
|
||||
it is a distinct program, so there are some differences.
|
||||
One is in constant evaluation.
|
||||
Constant expressions in the assembler are parsed using Go's operator
|
||||
precedence, not the C-like precedence of the original.
|
||||
Thus <code>3&1<<2</code> is 4, not 0—it parses as <code>(3&1)<<2</code>
|
||||
not <code>3&(1<<2)</code>.
|
||||
Also, constants are always evaluated as 64-bit unsigned integers.
|
||||
Thus <code>-2</code> is not the integer value minus two,
|
||||
but the unsigned 64-bit integer with the same bit pattern.
|
||||
The distinction rarely matters but
|
||||
to avoid ambiguity, division or right shift where the right operand's
|
||||
high bit is set is rejected.
|
||||
</p>
|
||||
|
||||
<h3 id="symbols">Symbols</h3>
|
||||
|
||||
<p>
|
||||
Some symbols, such as <code>R1</code> or <code>LR</code>,
|
||||
are predefined and refer to registers.
|
||||
The exact set depends on the architecture.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There are four predeclared symbols that refer to pseudo-registers.
|
||||
These are not real registers, but rather virtual registers maintained by
|
||||
the tool chain, such as a frame pointer.
|
||||
The set of pseudo-registers is the same for all architectures:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>FP</code>: Frame pointer: arguments and locals.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>PC</code>: Program counter:
|
||||
jumps and branches.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>SB</code>: Static base pointer: global symbols.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>SP</code>: Stack pointer: top of stack.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
All user-defined symbols are written as offsets to the pseudo-registers
|
||||
<code>FP</code> (arguments and locals) and <code>SB</code> (globals).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>SB</code> pseudo-register can be thought of as the origin of memory, so the symbol <code>foo(SB)</code>
|
||||
is the name <code>foo</code> as an address in memory.
|
||||
This form is used to name global functions and data.
|
||||
Adding <code><></code> to the name, as in <span style="white-space: nowrap"><code>foo<>(SB)</code></span>, makes the name
|
||||
visible only in the current source file, like a top-level <code>static</code> declaration in a C file.
|
||||
Adding an offset to the name refers to that offset from the symbol's address, so
|
||||
<code>foo+4(SB)</code> is four bytes past the start of <code>foo</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>FP</code> pseudo-register is a virtual frame pointer
|
||||
used to refer to function arguments.
|
||||
The compilers maintain a virtual frame pointer and refer to the arguments on the stack as offsets from that pseudo-register.
|
||||
Thus <code>0(FP)</code> is the first argument to the function,
|
||||
<code>8(FP)</code> is the second (on a 64-bit machine), and so on.
|
||||
However, when referring to a function argument this way, it is necessary to place a name
|
||||
at the beginning, as in <code>first_arg+0(FP)</code> and <code>second_arg+8(FP)</code>.
|
||||
(The meaning of the offset—offset from the frame pointer—distinct
|
||||
from its use with <code>SB</code>, where it is an offset from the symbol.)
|
||||
The assembler enforces this convention, rejecting plain <code>0(FP)</code> and <code>8(FP)</code>.
|
||||
The actual name is semantically irrelevant but should be used to document
|
||||
the argument's name.
|
||||
It is worth stressing that <code>FP</code> is always a
|
||||
pseudo-register, not a hardware
|
||||
register, even on architectures with a hardware frame pointer.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For assembly functions with Go prototypes, <code>go</code> <code>vet</code> will check that the argument names
|
||||
and offsets match.
|
||||
On 32-bit systems, the low and high 32 bits of a 64-bit value are distinguished by adding
|
||||
a <code>_lo</code> or <code>_hi</code> suffix to the name, as in <code>arg_lo+0(FP)</code> or <code>arg_hi+4(FP)</code>.
|
||||
If a Go prototype does not name its result, the expected assembly name is <code>ret</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>SP</code> pseudo-register is a virtual stack pointer
|
||||
used to refer to frame-local variables and the arguments being
|
||||
prepared for function calls.
|
||||
It points to the top of the local stack frame, so references should use negative offsets
|
||||
in the range [−framesize, 0):
|
||||
<code>x-8(SP)</code>, <code>y-4(SP)</code>, and so on.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
On architectures with a hardware register named <code>SP</code>,
|
||||
the name prefix distinguishes
|
||||
references to the virtual stack pointer from references to the architectural
|
||||
<code>SP</code> register.
|
||||
That is, <code>x-8(SP)</code> and <code>-8(SP)</code>
|
||||
are different memory locations:
|
||||
the first refers to the virtual stack pointer pseudo-register,
|
||||
while the second refers to the
|
||||
hardware's <code>SP</code> register.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
On machines where <code>SP</code> and <code>PC</code> are
|
||||
traditionally aliases for a physical, numbered register,
|
||||
in the Go assembler the names <code>SP</code> and <code>PC</code>
|
||||
are still treated specially;
|
||||
for instance, references to <code>SP</code> require a symbol,
|
||||
much like <code>FP</code>.
|
||||
To access the actual hardware register use the true <code>R</code> name.
|
||||
For example, on the ARM architecture the hardware
|
||||
<code>SP</code> and <code>PC</code> are accessible as
|
||||
<code>R13</code> and <code>R15</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Branches and direct jumps are always written as offsets to the PC, or as
|
||||
jumps to labels:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
label:
|
||||
MOVW $0, R1
|
||||
JMP label
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Each label is visible only within the function in which it is defined.
|
||||
It is therefore permitted for multiple functions in a file to define
|
||||
and use the same label names.
|
||||
Direct jumps and call instructions can target text symbols,
|
||||
such as <code>name(SB)</code>, but not offsets from symbols,
|
||||
such as <code>name+4(SB)</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Instructions, registers, and assembler directives are always in UPPER CASE to remind you
|
||||
that assembly programming is a fraught endeavor.
|
||||
(Exception: the <code>g</code> register renaming on ARM.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In Go object files and binaries, the full name of a symbol is the
|
||||
package path followed by a period and the symbol name:
|
||||
<code>fmt.Printf</code> or <code>math/rand.Int</code>.
|
||||
Because the assembler's parser treats period and slash as punctuation,
|
||||
those strings cannot be used directly as identifier names.
|
||||
Instead, the assembler allows the middle dot character U+00B7
|
||||
and the division slash U+2215 in identifiers and rewrites them to
|
||||
plain period and slash.
|
||||
Within an assembler source file, the symbols above are written as
|
||||
<code>fmt·Printf</code> and <code>math∕rand·Int</code>.
|
||||
The assembly listings generated by the compilers when using the <code>-S</code> flag
|
||||
show the period and slash directly instead of the Unicode replacements
|
||||
required by the assemblers.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Most hand-written assembly files do not include the full package path
|
||||
in symbol names, because the linker inserts the package path of the current
|
||||
object file at the beginning of any name starting with a period:
|
||||
in an assembly source file within the math/rand package implementation,
|
||||
the package's Int function can be referred to as <code>·Int</code>.
|
||||
This convention avoids the need to hard-code a package's import path in its
|
||||
own source code, making it easier to move the code from one location to another.
|
||||
</p>
|
||||
|
||||
<h3 id="directives">Directives</h3>
|
||||
|
||||
<p>
|
||||
The assembler uses various directives to bind text and data to symbol names.
|
||||
For example, here is a simple complete function definition. The <code>TEXT</code>
|
||||
directive declares the symbol <code>runtime·profileloop</code> and the instructions
|
||||
that follow form the body of the function.
|
||||
The last instruction in a <code>TEXT</code> block must be some sort of jump, usually a <code>RET</code> (pseudo-)instruction.
|
||||
(If it's not, the linker will append a jump-to-itself instruction; there is no fallthrough in <code>TEXTs</code>.)
|
||||
After the symbol, the arguments are flags (see below)
|
||||
and the frame size, a constant (but see below):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
TEXT runtime·profileloop(SB),NOSPLIT,$8
|
||||
MOVQ $runtime·profileloop1(SB), CX
|
||||
MOVQ CX, 0(SP)
|
||||
CALL runtime·externalthreadhandler(SB)
|
||||
RET
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
In the general case, the frame size is followed by an argument size, separated by a minus sign.
|
||||
(It's not a subtraction, just idiosyncratic syntax.)
|
||||
The frame size <code>$24-8</code> states that the function has a 24-byte frame
|
||||
and is called with 8 bytes of argument, which live on the caller's frame.
|
||||
If <code>NOSPLIT</code> is not specified for the <code>TEXT</code>,
|
||||
the argument size must be provided.
|
||||
For assembly functions with Go prototypes, <code>go</code> <code>vet</code> will check that the
|
||||
argument size is correct.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that the symbol name uses a middle dot to separate the components and is specified as an offset from the
|
||||
static base pseudo-register <code>SB</code>.
|
||||
This function would be called from Go source for package <code>runtime</code> using the
|
||||
simple name <code>profileloop</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Global data symbols are defined by a sequence of initializing
|
||||
<code>DATA</code> directives followed by a <code>GLOBL</code> directive.
|
||||
Each <code>DATA</code> directive initializes a section of the
|
||||
corresponding memory.
|
||||
The memory not explicitly initialized is zeroed.
|
||||
The general form of the <code>DATA</code> directive is
|
||||
|
||||
<pre>
|
||||
DATA symbol+offset(SB)/width, value
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
which initializes the symbol memory at the given offset and width with the given value.
|
||||
The <code>DATA</code> directives for a given symbol must be written with increasing offsets.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>GLOBL</code> directive declares a symbol to be global.
|
||||
The arguments are optional flags and the size of the data being declared as a global,
|
||||
which will have initial value all zeros unless a <code>DATA</code> directive
|
||||
has initialized it.
|
||||
The <code>GLOBL</code> directive must follow any corresponding <code>DATA</code> directives.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For example,
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
DATA divtab<>+0x00(SB)/4, $0xf4f8fcff
|
||||
DATA divtab<>+0x04(SB)/4, $0xe6eaedf0
|
||||
...
|
||||
DATA divtab<>+0x3c(SB)/4, $0x81828384
|
||||
GLOBL divtab<>(SB), RODATA, $64
|
||||
|
||||
GLOBL runtime·tlsoffset(SB), NOPTR, $4
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
declares and initializes <code>divtab<></code>, a read-only 64-byte table of 4-byte integer values,
|
||||
and declares <code>runtime·tlsoffset</code>, a 4-byte, implicitly zeroed variable that
|
||||
contains no pointers.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There may be one or two arguments to the directives.
|
||||
If there are two, the first is a bit mask of flags,
|
||||
which can be written as numeric expressions, added or or-ed together,
|
||||
or can be set symbolically for easier absorption by a human.
|
||||
Their values, defined in the standard <code>#include</code> file <code>textflag.h</code>, are:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<code>NOPROF</code> = 1
|
||||
<br>
|
||||
(For <code>TEXT</code> items.)
|
||||
Don't profile the marked function. This flag is deprecated.
|
||||
</li>
|
||||
<li>
|
||||
<code>DUPOK</code> = 2
|
||||
<br>
|
||||
It is legal to have multiple instances of this symbol in a single binary.
|
||||
The linker will choose one of the duplicates to use.
|
||||
</li>
|
||||
<li>
|
||||
<code>NOSPLIT</code> = 4
|
||||
<br>
|
||||
(For <code>TEXT</code> items.)
|
||||
Don't insert the preamble to check if the stack must be split.
|
||||
The frame for the routine, plus anything it calls, must fit in the
|
||||
spare space at the top of the stack segment.
|
||||
Used to protect routines such as the stack splitting code itself.
|
||||
</li>
|
||||
<li>
|
||||
<code>RODATA</code> = 8
|
||||
<br>
|
||||
(For <code>DATA</code> and <code>GLOBL</code> items.)
|
||||
Put this data in a read-only section.
|
||||
</li>
|
||||
<li>
|
||||
<code>NOPTR</code> = 16
|
||||
<br>
|
||||
(For <code>DATA</code> and <code>GLOBL</code> items.)
|
||||
This data contains no pointers and therefore does not need to be
|
||||
scanned by the garbage collector.
|
||||
</li>
|
||||
<li>
|
||||
<code>WRAPPER</code> = 32
|
||||
<br>
|
||||
(For <code>TEXT</code> items.)
|
||||
This is a wrapper function and should not count as disabling <code>recover</code>.
|
||||
</li>
|
||||
<li>
|
||||
<code>NEEDCTXT</code> = 64
|
||||
<br>
|
||||
(For <code>TEXT</code> items.)
|
||||
This function is a closure so it uses its incoming context register.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="runtime">Runtime Coordination</h3>
|
||||
|
||||
<p>
|
||||
For garbage collection to run correctly, the runtime must know the
|
||||
location of pointers in all global data and in most stack frames.
|
||||
The Go compiler emits this information when compiling Go source files,
|
||||
but assembly programs must define it explicitly.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A data symbol marked with the <code>NOPTR</code> flag (see above)
|
||||
is treated as containing no pointers to runtime-allocated data.
|
||||
A data symbol with the <code>RODATA</code> flag
|
||||
is allocated in read-only memory and is therefore treated
|
||||
as implicitly marked <code>NOPTR</code>.
|
||||
A data symbol with a total size smaller than a pointer
|
||||
is also treated as implicitly marked <code>NOPTR</code>.
|
||||
It is not possible to define a symbol containing pointers in an assembly source file;
|
||||
such a symbol must be defined in a Go source file instead.
|
||||
Assembly source can still refer to the symbol by name
|
||||
even without <code>DATA</code> and <code>GLOBL</code> directives.
|
||||
A good general rule of thumb is to define all non-<code>RODATA</code>
|
||||
symbols in Go instead of in assembly.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Each function also needs annotations giving the location of
|
||||
live pointers in its arguments, results, and local stack frame.
|
||||
For an assembly function with no pointer results and
|
||||
either no local stack frame or no function calls,
|
||||
the only requirement is to define a Go prototype for the function
|
||||
in a Go source file in the same package. The name of the assembly
|
||||
function must not contain the package name component (for example,
|
||||
function <code>Syscall</code> in package <code>syscall</code> should
|
||||
use the name <code>·Syscall</code> instead of the equivalent name
|
||||
<code>syscall·Syscall</code> in its <code>TEXT</code> directive).
|
||||
For more complex situations, explicit annotation is needed.
|
||||
These annotations use pseudo-instructions defined in the standard
|
||||
<code>#include</code> file <code>funcdata.h</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If a function has no arguments and no results,
|
||||
the pointer information can be omitted.
|
||||
This is indicated by an argument size annotation of <code>$<i>n</i>-0</code>
|
||||
on the <code>TEXT</code> instruction.
|
||||
Otherwise, pointer information must be provided by
|
||||
a Go prototype for the function in a Go source file,
|
||||
even for assembly functions not called directly from Go.
|
||||
(The prototype will also let <code>go</code> <code>vet</code> check the argument references.)
|
||||
At the start of the function, the arguments are assumed
|
||||
to be initialized but the results are assumed uninitialized.
|
||||
If the results will hold live pointers during a call instruction,
|
||||
the function should start by zeroing the results and then
|
||||
executing the pseudo-instruction <code>GO_RESULTS_INITIALIZED</code>.
|
||||
This instruction records that the results are now initialized
|
||||
and should be scanned during stack movement and garbage collection.
|
||||
It is typically easier to arrange that assembly functions do not
|
||||
return pointers or do not contain call instructions;
|
||||
no assembly functions in the standard library use
|
||||
<code>GO_RESULTS_INITIALIZED</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If a function has no local stack frame,
|
||||
the pointer information can be omitted.
|
||||
This is indicated by a local frame size annotation of <code>$0-<i>n</i></code>
|
||||
on the <code>TEXT</code> instruction.
|
||||
The pointer information can also be omitted if the
|
||||
function contains no call instructions.
|
||||
Otherwise, the local stack frame must not contain pointers,
|
||||
and the assembly must confirm this fact by executing the
|
||||
pseudo-instruction <code>NO_LOCAL_POINTERS</code>.
|
||||
Because stack resizing is implemented by moving the stack,
|
||||
the stack pointer may change during any function call:
|
||||
even pointers to stack data must not be kept in local variables.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Assembly functions should always be given Go prototypes,
|
||||
both to provide pointer information for the arguments and results
|
||||
and to let <code>go</code> <code>vet</code> check that
|
||||
the offsets being used to access them are correct.
|
||||
</p>
|
||||
|
||||
<h2 id="architectures">Architecture-specific details</h2>
|
||||
|
||||
<p>
|
||||
It is impractical to list all the instructions and other details for each machine.
|
||||
To see what instructions are defined for a given machine, say ARM,
|
||||
look in the source for the <code>obj</code> support library for
|
||||
that architecture, located in the directory <code>src/cmd/internal/obj/arm</code>.
|
||||
In that directory is a file <code>a.out.go</code>; it contains
|
||||
a long list of constants starting with <code>A</code>, like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
const (
|
||||
AAND = obj.ABaseARM + obj.A_ARCHSPECIFIC + iota
|
||||
AEOR
|
||||
ASUB
|
||||
ARSB
|
||||
AADD
|
||||
...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
This is the list of instructions and their spellings as known to the assembler and linker for that architecture.
|
||||
Each instruction begins with an initial capital <code>A</code> in this list, so <code>AAND</code>
|
||||
represents the bitwise and instruction,
|
||||
<code>AND</code> (without the leading <code>A</code>),
|
||||
and is written in assembly source as <code>AND</code>.
|
||||
The enumeration is mostly in alphabetical order.
|
||||
(The architecture-independent <code>AXXX</code>, defined in the
|
||||
<code>cmd/internal/obj</code> package,
|
||||
represents an invalid instruction).
|
||||
The sequence of the <code>A</code> names has nothing to do with the actual
|
||||
encoding of the machine instructions.
|
||||
The <code>cmd/internal/obj</code> package takes care of that detail.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The instructions for both the 386 and AMD64 architectures are listed in
|
||||
<code>cmd/internal/obj/x86/a.out.go</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The architectures share syntax for common addressing modes such as
|
||||
<code>(R1)</code> (register indirect),
|
||||
<code>4(R1)</code> (register indirect with offset), and
|
||||
<code>$foo(SB)</code> (absolute address).
|
||||
The assembler also supports some (not necessarily all) addressing modes
|
||||
specific to each architecture.
|
||||
The sections below list these.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
One detail evident in the examples from the previous sections is that data in the instructions flows from left to right:
|
||||
<code>MOVQ</code> <code>$0,</code> <code>CX</code> clears <code>CX</code>.
|
||||
This rule applies even on architectures where the conventional notation uses the opposite direction.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Here follow some descriptions of key Go-specific details for the supported architectures.
|
||||
</p>
|
||||
|
||||
<h3 id="x86">32-bit Intel 386</h3>
|
||||
|
||||
<p>
|
||||
The runtime pointer to the <code>g</code> structure is maintained
|
||||
through the value of an otherwise unused (as far as Go is concerned) register in the MMU.
|
||||
A OS-dependent macro <code>get_tls</code> is defined for the assembler if the source includes
|
||||
a special header, <code>go_asm.h</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
#include "go_asm.h"
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Within the runtime, the <code>get_tls</code> macro loads its argument register
|
||||
with a pointer to the <code>g</code> pointer, and the <code>g</code> struct
|
||||
contains the <code>m</code> pointer.
|
||||
The sequence to load <code>g</code> and <code>m</code> using <code>CX</code> looks like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
get_tls(CX)
|
||||
MOVL g(CX), AX // Move g into AX.
|
||||
MOVL g_m(AX), BX // Move g.m into BX.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Addressing modes:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>(DI)(BX*2)</code>: The location at address <code>DI</code> plus <code>BX*2</code>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>64(DI)(BX*2)</code>: The location at address <code>DI</code> plus <code>BX*2</code> plus 64.
|
||||
These modes accept only 1, 2, 4, and 8 as scale factors.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
When using the compiler and assembler's
|
||||
<code>-dynlink</code> or <code>-shared</code> modes,
|
||||
any load or store of a fixed memory location such as a global variable
|
||||
must be assumed to overwrite <code>CX</code>.
|
||||
Therefore, to be safe for use with these modes,
|
||||
assembly sources should typically avoid CX except between memory references.
|
||||
</p>
|
||||
|
||||
<h3 id="amd64">64-bit Intel 386 (a.k.a. amd64)</h3>
|
||||
|
||||
<p>
|
||||
The two architectures behave largely the same at the assembler level.
|
||||
Assembly code to access the <code>m</code> and <code>g</code>
|
||||
pointers on the 64-bit version is the same as on the 32-bit 386,
|
||||
except it uses <code>MOVQ</code> rather than <code>MOVL</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
get_tls(CX)
|
||||
MOVQ g(CX), AX // Move g into AX.
|
||||
MOVQ g_m(AX), BX // Move g.m into BX.
|
||||
</pre>
|
||||
|
||||
<h3 id="arm">ARM</h3>
|
||||
|
||||
<p>
|
||||
The registers <code>R10</code> and <code>R11</code>
|
||||
are reserved by the compiler and linker.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>R10</code> points to the <code>g</code> (goroutine) structure.
|
||||
Within assembler source code, this pointer must be referred to as <code>g</code>;
|
||||
the name <code>R10</code> is not recognized.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To make it easier for people and compilers to write assembly, the ARM linker
|
||||
allows general addressing forms and pseudo-operations like <code>DIV</code> or <code>MOD</code>
|
||||
that may not be expressible using a single hardware instruction.
|
||||
It implements these forms as multiple instructions, often using the <code>R11</code> register
|
||||
to hold temporary values.
|
||||
Hand-written assembly can use <code>R11</code>, but doing so requires
|
||||
being sure that the linker is not also using it to implement any of the other
|
||||
instructions in the function.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When defining a <code>TEXT</code>, specifying frame size <code>$-4</code>
|
||||
tells the linker that this is a leaf function that does not need to save <code>LR</code> on entry.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The name <code>SP</code> always refers to the virtual stack pointer described earlier.
|
||||
For the hardware register, use <code>R13</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Condition code syntax is to append a period and the one- or two-letter code to the instruction,
|
||||
as in <code>MOVW.EQ</code>.
|
||||
Multiple codes may be appended: <code>MOVM.IA.W</code>.
|
||||
The order of the code modifiers is irrelevant.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Addressing modes:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>R0->16</code>
|
||||
<br>
|
||||
<code>R0>>16</code>
|
||||
<br>
|
||||
<code>R0<<16</code>
|
||||
<br>
|
||||
<code>R0@>16</code>:
|
||||
For <code><<</code>, left shift <code>R0</code> by 16 bits.
|
||||
The other codes are <code>-></code> (arithmetic right shift),
|
||||
<code>>></code> (logical right shift), and
|
||||
<code>@></code> (rotate right).
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>R0->R1</code>
|
||||
<br>
|
||||
<code>R0>>R1</code>
|
||||
<br>
|
||||
<code>R0<<R1</code>
|
||||
<br>
|
||||
<code>R0@>R1</code>:
|
||||
For <code><<</code>, left shift <code>R0</code> by the count in <code>R1</code>.
|
||||
The other codes are <code>-></code> (arithmetic right shift),
|
||||
<code>>></code> (logical right shift), and
|
||||
<code>@></code> (rotate right).
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>[R0,g,R12-R15]</code>: For multi-register instructions, the set comprising
|
||||
<code>R0</code>, <code>g</code>, and <code>R12</code> through <code>R15</code> inclusive.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>(R5, R6)</code>: Destination register pair.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3 id="arm64">ARM64</h3>
|
||||
|
||||
<p>
|
||||
The ARM64 port is in an experimental state.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Instruction modifiers are appended to the instruction following a period.
|
||||
The only modifiers are <code>P</code> (postincrement) and <code>W</code>
|
||||
(preincrement):
|
||||
<code>MOVW.P</code>, <code>MOVW.W</code>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Addressing modes:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>(R5, R6)</code>: Register pair for <code>LDP</code>/<code>STP</code>.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3 id="ppc64">64-bit PowerPC, a.k.a. ppc64</h3>
|
||||
|
||||
<p>
|
||||
The 64-bit PowerPC port is in an experimental state.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Addressing modes:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>(R5)(R6*1)</code>: The location at <code>R5</code> plus <code>R6</code>. It is a scaled
|
||||
mode as on the x86, but the only scale allowed is <code>1</code>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>(R5+R6)</code>: Alias for (R5)(R6*1)
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3 id="s390x">IBM z/Architecture, a.k.a. s390x</h3>
|
||||
|
||||
<p>
|
||||
The registers <code>R10</code> and <code>R11</code> are reserved.
|
||||
The assembler uses them to hold temporary values when assembling some instructions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>R13</code> points to the <code>g</code> (goroutine) structure.
|
||||
This register must be referred to as <code>g</code>; the name <code>R13</code> is not recognized.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>R15</code> points to the stack frame and should typically only be accessed using the
|
||||
virtual registers <code>SP</code> and <code>FP</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Load- and store-multiple instructions operate on a range of registers.
|
||||
The range of registers is specified by a start register and an end register.
|
||||
For example, <code>LMG</code> <code>(R9),</code> <code>R5,</code> <code>R7</code> would load
|
||||
<code>R5</code>, <code>R6</code> and <code>R7</code> with the 64-bit values at
|
||||
<code>0(R9)</code>, <code>8(R9)</code> and <code>16(R9)</code> respectively.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Storage-and-storage instructions such as <code>MVC</code> and <code>XC</code> are written
|
||||
with the length as the first argument.
|
||||
For example, <code>XC</code> <code>$8,</code> <code>(R9),</code> <code>(R9)</code> would clear
|
||||
eight bytes at the address specified in <code>R9</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If a vector instruction takes a length or an index as an argument then it will be the
|
||||
first argument.
|
||||
For example, <code>VLEIF</code> <code>$1,</code> <code>$16,</code> <code>V2</code> will load
|
||||
the value sixteen into index one of <code>V2</code>.
|
||||
Care should be taken when using vector instructions to ensure that they are available at
|
||||
runtime.
|
||||
To use vector instructions a machine must have both the vector facility (bit 129 in the
|
||||
facility list) and kernel support.
|
||||
Without kernel support a vector instruction will have no effect (it will be equivalent
|
||||
to a <code>NOP</code> instruction).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Addressing modes:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>(R5)(R6*1)</code>: The location at <code>R5</code> plus <code>R6</code>.
|
||||
It is a scaled mode as on the x86, but the only scale allowed is <code>1</code>.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3 id="mips">MIPS, MIPS64</h3>
|
||||
|
||||
<p>
|
||||
General purpose registers are named <code>R0</code> through <code>R31</code>,
|
||||
floating point registers are <code>F0</code> through <code>F31</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>R30</code> is reserved to point to <code>g</code>.
|
||||
<code>R23</code> is used as a temporary register.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In a <code>TEXT</code> directive, the frame size <code>$-4</code> for MIPS or
|
||||
<code>$-8</code> for MIPS64 instructs the linker not to save <code>LR</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>SP</code> refers to the virtual stack pointer.
|
||||
For the hardware register, use <code>R29</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Addressing modes:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<code>16(R1)</code>: The location at <code>R1</code> plus 16.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>(R1)</code>: Alias for <code>0(R1)</code>.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3 id="unsupported_opcodes">Unsupported opcodes</h3>
|
||||
|
||||
<p>
|
||||
The assemblers are designed to support the compiler so not all hardware instructions
|
||||
are defined for all architectures: if the compiler doesn't generate it, it might not be there.
|
||||
If you need to use a missing instruction, there are two ways to proceed.
|
||||
One is to update the assembler to support that instruction, which is straightforward
|
||||
but only worthwhile if it's likely the instruction will be used again.
|
||||
Instead, for simple one-off cases, it's possible to use the <code>BYTE</code>
|
||||
and <code>WORD</code> directives
|
||||
to lay down explicit data into the instruction stream within a <code>TEXT</code>.
|
||||
Here's how the 386 runtime defines the 64-bit atomic load function.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// uint64 atomicload64(uint64 volatile* addr);
|
||||
// so actually
|
||||
// void atomicload64(uint64 *res, uint64 volatile *addr);
|
||||
TEXT runtime·atomicload64(SB), NOSPLIT, $0-12
|
||||
MOVL ptr+0(FP), AX
|
||||
TESTL $7, AX
|
||||
JZ 2(PC)
|
||||
MOVL 0, AX // crash with nil ptr deref
|
||||
LEAL ret_lo+4(FP), BX
|
||||
// MOVQ (%EAX), %MM0
|
||||
BYTE $0x0f; BYTE $0x6f; BYTE $0x00
|
||||
// MOVQ %MM0, 0(%EBX)
|
||||
BYTE $0x0f; BYTE $0x7f; BYTE $0x03
|
||||
// EMMS
|
||||
BYTE $0x0F; BYTE $0x77
|
||||
RET
|
||||
</pre>
|
||||
34
doc/cmd.html
@@ -22,14 +22,14 @@ 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>
|
||||
|
||||
<p>
|
||||
Finally the <code>fmt</code> and <code>godoc</code> commands are installed
|
||||
as regular binaries called <code>gofmt</code> and <code>godoc</code> because
|
||||
they are so often referenced.
|
||||
Finally, two of the commands, <code>fmt</code> and <code>doc</code>, are also
|
||||
installed as regular binaries called <code>gofmt</code> and <code>godoc</code>
|
||||
because they are so often referenced.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -61,13 +61,6 @@ details.
|
||||
<td>Cgo enables the creation of Go packages that call C code.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/fix/">fix</a></td>
|
||||
<td> </td>
|
||||
@@ -75,6 +68,13 @@ generated by <code>"go test -coverprofile"</code>.</td>
|
||||
and rewrites them to use newer ones.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/go/">doc</a></td>
|
||||
<td> </td>
|
||||
<td>Doc extracts and generates documentation for Go packages, it is also available as
|
||||
an independent <a href="/cmd/godoc/">godoc</a> command with more general options.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/go/">fmt</a></td>
|
||||
<td> </td>
|
||||
@@ -82,12 +82,6 @@ and rewrites them to use newer ones.</td>
|
||||
gofmt</a> command with more general options.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="//godoc.org/golang.org/x/tools/cmd/godoc/">godoc</a></td>
|
||||
<td> </td>
|
||||
<td>Godoc extracts and generates documentation for Go packages.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/vet/">vet</a></td>
|
||||
<td> </td>
|
||||
@@ -95,6 +89,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>
|
||||
|
||||
311
doc/code.html
@@ -18,37 +18,27 @@ It explains the simplest way to get up and running with your Go installation.
|
||||
|
||||
<p>
|
||||
A similar explanation is available as a
|
||||
<a href="//www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>.
|
||||
<a href="http://www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="Organization">Code organization</h2>
|
||||
|
||||
<h3 id="Overview">Overview</h3>
|
||||
|
||||
<ul>
|
||||
<li>Go programmers typically keep all their Go code in a single <i>workspace</i>.</li>
|
||||
<li>A workspace contains many version control <i>repositories</i>
|
||||
(managed by Git, for example).</li>
|
||||
<li>Each repository contains one or more <i>packages</i>.</li>
|
||||
<li>Each package consists of one or more Go source files in a single directory.</li>
|
||||
<li>The path to a package's directory determines its <i>import path</i>.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Note that this differs from other programming environments in which every
|
||||
project has a separate workspace and workspaces are closely tied to version
|
||||
control repositories.
|
||||
</p>
|
||||
|
||||
<h3 id="Workspaces">Workspaces</h3>
|
||||
|
||||
<p>
|
||||
The <code>go</code> tool is designed to work with open source code maintained
|
||||
in public repositories. Although you don't need to publish your code, the model
|
||||
for how the environment is set up works the same whether you do or not.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go code must be kept inside a <i>workspace</i>.
|
||||
A workspace is a directory hierarchy with three directories at its root:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><code>src</code> contains Go source files,
|
||||
<li><code>src</code> contains Go source files organized into packages (one package per directory),
|
||||
<li><code>pkg</code> contains package objects, and
|
||||
<li><code>bin</code> contains executable commands.
|
||||
</ul>
|
||||
@@ -70,44 +60,37 @@ To give you an idea of how a workspace looks in practice, here's an example:
|
||||
|
||||
<pre>
|
||||
bin/
|
||||
hello # command executable
|
||||
outyet # command executable
|
||||
streak # command executable
|
||||
todo # command executable
|
||||
pkg/
|
||||
linux_amd64/
|
||||
github.com/golang/example/
|
||||
stringutil.a # package object
|
||||
code.google.com/p/goauth2/
|
||||
oauth.a # package object
|
||||
github.com/nf/todo/
|
||||
task.a # package object
|
||||
src/
|
||||
<a href="https://github.com/golang/example/">github.com/golang/example/</a>
|
||||
.git/ # Git repository metadata
|
||||
hello/
|
||||
hello.go # command source
|
||||
outyet/
|
||||
main.go # command source
|
||||
main_test.go # test source
|
||||
stringutil/
|
||||
reverse.go # package source
|
||||
reverse_test.go # test source
|
||||
<a href="https://golang.org/x/image/">golang.org/x/image/</a>
|
||||
.git/ # Git repository metadata
|
||||
bmp/
|
||||
reader.go # package source
|
||||
writer.go # package source
|
||||
... (many more repositories and packages omitted) ...
|
||||
code.google.com/p/goauth2/
|
||||
.hg/ # mercurial repository metadata
|
||||
oauth/
|
||||
oauth.go # package source
|
||||
oauth_test.go # test source
|
||||
github.com/nf/
|
||||
streak/
|
||||
.git/ # git repository metadata
|
||||
oauth.go # command source
|
||||
streak.go # command source
|
||||
todo/
|
||||
.git/ # git repository metadata
|
||||
task/
|
||||
task.go # package source
|
||||
todo.go # command source
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The tree above shows a workspace containing two repositories
|
||||
(<code>example</code> and <code>image</code>).
|
||||
The <code>example</code> repository contains two commands (<code>hello</code>
|
||||
and <code>outyet</code>) and one library (<code>stringutil</code>).
|
||||
The <code>image</code> repository contains the <code>bmp</code> package
|
||||
and <a href="https://godoc.org/golang.org/x/image">several others</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A typical workspace contains many source repositories containing many
|
||||
packages and commands. Most Go programmers keep <i>all</i> their Go source code
|
||||
and dependencies in a single workspace.
|
||||
This workspace contains three repositories (<code>goauth2</code>,
|
||||
<code>streak</code>, and <code>todo</code>) comprising two commands
|
||||
(<code>streak</code> and <code>todo</code>) and two libraries
|
||||
(<code>oauth</code> and <code>task</code>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -120,26 +103,21 @@ We will discuss the distinction <a href="#PackageNames">later</a>.
|
||||
|
||||
<p>
|
||||
The <code>GOPATH</code> environment variable specifies the location of your
|
||||
workspace. It defaults to a directory named <code>go</code> inside your home directory,
|
||||
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.
|
||||
workspace. It is likely the only environment variable you'll need to set
|
||||
when developing Go code.
|
||||
</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.
|
||||
(Another common setup is to set <code>GOPATH=$HOME</code>.)
|
||||
Note that <code>GOPATH</code> must <b>not</b> be the
|
||||
To get started, create a workspace directory and set <code>GOPATH</code>
|
||||
accordingly. Your workspace can be located wherever you like, but we'll use
|
||||
<code>$HOME/go</code> in this document. Note that this must <b>not</b> be the
|
||||
same path as your Go installation.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The command <code>go</code> <code>env</code> <code>GOPATH</code>
|
||||
prints the effective current <code>GOPATH</code>;
|
||||
it prints the default location if the environment variable is unset.
|
||||
</p>
|
||||
<pre>
|
||||
$ <b>mkdir $HOME/go</b>
|
||||
$ <b>export GOPATH=$HOME/go</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
For convenience, add the workspace's <code>bin</code> subdirectory
|
||||
@@ -147,42 +125,14 @@ to your <code>PATH</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>export PATH=$PATH:$(go env GOPATH)/bin</b>
|
||||
$ <b>export PATH=$PATH:$GOPATH/bin</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The scripts in the rest of this document use <code>$GOPATH</code>
|
||||
instead of <code>$(go env GOPATH)</code> for brevity.
|
||||
To make the scripts run as written
|
||||
if you have not set GOPATH,
|
||||
you can substitute $HOME/go in those commands
|
||||
or else run:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>export GOPATH=$(go env GOPATH)</b>
|
||||
</pre>
|
||||
<h3 id="PackagePaths">Package paths</h3>
|
||||
|
||||
<p>
|
||||
To learn more about the <code>GOPATH</code> environment variable, see
|
||||
<a href="/cmd/go/#hdr-GOPATH_environment_variable"><code>'go help gopath'</code></a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To use a custom workspace location,
|
||||
<a href="https://golang.org/wiki/SettingGOPATH">set the <code>GOPATH</code> environment variable</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="ImportPaths">Import paths</h3>
|
||||
|
||||
<p>
|
||||
An <i>import path</i> is a string that uniquely identifies a package.
|
||||
A package's import path corresponds to its location inside a workspace
|
||||
or in a remote repository (explained below).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The packages from the standard library are given short import paths such as
|
||||
The packages from the standard library are given short paths such as
|
||||
<code>"fmt"</code> and <code>"net/http"</code>.
|
||||
For your own packages, you must choose a base path that is unlikely to
|
||||
collide with future additions to the standard library or other external
|
||||
@@ -306,7 +256,7 @@ optional: you do not need to use source control to write Go code.
|
||||
<pre>
|
||||
$ <b>cd $GOPATH/src/github.com/user/hello</b>
|
||||
$ <b>git init</b>
|
||||
Initialized empty Git repository in /home/user/work/src/github.com/user/hello/.git/
|
||||
Initialized empty Git repository in /home/user/go/src/github.com/user/hello/.git/
|
||||
$ <b>git add hello.go</b>
|
||||
$ <b>git commit -m "initial commit"</b>
|
||||
[master (root-commit) 0b4507d] initial commit
|
||||
@@ -327,29 +277,29 @@ Let's write a library and use it from the <code>hello</code> program.
|
||||
|
||||
<p>
|
||||
Again, the first step is to choose a package path (we'll use
|
||||
<code>github.com/user/stringutil</code>) and create the package directory:
|
||||
<code>github.com/user/newmath</code>) and create the package directory:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>mkdir $GOPATH/src/github.com/user/stringutil</b>
|
||||
$ <b>mkdir $GOPATH/src/github.com/user/newmath</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Next, create a file named <code>reverse.go</code> in that directory with the
|
||||
Next, create a file named <code>sqrt.go</code> in that directory with the
|
||||
following contents.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// Package stringutil contains utility functions for working with strings.
|
||||
package stringutil
|
||||
// Package newmath is a trivial example package.
|
||||
package newmath
|
||||
|
||||
// Reverse returns its argument string reversed rune-wise left to right.
|
||||
func Reverse(s string) string {
|
||||
r := []rune(s)
|
||||
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
|
||||
r[i], r[j] = r[j], r[i]
|
||||
// Sqrt returns an approximation to the square root of x.
|
||||
func Sqrt(x float64) float64 {
|
||||
z := 0.0
|
||||
for i := 0; i < 1000; i++ {
|
||||
z -= (z*z - x) / (2 * x)
|
||||
}
|
||||
return string(r)
|
||||
return z
|
||||
}
|
||||
</pre>
|
||||
|
||||
@@ -358,7 +308,7 @@ Now, test that the package compiles with <code>go build</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go build github.com/user/stringutil</b>
|
||||
$ <b>go build github.com/user/newmath</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -376,7 +326,7 @@ directory of the workspace.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
After confirming that the <code>stringutil</code> package builds,
|
||||
After confirming that the <code>newmath</code> package builds,
|
||||
modify your original <code>hello.go</code> (which is in
|
||||
<code>$GOPATH/src/github.com/user/hello</code>) to use it:
|
||||
</p>
|
||||
@@ -387,18 +337,18 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
<b>"github.com/user/stringutil"</b>
|
||||
<b>"github.com/user/newmath"</b>
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Printf(stringutil.Reverse("!oG ,olleH"))
|
||||
fmt.Printf("Hello, world. <b>Sqrt(2) = %v\n", newmath.Sqrt(2)</b>)
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Whenever the <code>go</code> tool installs a package or binary, it also
|
||||
installs whatever dependencies it has.
|
||||
So when you install the <code>hello</code> program
|
||||
installs whatever dependencies it has. So when you install the <code>hello</code>
|
||||
program
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -406,16 +356,16 @@ $ <b>go install github.com/user/hello</b>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
the <code>stringutil</code> package will be installed as well, automatically.
|
||||
the <code>newmath</code> package will be installed as well, automatically.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Running the new version of the program, you should see a new, reversed message:
|
||||
Running the new version of the program, you should see some numerical output:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>hello</b>
|
||||
Hello, Go!
|
||||
Hello, world. Sqrt(2) = 1.414213562373095
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -424,22 +374,22 @@ After the steps above, your workspace should look like this:
|
||||
|
||||
<pre>
|
||||
bin/
|
||||
hello # command executable
|
||||
hello # command executable
|
||||
pkg/
|
||||
linux_amd64/ # this will reflect your OS and architecture
|
||||
linux_amd64/ # this will reflect your OS and architecture
|
||||
github.com/user/
|
||||
stringutil.a # package object
|
||||
newmath.a # package object
|
||||
src/
|
||||
github.com/user/
|
||||
hello/
|
||||
hello.go # command source
|
||||
stringutil/
|
||||
reverse.go # package source
|
||||
hello.go # command source
|
||||
newmath/
|
||||
sqrt.go # package source
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Note that <code>go install</code> placed the <code>stringutil.a</code> object
|
||||
in a directory inside <code>pkg/linux_amd64</code> that mirrors its source
|
||||
Note that <code>go install</code> placed the <code>newmath.a</code> object in a
|
||||
directory inside <code>pkg/linux_amd64</code> that mirrors its source
|
||||
directory.
|
||||
This is so that future invocations of the <code>go</code> tool can find the
|
||||
package object and avoid recompiling the package unnecessarily.
|
||||
@@ -507,29 +457,20 @@ if the function calls a failure function such as <code>t.Error</code> or
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Add a test to the <code>stringutil</code> package by creating the file
|
||||
<code>$GOPATH/src/github.com/user/stringutil/reverse_test.go</code> containing
|
||||
the following Go code.
|
||||
Add a test to the <code>newmath</code> package by creating the file
|
||||
<code>$GOPATH/src/github.com/user/newmath/sqrt_test.go</code> containing the
|
||||
following Go code.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
package stringutil
|
||||
package newmath
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestReverse(t *testing.T) {
|
||||
cases := []struct {
|
||||
in, want string
|
||||
}{
|
||||
{"Hello, world", "dlrow ,olleH"},
|
||||
{"Hello, 世界", "界世 ,olleH"},
|
||||
{"", ""},
|
||||
}
|
||||
for _, c := range cases {
|
||||
got := Reverse(c.in)
|
||||
if got != c.want {
|
||||
t.Errorf("Reverse(%q) == %q, want %q", c.in, got, c.want)
|
||||
}
|
||||
func TestSqrt(t *testing.T) {
|
||||
const in, out = 4, 2
|
||||
if x := Sqrt(in); x != out {
|
||||
t.Errorf("Sqrt(%v) = %v, want %v", in, x, out)
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
@@ -539,8 +480,8 @@ Then run the test with <code>go test</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go test github.com/user/stringutil</b>
|
||||
ok github.com/user/stringutil 0.165s
|
||||
$ <b>go test github.com/user/newmath</b>
|
||||
ok github.com/user/newmath 0.165s
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -550,7 +491,7 @@ directory, you can omit the package path:
|
||||
|
||||
<pre>
|
||||
$ <b>go test</b>
|
||||
ok github.com/user/stringutil 0.165s
|
||||
ok github.com/user/newmath 0.165s
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -566,16 +507,16 @@ An import path can describe how to obtain the package source code using a
|
||||
revision control system such as Git or Mercurial. The <code>go</code> tool uses
|
||||
this property to automatically fetch packages from remote repositories.
|
||||
For instance, the examples described in this document are also kept in a
|
||||
Git repository hosted at GitHub
|
||||
<code><a href="https://github.com/golang/example">github.com/golang/example</a></code>.
|
||||
Mercurial repository hosted at Google Code,
|
||||
<code><a href="http://code.google.com/p/go.example">code.google.com/p/go.example</a></code>.
|
||||
If you include the repository URL in the package's import path,
|
||||
<code>go get</code> will fetch, build, and install it automatically:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ <b>go get github.com/golang/example/hello</b>
|
||||
$ <b>go get code.google.com/p/go.example/hello</b>
|
||||
$ <b>$GOPATH/bin/hello</b>
|
||||
Hello, Go examples!
|
||||
Hello, world. Sqrt(2) = 1.414213562373095
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -592,62 +533,54 @@ tree should now look like this:
|
||||
|
||||
<pre>
|
||||
bin/
|
||||
hello # command executable
|
||||
hello # command executable
|
||||
pkg/
|
||||
linux_amd64/
|
||||
github.com/golang/example/
|
||||
stringutil.a # package object
|
||||
code.google.com/p/go.example/
|
||||
newmath.a # package object
|
||||
github.com/user/
|
||||
stringutil.a # package object
|
||||
newmath.a # package object
|
||||
src/
|
||||
github.com/golang/example/
|
||||
.git/ # Git repository metadata
|
||||
code.google.com/p/go.example/
|
||||
hello/
|
||||
hello.go # command source
|
||||
stringutil/
|
||||
reverse.go # package source
|
||||
reverse_test.go # test source
|
||||
hello.go # command source
|
||||
newmath/
|
||||
sqrt.go # package source
|
||||
sqrt_test.go # test source
|
||||
github.com/user/
|
||||
hello/
|
||||
hello.go # command source
|
||||
stringutil/
|
||||
reverse.go # package source
|
||||
reverse_test.go # test source
|
||||
hello.go # command source
|
||||
newmath/
|
||||
sqrt.go # package source
|
||||
sqrt_test.go # test source
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The <code>hello</code> command hosted at GitHub depends on the
|
||||
<code>stringutil</code> package within the same repository. The imports in
|
||||
<code>hello.go</code> file use the same import path convention, so the
|
||||
<code>go get</code> command is able to locate and install the dependent
|
||||
package, too.
|
||||
The <code>hello</code> command hosted at Google Code depends on the
|
||||
<code>newmath</code> package within the same repository. The imports in
|
||||
<code>hello.go</code> file use the same import path convention, so the <code>go
|
||||
get</code> command is able to locate and install the dependent package, too.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
import "github.com/golang/example/stringutil"
|
||||
import "code.google.com/p/go.example/newmath"
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
This convention is the easiest way to make your Go packages available for
|
||||
others to use.
|
||||
The <a href="//golang.org/wiki/Projects">Go Wiki</a>
|
||||
and <a href="//godoc.org/">godoc.org</a>
|
||||
The <a href="http://code.google.com/p/go-wiki/wiki/Projects">Go Wiki</a>
|
||||
and <a href="http://godoc.org/">godoc.org</a>
|
||||
provide lists of external Go projects.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For more information on using remote repositories with the <code>go</code> tool, see
|
||||
<code><a href="/cmd/go/#hdr-Remote_import_paths">go help importpath</a></code>.
|
||||
<code><a href="/cmd/go/#hdr-Remote_import_path_syntax">go help remote</a></code>.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="next">What's next</h2>
|
||||
|
||||
<p>
|
||||
Subscribe to the
|
||||
<a href="//groups.google.com/group/golang-announce">golang-announce</a>
|
||||
mailing list to be notified when a new stable version of Go is released.
|
||||
</p>
|
||||
<h2 id="more">Further reading</h2>
|
||||
|
||||
<p>
|
||||
See <a href="/doc/effective_go.html">Effective Go</a> for tips on writing
|
||||
@@ -655,7 +588,7 @@ clear, idiomatic Go code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Take <a href="//tour.golang.org/">A Tour of Go</a> to learn the language
|
||||
Take <a href="http://tour.golang.org/">A Tour of Go</a> to learn the language
|
||||
proper.
|
||||
</p>
|
||||
|
||||
@@ -663,21 +596,3 @@ proper.
|
||||
Visit the <a href="/doc/#articles">documentation page</a> for a set of in-depth
|
||||
articles about the Go language and its libraries and tools.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="help">Getting help</h2>
|
||||
|
||||
<p>
|
||||
For real-time help, ask the helpful gophers in <code>#go-nuts</code> on the
|
||||
<a href="http://freenode.net/">Freenode</a> IRC server.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The official mailing list for discussion of the Go language is
|
||||
<a href="//groups.google.com/group/golang-nuts">Go Nuts</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Report bugs using the
|
||||
<a href="//golang.org/issue">Go issue tracker</a>.
|
||||
</p>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2010 The Go Authors. All rights reserved.
|
||||
// Copyright 2010 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
@@ -296,7 +296,7 @@ CodewalkViewer.prototype.updateHeight = function() {
|
||||
this.sizer.height(codeHeight);
|
||||
};
|
||||
|
||||
window.initFuncs.push(function() {
|
||||
jQuery(document).ready(function() {
|
||||
var viewer = new CodewalkViewer(jQuery('#codewalk-main'));
|
||||
viewer.selectFirstComment();
|
||||
viewer.targetCommentLinksAtBlank();
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
its <code>src</code> is just a file name.
|
||||
</step>
|
||||
|
||||
<step title="Specifying a source line" src='doc/codewalk/codewalk.xml:/title="Title"/'>
|
||||
<step title="Specifiying a source line" src='doc/codewalk/codewalk.xml:/title="Title"/'>
|
||||
The most complex part of the codewalk specification is
|
||||
saying what lines to highlight.
|
||||
Instead of ordinary line numbers,
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
The full address syntax is summarized in this table
|
||||
(an excerpt of Table II from
|
||||
<a href="https://9p.io/sys/doc/sam/sam.html">The text editor <code>sam</code></a>):
|
||||
<a href="http://plan9.bell-labs.com/sys/doc/sam/sam.html">The text editor <code>sam</code></a>):
|
||||
<br/><br/>
|
||||
|
||||
<table>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
Copyright 2011 The Go Authors. All rights reserved.
|
||||
Copyright 2011 The Go Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style
|
||||
license that can be found in the LICENSE file.
|
||||
-->
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2013 The Go Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
set -e
|
||||
|
||||
function fail {
|
||||
echo FAIL: doc/codewalk/$1
|
||||
exit 1
|
||||
}
|
||||
|
||||
# markov.xml
|
||||
echo foo | go run markov.go | grep foo > /dev/null || fail markov
|
||||
|
||||
# functions.xml
|
||||
go run pig.go | grep 'Wins, losses staying at k = 100: 210/990 (21.2%), 780/990 (78.8%)' > /dev/null || fail pig
|
||||
|
||||
# sharemem.xml: only build the example, as it uses the network
|
||||
go build urlpoll.go || fail urlpoll
|
||||
rm -f urlpoll
|
||||
@@ -171,7 +171,7 @@ and/or writes to a shared map.
|
||||
|
||||
<step title="Conclusion" src="doc/codewalk/urlpoll.go">
|
||||
In this codewalk we have explored a simple example of using Go's concurrency
|
||||
primitives to share memory through communication.
|
||||
primitives to share memory through commmunication.
|
||||
<br/><br/>
|
||||
This should provide a starting point from which to explore the ways in which
|
||||
goroutines and channels can be used to write expressive and concise concurrent
|
||||
|
||||
260
doc/conduct.html
@@ -1,260 +0,0 @@
|
||||
<!--{
|
||||
"Title": "Go Community Code of Conduct",
|
||||
"Path": "/conduct",
|
||||
"Template": true
|
||||
}-->
|
||||
|
||||
<style>
|
||||
ul {
|
||||
max-width: 800px;
|
||||
}
|
||||
ul ul {
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h2 id="about">About the Code of Conduct</h2>
|
||||
|
||||
<h3 id="why">Why have a Code of Conduct?</h3>
|
||||
|
||||
<p>
|
||||
Online communities include people from many different backgrounds.
|
||||
The Go contributors are committed to providing a friendly, safe and welcoming
|
||||
environment for all, regardless of age, disability, gender, nationality,
|
||||
ethnicity, religion, sexuality, or similar personal characteristic.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The first goal of the Code of Conduct is to specify a baseline standard
|
||||
of behavior so that people with different social values and communication
|
||||
styles can talk about Go effectively, productively, and respectfully.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The second goal is to provide a mechanism for resolving conflicts in the
|
||||
community when they arise.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The third goal of the Code of Conduct is to make our community welcoming to
|
||||
people from different backgrounds.
|
||||
Diversity is critical to the project; for Go to be successful, it needs
|
||||
contributors and users from all backgrounds.
|
||||
(See <a href="https://blog.golang.org/open-source">Go, Open Source, Community</a>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
With that said, a healthy community must allow for disagreement and debate.
|
||||
The Code of Conduct is not a mechanism for people to silence others with whom
|
||||
they disagree.
|
||||
</p>
|
||||
|
||||
<h3 id="spaces">Where does the Code of Conduct apply?</h3>
|
||||
|
||||
<p>
|
||||
If you participate in or contribute to the Go ecosystem in any way,
|
||||
you are encouraged to follow the Code of Conduct while doing so.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Explicit enforcement of the Code of Conduct applies to the
|
||||
official forums operated by the Go project (“Go spaces”):
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>The official <a href="https://github.com/golang/">GitHub projects</a>
|
||||
and <a href="https://go-review.googlesource.com/">code reviews</a>.
|
||||
<li>The <a href="https://groups.google.com/group/golang-nuts">golang-nuts</a> and
|
||||
<a href="https://groups.google.com/group/golang-dev">golang-dev</a> mailing lists.
|
||||
<li>The #go-nuts IRC channel on Freenode.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Other Go groups (such as conferences, meetups, and other unofficial forums) are
|
||||
encouraged to adopt this Code of Conduct. Those groups must provide their own
|
||||
moderators and/or working group (see below).
|
||||
</p>
|
||||
|
||||
<h2 id="values">Gopher values</h2>
|
||||
|
||||
<p>
|
||||
These are the values to which people in the Go community (“Gophers”) should aspire.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Be friendly and welcoming
|
||||
<li>Be patient
|
||||
<ul>
|
||||
<li>Remember that people have varying communication styles and that not
|
||||
everyone is using their native language.
|
||||
(Meaning and tone can be lost in translation.)
|
||||
</ul>
|
||||
<li>Be thoughtful
|
||||
<ul>
|
||||
<li>Productive communication requires effort.
|
||||
Think about how your words will be interpreted.
|
||||
<li>Remember that sometimes it is best to refrain entirely from commenting.
|
||||
</ul>
|
||||
<li>Be respectful
|
||||
<ul>
|
||||
<li>In particular, respect differences of opinion.
|
||||
</ul>
|
||||
<li>Be charitable
|
||||
<ul>
|
||||
<li>Interpret the arguments of others in good faith, do not seek to disagree.
|
||||
<li>When we do disagree, try to understand why.
|
||||
</ul>
|
||||
<li>Avoid destructive behavior:
|
||||
<ul>
|
||||
<li>Derailing: stay on topic; if you want to talk about something else,
|
||||
start a new conversation.
|
||||
<li>Unconstructive criticism: don't merely decry the current state of affairs;
|
||||
offer—or at least solicit—suggestions as to how things may be improved.
|
||||
<li>Snarking (pithy, unproductive, sniping comments)
|
||||
<li>Discussing potentially offensive or sensitive issues;
|
||||
this all too often leads to unnecessary conflict.
|
||||
<li>Microaggressions: brief and commonplace verbal, behavioral and
|
||||
environmental indignities that communicate hostile, derogatory or negative
|
||||
slights and insults to a person or group.
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
People are complicated.
|
||||
You should expect to be misunderstood and to misunderstand others;
|
||||
when this inevitably occurs, resist the urge to be defensive or assign blame.
|
||||
Try not to take offense where no offense was intended.
|
||||
Give people the benefit of the doubt.
|
||||
Even if the intent was to provoke, do not rise to it.
|
||||
It is the responsibility of <i>all parties</i> to de-escalate conflict when it arises.
|
||||
</p>
|
||||
|
||||
<h2 id="unwelcome_behavior">Unwelcome behavior</h2>
|
||||
|
||||
<p>
|
||||
These actions are explicitly forbidden in Go spaces:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Insulting, demeaning, hateful, or threatening remarks.
|
||||
<li>Discrimination based on age, disability, gender, nationality, race,
|
||||
religion, sexuality, or similar personal characteristic.
|
||||
<li>Bullying or systematic harassment.
|
||||
<li>Unwelcome sexual advances.
|
||||
<li>Incitement to any of these.
|
||||
</ul>
|
||||
|
||||
<h2 id="moderation">Moderation</h2>
|
||||
|
||||
<p>
|
||||
The Go spaces are not free speech venues; they are for discussion about Go.
|
||||
Each of these spaces have their own moderators.
|
||||
</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.
|
||||
</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.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Complaints about working group member or moderator actions must be handled
|
||||
using the reporting process below.
|
||||
</p>
|
||||
|
||||
<h2 id="reporting">Reporting issues</h2>
|
||||
|
||||
<p>
|
||||
The Code of Conduct Working Group is a group of people that represent the Go
|
||||
community. They are responsible for handling conduct-related issues.
|
||||
Their purpose is to de-escalate conflicts and try to resolve issues to the
|
||||
satisfaction of all parties. They are:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Aditya Mukerjee <dev@chimeracoder.net>
|
||||
<li>Andrew Gerrand <adg@golang.org>
|
||||
<li>Peggy Li <peggyli.224@gmail.com>
|
||||
<li>Sarah Adams <sadams.codes@gmail.com>
|
||||
<li>Steve Francia <steve.francia@gmail.com>
|
||||
<li>Verónica López <gveronicalg@gmail.com>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
If you encounter a conduct-related issue, you should report it to the
|
||||
Working Group using the process described below.
|
||||
<b>Do not</b> post about the issue publicly or try to rally sentiment against a
|
||||
particular individual or group.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Mail <a href="mailto:conduct@golang.org">conduct@golang.org</a>.
|
||||
<ul>
|
||||
<li>Your message will reach the Working Group.
|
||||
<li>Reports are confidential within the Working Group.
|
||||
<li>You may contact a member of the group directly if you do not feel
|
||||
comfortable contacting the group as a whole. That member will then raise
|
||||
the issue with the Working Group as a whole, preserving the privacy of the
|
||||
reporter (if desired).
|
||||
<li>If your report concerns a member of the Working Group they will be recused
|
||||
from Working Group discussions of the report.
|
||||
<li>The Working Group will strive to handle reports with discretion and
|
||||
sensitivity, to protect the privacy of the involved parties,
|
||||
and to avoid conflicts of interest.
|
||||
</ul>
|
||||
<li>You should receive a response within 48 hours (likely sooner).
|
||||
(Should you choose to contact a single Working Group member,
|
||||
it may take longer to receive a response.)
|
||||
<li>The Working Group will meet to review the incident and determine what happened.
|
||||
<ul>
|
||||
<li>With the permission of person reporting the incident, the Working Group
|
||||
may reach out to other community members for more context.
|
||||
</ul>
|
||||
<li>The Working Group will reach a decision as to how to act. These may include:
|
||||
<ul>
|
||||
<li>Nothing.
|
||||
<li>Passing the report along to the offender.
|
||||
<li>A recommendation of action to the relevant forum moderators.
|
||||
</ul>
|
||||
<li>The Working Group will reach out to the original reporter to let them know
|
||||
the decision.
|
||||
<li>Appeals to the decision may be made to the Working Group,
|
||||
or to any of its members directly.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<b>Note that the goal of the Code of Conduct and the Working Group is to resolve
|
||||
conflicts in the most harmonious way possible.</b>
|
||||
We hope that in most cases issues may be resolved through polite discussion and
|
||||
mutual agreement.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Changes to the Code of Conduct (including to the members of the Working Group)
|
||||
should be proposed using the
|
||||
<a href="https://golang.org/s/proposal-process">change proposal process</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="summary">Summary</h2>
|
||||
|
||||
<ul>
|
||||
<li>Treat everyone with respect and kindness.
|
||||
<li>Be thoughtful in how you communicate.
|
||||
<li>Don’t be destructive or inflammatory.
|
||||
<li>If you encounter an issue, please mail <a href="mailto:conduct@golang.org">conduct@golang.org</a>.
|
||||
</ul>
|
||||
|
||||
<h3 id="acknowledgements">Acknowledgements</h3>
|
||||
|
||||
<p>
|
||||
Parts of this document were derived from the Code of Conduct documents of the
|
||||
Django, FreeBSD, and Rust projects.
|
||||
</p>
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<p>
|
||||
Go is an open source project developed by a team at
|
||||
<a href="//google.com/">Google</a> and many
|
||||
<a href="http://google.com/">Google</a> and many
|
||||
<a href="/CONTRIBUTORS">contributors</a> from the open source community.
|
||||
</p>
|
||||
|
||||
@@ -17,73 +17,46 @@ Go is an open source project developed by a team at
|
||||
Go is distributed under a <a href="/LICENSE">BSD-style license</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="announce"><a href="//groups.google.com/group/golang-announce">Announcements Mailing List</a></h3>
|
||||
<h3 id="announce"><a href="http://groups.google.com/group/golang-announce">Announcements Mailing List</a></h3>
|
||||
<p>
|
||||
A low traffic mailing list for important announcements, such as new releases.
|
||||
</p>
|
||||
<p>
|
||||
We encourage all Go users to subscribe to
|
||||
<a href="//groups.google.com/group/golang-announce">golang-announce</a>.
|
||||
<a href="http://groups.google.com/group/golang-announce">golang-announce</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="go1">Version history</h2>
|
||||
|
||||
<h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3>
|
||||
|
||||
<p>A <a href="/doc/devel/release.html">summary</a> of the changes between Go releases. Notes for the major releases:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="/doc/go1.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>
|
||||
<li><a href="/doc/go1.4">Go 1.4</a> <small>(December 2014)</small></li>
|
||||
<li><a href="/doc/go1.3">Go 1.3</a> <small>(June 2014)</small></li>
|
||||
<li><a href="/doc/go1.2">Go 1.2</a> <small>(December 2013)</small></li>
|
||||
<li><a href="/doc/go1.1">Go 1.1</a> <small>(May 2013)</small></li>
|
||||
<li><a href="/doc/go1">Go 1</a> <small>(March 2012)</small></li>
|
||||
</ul>
|
||||
|
||||
<h3 id="go1compat"><a href="/doc/go1compat">Go 1 and the Future of Go Programs</a></h3>
|
||||
<p>
|
||||
What Go 1 defines and the backwards-compatibility guarantees one can expect as
|
||||
Go 1 matures.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="resources">Developer Resources</h2>
|
||||
|
||||
<h3 id="source"><a href="https://golang.org/change">Source Code</a></h3>
|
||||
<h3 id="source"><a href="https://code.google.com/p/go/source">Source Code</a></h3>
|
||||
<p>Check out the Go source code.</p>
|
||||
|
||||
<h3 id="golang-dev"><a href="https://groups.google.com/group/golang-dev">Developer</a> and
|
||||
<a href="https://groups.google.com/group/golang-codereviews">Code Review Mailing List</a></h3>
|
||||
<p>The <a href="https://groups.google.com/group/golang-dev">golang-dev</a>
|
||||
mailing list is for discussing code changes to the Go project.
|
||||
The <a href="https://groups.google.com/group/golang-codereviews">golang-codereviews</a>
|
||||
mailing list is for actual reviewing of the code changes (CLs).</p>
|
||||
<h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3>
|
||||
<p>A summary of the changes between Go releases.</p>
|
||||
|
||||
<h3 id="golang-dev"><a href="http://groups.google.com/group/golang-dev">Developer Mailing List</a></h3>
|
||||
<p>The <a href="http://groups.google.com/group/golang-dev">golang-dev</a>
|
||||
mailing list is for discussing and reviewing code for the Go project.</p>
|
||||
<p>For general discussion of Go programming, see <a
|
||||
href="https://groups.google.com/group/golang-nuts">golang-nuts</a>.</p>
|
||||
href="http://groups.google.com/group/golang-nuts">golang-nuts</a>.</p>
|
||||
|
||||
<h3 id="golang-checkins"><a href="https://groups.google.com/group/golang-checkins">Checkins Mailing List</a></h3>
|
||||
<h3 id="golang-checkins"><a href="http://groups.google.com/group/golang-checkins">Checkins Mailing List</a></h3>
|
||||
<p>A mailing list that receives a message summarizing each checkin to the Go repository.</p>
|
||||
|
||||
<h3 id="build_status"><a href="//build.golang.org/">Build Status</a></h3>
|
||||
<h3 id="build_status"><a href="http://build.golang.org/">Build Status</a></h3>
|
||||
<p>View the status of Go builds across the supported operating
|
||||
systems and architectures.</p>
|
||||
|
||||
|
||||
<h2 id="howto">How you can help</h2>
|
||||
|
||||
<h3><a href="//golang.org/issue">Reporting issues</a></h3>
|
||||
<h3><a href="http://code.google.com/p/go/issues">Reporting issues</a></h3>
|
||||
|
||||
<p>
|
||||
If you spot bugs, mistakes, or inconsistencies in the Go project's code or
|
||||
documentation, please let us know by
|
||||
<a href="//golang.org/issue/new">filing a ticket</a>
|
||||
on our <a href="//golang.org/issue">issue tracker</a>.
|
||||
<a href="http://code.google.com/p/go/issues/entry">filing a ticket</a>
|
||||
on our <a href="http://code.google.com/p/go/issues">issue tracker</a>.
|
||||
(Of course, you should check it's not an existing issue before creating
|
||||
a new one.)
|
||||
</p>
|
||||
@@ -92,18 +65,6 @@ a new one.)
|
||||
We pride ourselves on being meticulous; no issue is too small.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Security-related issues should be reported to
|
||||
<a href="mailto:security@golang.org">security@golang.org</a>.<br>
|
||||
See the <a href="/security">security policy</a> for more details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Community-related issues should be reported to
|
||||
<a href="mailto:conduct@golang.org">conduct@golang.org</a>.<br>
|
||||
See the <a href="/conduct">Code of Conduct</a> for more details.
|
||||
</p>
|
||||
|
||||
<h3><a href="/doc/contribute.html">Contributing code</a></h3>
|
||||
|
||||
<p>
|
||||
@@ -114,8 +75,34 @@ To get started, read these <a href="/doc/contribute.html">contribution
|
||||
guidelines</a> for information on design, testing, and our code review process.
|
||||
</p>
|
||||
<p>
|
||||
Check <a href="//golang.org/issue">the tracker</a> for
|
||||
Check <a href="http://code.google.com/p/go/issues">the tracker</a> for
|
||||
open issues that interest you. Those labeled
|
||||
<a href="https://github.com/golang/go/issues?q=is%3Aopen+is%3Aissue+label%3Ahelpwanted">helpwanted</a>
|
||||
<a href="http://code.google.com/p/go/issues/list?q=status=HelpWanted">HelpWanted</a>
|
||||
are particularly in need of outside help.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="community">The Go Community</h2>
|
||||
|
||||
<h3 id="mailinglist"><a href="http://groups.google.com/group/golang-nuts">Go Nuts Mailing List</a></h3>
|
||||
<p>The <a href="http://groups.google.com/group/golang-nuts">golang-nuts</a>
|
||||
mailing list is for general Go discussion.</p>
|
||||
|
||||
<h3 id="projects"><a href="http://code.google.com/p/go-wiki/wiki/Projects">Go Wiki Projects Page</a></h3>
|
||||
<p>A list of external Go projects including programs and libraries.</p>
|
||||
|
||||
<h3 id="irc"><a href="irc:irc.freenode.net/go-nuts">Go IRC Channel</a></h3>
|
||||
<p><b>#go-nuts</b> on <b>irc.freenode.net</b> is the official Go IRC channel.</p>
|
||||
|
||||
<h3 id="pluscom"><a href="https://plus.google.com/communities/114112804251407510571">The Go+ community</a></h3>
|
||||
<p>The Google+ community for Go enthusiasts.</p>
|
||||
|
||||
<h3 id="plus"><a href="https://plus.google.com/101406623878176903605/posts">The Go Programming Language at Google+</a></h3>
|
||||
<p>The Go project's Google+ page.</p>
|
||||
|
||||
<h3 id="twitter"><a href="http://twitter.com/go_nuts">@go_nuts at Twitter</a></h3>
|
||||
<p>The Go project's official Twitter account.</p>
|
||||
|
||||
<h3 id="blog"><a href="http://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>
|
||||
|
||||
1243
doc/contribute.html
@@ -4,29 +4,11 @@
|
||||
}-->
|
||||
|
||||
<p><i>
|
||||
This applies to the standard toolchain (the <code>gc</code> Go
|
||||
compiler and tools). Gccgo has native gdb support.
|
||||
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, 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.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In time, a more Go-centric debugging architecture may be required.
|
||||
</p>
|
||||
|
||||
<h2 id="Introduction">Introduction</h2>
|
||||
|
||||
<p>
|
||||
@@ -37,8 +19,8 @@ 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 build -ldflags "-w" prog.go</code>).
|
||||
Pass the <code>'-s'</code> flag to the linker to omit the debug information
|
||||
(for example, <code>go build -ldflags "-s" prog.go</code>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -50,14 +32,6 @@ when debugging, pass the flags <code>-gcflags "-N -l"</code> to the
|
||||
debugged.
|
||||
</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).
|
||||
</p>
|
||||
|
||||
<h3 id="Common_Operations">Common Operations</h3>
|
||||
|
||||
<ul>
|
||||
@@ -129,17 +103,17 @@ For example:
|
||||
|
||||
<p>
|
||||
If you'd like to see how this works, or want to extend it, take a look at <a
|
||||
href="/src/runtime/runtime-gdb.py">src/runtime/runtime-gdb.py</a> in
|
||||
href="/src/pkg/runtime/runtime-gdb.py">src/pkg/runtime/runtime-gdb.py</a> in
|
||||
the Go source distribution. It depends on some special magic types
|
||||
(<code>hash<T,U></code>) and variables (<code>runtime.m</code> and
|
||||
<code>runtime.g</code>) that the linker
|
||||
(<a href="/src/cmd/link/internal/ld/dwarf.go">src/cmd/link/internal/ld/dwarf.go</a>) ensures are described in
|
||||
(<a href="/src/cmd/ld/dwarf.c">src/cmd/ld/dwarf.c</a>) ensures are described in
|
||||
the DWARF code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you're interested in what the debugging information looks like, run
|
||||
'<code>objdump -W 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>
|
||||
|
||||
@@ -162,7 +136,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 test -c</code>.
|
||||
change to <code>$GOROOT/src/pkg/regexp</code> and run <code>go test -c</code>.
|
||||
This should produce an executable file named <code>regexp.test</code>.
|
||||
</p>
|
||||
|
||||
@@ -181,7 +155,7 @@ License GPLv 3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.htm
|
||||
Type "show copying" and "show warranty" for licensing/warranty details.
|
||||
This GDB was configured as "x86_64-linux".
|
||||
|
||||
Reading symbols from /home/user/go/src/regexp/regexp.test...
|
||||
Reading symbols from /home/user/go/src/pkg/regexp/regexp.test...
|
||||
done.
|
||||
Loading Go Runtime support.
|
||||
(gdb)
|
||||
@@ -189,7 +163,7 @@ Loading Go Runtime support.
|
||||
|
||||
<p>
|
||||
The message <code>"Loading Go Runtime support"</code> means that GDB loaded the
|
||||
extension from <code>$GOROOT/src/runtime/runtime-gdb.py</code>.
|
||||
extension from <code>$GOROOT/src/pkg/runtime/runtime-gdb.py</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -208,7 +182,7 @@ it by hand by telling gdb (assuming you have the go sources in
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
(gdb) <b>source ~/go/src/runtime/runtime-gdb.py</b>
|
||||
(gdb) <b>source ~/go/src/pkg/runtime/runtime-gdb.py</b>
|
||||
Loading Go Runtime support.
|
||||
</pre>
|
||||
|
||||
@@ -268,7 +242,7 @@ Set a breakpoint at the <code>TestFind</code> function:
|
||||
|
||||
<pre>
|
||||
(gdb) <b>b 'regexp.TestFind'</b>
|
||||
Breakpoint 1 at 0x424908: file /home/user/go/src/regexp/find_test.go, line 148.
|
||||
Breakpoint 1 at 0x424908: file /home/user/go/src/pkg/regexp/find_test.go, line 148.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -277,9 +251,9 @@ Run the program:
|
||||
|
||||
<pre>
|
||||
(gdb) <b>run</b>
|
||||
Starting program: /home/user/go/src/regexp/regexp.test
|
||||
Starting program: /home/user/go/src/pkg/regexp/regexp.test
|
||||
|
||||
Breakpoint 1, regexp.TestFind (t=0xf8404a89c0) at /home/user/go/src/regexp/find_test.go:148
|
||||
Breakpoint 1, regexp.TestFind (t=0xf8404a89c0) at /home/user/go/src/pkg/regexp/find_test.go:148
|
||||
148 func TestFind(t *testing.T) {
|
||||
</pre>
|
||||
|
||||
@@ -306,9 +280,9 @@ Look at the stack trace for where we’ve paused the program:
|
||||
|
||||
<pre>
|
||||
(gdb) <b>bt</b> <i># backtrace</i>
|
||||
#0 regexp.TestFind (t=0xf8404a89c0) at /home/user/go/src/regexp/find_test.go:148
|
||||
#1 0x000000000042f60b in testing.tRunner (t=0xf8404a89c0, test=0x573720) at /home/user/go/src/testing/testing.go:156
|
||||
#2 0x000000000040df64 in runtime.initdone () at /home/user/go/src/runtime/proc.c:242
|
||||
#0 regexp.TestFind (t=0xf8404a89c0) at /home/user/go/src/pkg/regexp/find_test.go:148
|
||||
#1 0x000000000042f60b in testing.tRunner (t=0xf8404a89c0, test=0x573720) at /home/user/go/src/pkg/testing/testing.go:156
|
||||
#2 0x000000000040df64 in runtime.initdone () at /home/user/go/src/pkg/runtime/proc.c:242
|
||||
#3 0x000000f8404a89c0 in ?? ()
|
||||
#4 0x0000000000573720 in ?? ()
|
||||
#5 0x0000000000000000 in ?? ()
|
||||
@@ -320,18 +294,18 @@ The other goroutine, number 1, is stuck in <code>runtime.gosched</code>, blocked
|
||||
|
||||
<pre>
|
||||
(gdb) <b>goroutine 1 bt</b>
|
||||
#0 0x000000000040facb in runtime.gosched () at /home/user/go/src/runtime/proc.c:873
|
||||
#0 0x000000000040facb in runtime.gosched () at /home/user/go/src/pkg/runtime/proc.c:873
|
||||
#1 0x00000000004031c9 in runtime.chanrecv (c=void, ep=void, selected=void, received=void)
|
||||
at /home/user/go/src/runtime/chan.c:342
|
||||
#2 0x0000000000403299 in runtime.chanrecv1 (t=void, c=void) at/home/user/go/src/runtime/chan.c:423
|
||||
at /home/user/go/src/pkg/runtime/chan.c:342
|
||||
#2 0x0000000000403299 in runtime.chanrecv1 (t=void, c=void) at/home/user/go/src/pkg/runtime/chan.c:423
|
||||
#3 0x000000000043075b in testing.RunTests (matchString={void (struct string, struct string, bool *, error *)}
|
||||
0x7ffff7f9ef60, tests= []testing.InternalTest = {...}) at /home/user/go/src/testing/testing.go:201
|
||||
0x7ffff7f9ef60, tests= []testing.InternalTest = {...}) at /home/user/go/src/pkg/testing/testing.go:201
|
||||
#4 0x00000000004302b1 in testing.Main (matchString={void (struct string, struct string, bool *, error *)}
|
||||
0x7ffff7f9ef80, tests= []testing.InternalTest = {...}, benchmarks= []testing.InternalBenchmark = {...})
|
||||
at /home/user/go/src/testing/testing.go:168
|
||||
#5 0x0000000000400dc1 in main.main () at /home/user/go/src/regexp/_testmain.go:98
|
||||
#6 0x00000000004022e7 in runtime.mainstart () at /home/user/go/src/runtime/amd64/asm.s:78
|
||||
#7 0x000000000040ea6f in runtime.initdone () at /home/user/go/src/runtime/proc.c:243
|
||||
at /home/user/go/src/pkg/testing/testing.go:168
|
||||
#5 0x0000000000400dc1 in main.main () at /home/user/go/src/pkg/regexp/_testmain.go:98
|
||||
#6 0x00000000004022e7 in runtime.mainstart () at /home/user/go/src/pkg/runtime/amd64/asm.s:78
|
||||
#7 0x000000000040ea6f in runtime.initdone () at /home/user/go/src/pkg/runtime/proc.c:243
|
||||
#8 0x0000000000000000 in ?? ()
|
||||
</pre>
|
||||
|
||||
@@ -342,7 +316,7 @@ The stack frame shows we’re currently executing the <code>regexp.TestFind</cod
|
||||
<pre>
|
||||
(gdb) <b>info frame</b>
|
||||
Stack level 0, frame at 0x7ffff7f9ff88:
|
||||
rip = 0x425530 in regexp.TestFind (/home/user/go/src/regexp/find_test.go:148);
|
||||
rip = 0x425530 in regexp.TestFind (/home/user/go/src/pkg/regexp/find_test.go:148);
|
||||
saved rip 0x430233
|
||||
called by frame at 0x7ffff7f9ffa8
|
||||
source language minimal.
|
||||
@@ -386,9 +360,7 @@ $3 = struct hchan<*testing.T>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
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 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>
|
||||
@@ -421,7 +393,7 @@ We can step into the <code>String</code>function call with <code>"s"</code>:
|
||||
|
||||
<pre>
|
||||
(gdb) <b>s</b>
|
||||
regexp.(*Regexp).String (re=0xf84068d070, noname=void) at /home/user/go/src/regexp/regexp.go:97
|
||||
regexp.(*Regexp).String (re=0xf84068d070, noname=void) at /home/user/go/src/pkg/regexp/regexp.go:97
|
||||
97 func (re *Regexp) String() string {
|
||||
</pre>
|
||||
|
||||
@@ -432,12 +404,12 @@ Get a stack trace to see where we are:
|
||||
<pre>
|
||||
(gdb) <b>bt</b>
|
||||
#0 regexp.(*Regexp).String (re=0xf84068d070, noname=void)
|
||||
at /home/user/go/src/regexp/regexp.go:97
|
||||
at /home/user/go/src/pkg/regexp/regexp.go:97
|
||||
#1 0x0000000000425615 in regexp.TestFind (t=0xf840688b60)
|
||||
at /home/user/go/src/regexp/find_test.go:151
|
||||
at /home/user/go/src/pkg/regexp/find_test.go:151
|
||||
#2 0x0000000000430233 in testing.tRunner (t=0xf840688b60, test=0x5747b8)
|
||||
at /home/user/go/src/testing/testing.go:156
|
||||
#3 0x000000000040ea6f in runtime.initdone () at /home/user/go/src/runtime/proc.c:243
|
||||
at /home/user/go/src/pkg/testing/testing.go:156
|
||||
#3 0x000000000040ea6f in runtime.initdone () at /home/user/go/src/pkg/runtime/proc.c:243
|
||||
....
|
||||
</pre>
|
||||
|
||||
|
||||
@@ -1,455 +0,0 @@
|
||||
<!--{
|
||||
"Title": "Pre-Go 1 Release History"
|
||||
}-->
|
||||
|
||||
<p>
|
||||
This page summarizes the changes between stable releases of Go prior to Go 1.
|
||||
See the <a href="release.html">Release History</a> page for notes on recent releases.
|
||||
</p>
|
||||
|
||||
<h2 id="r60">r60 (released 2011/09/07)</h2>
|
||||
|
||||
<p>
|
||||
The r60 release corresponds to
|
||||
<code><a href="weekly.html#2011-08-17">weekly.2011-08-17</a></code>.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-08-17">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="//code.google.com/p/go/source/list?r=release-branch.r60">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
An "else" block is now required to have braces except if the body of the "else"
|
||||
is another "if". Since gofmt always puts those braces in anyway,
|
||||
gofmt-formatted programs will not be affected.
|
||||
To fix other programs, run gofmt.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http/">Package http</a>'s URL parsing and query escaping code
|
||||
(such as <code>ParseURL</code> and <code>URLEscape</code>) has been moved to
|
||||
the new <a href="/pkg/url/">url package</a>, with several simplifications to
|
||||
the names. Client code can be updated automatically with gofix.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/image/">Package image</a> has had significant changes made to the
|
||||
<code>Pix</code> field of struct types such as
|
||||
<a href="/pkg/image/#RGBA">image.RGBA</a> and
|
||||
<a href="/pkg/image/#NRGBA">image.NRGBA</a>.
|
||||
The <a href="/pkg/image/#Image">image.Image</a> interface type has not changed,
|
||||
though, and you should not need to change your code if you don't explicitly
|
||||
refer to <code>Pix</code> fields. For example, if you decode a number of images
|
||||
using the <a href="/pkg/image/jpeg/">image/jpeg</a> package, compose them using
|
||||
<a href="/pkg/image/draw/">image/draw</a>, and then encode the result using
|
||||
<a href="/pkg/img/png">image/png</a>, then your code should still work as
|
||||
before.
|
||||
If your code <i>does</i> refer to <code>Pix</code> fields see the
|
||||
<a href="/doc/devel/weekly.html#2011-07-19">weekly.2011-07-19</a>
|
||||
snapshot notes for how to update your code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/template/">Package template</a> has been replaced with a new
|
||||
templating package (formerly <code>exp/template</code>). The original template
|
||||
package is still available as <a href="/pkg/old/template/">old/template</a>.
|
||||
The <code>old/template</code> package is deprecated and will be removed.
|
||||
The Go tree has been updated to use the new template package. We encourage
|
||||
users of the old template package to switch to the new one. Code that uses
|
||||
<code>template</code> or <code>exp/template</code> will need to change its
|
||||
import lines to <code>"old/template"</code> or <code>"template"</code>,
|
||||
respectively.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.cmd">Tools</h3>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/goinstall/">Goinstall</a> now uses a new tag selection scheme.
|
||||
When downloading or updating, goinstall looks for a tag or branch with the
|
||||
<code>"go."</code> prefix that corresponds to the local Go version. For Go
|
||||
<code>release.r58</code> it looks for <code>go.r58</code>. For
|
||||
<code>weekly.2011-06-03</code> it looks for <code>go.weekly.2011-06-03</code>.
|
||||
If the specific <code>go.X</code> tag or branch is not found, it chooses the
|
||||
closest earlier version. If an appropriate tag or branch is found, goinstall
|
||||
uses that version of the code. Otherwise it uses the default version selected
|
||||
by the version control system. Library authors are encouraged to use the
|
||||
appropriate tag or branch names in their repositories to make their libraries
|
||||
more accessible.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
r60.1 includes a
|
||||
<a href="//golang.org/change/1824581bf62d">linker
|
||||
fix</a>, a pair of
|
||||
<a href="//golang.org/change/9ef4429c2c64">goplay</a>
|
||||
<a href="//golang.org/change/d42ed8c3098e">fixes</a>,
|
||||
and a <code>json</code> package
|
||||
<a href="//golang.org/change/d5e97874fe84">fix</a> and
|
||||
a new
|
||||
<a href="//golang.org/change/4f0e6269213f">struct tag
|
||||
option</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
r60.2
|
||||
<a href="//golang.org/change/ff19536042ac">fixes</a>
|
||||
a memory leak involving maps.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
r60.3 fixes a
|
||||
<a href="//golang.org/change/01fa62f5e4e5">reflect bug</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="r59">r59 (released 2011/08/01)</h2>
|
||||
|
||||
<p>
|
||||
The r59 release corresponds to
|
||||
<code><a href="weekly.html#2011-07-07">weekly.2011-07-07</a></code>.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-07-07">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="//code.google.com/p/go/source/list?r=release-branch.r59">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r59.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
This release includes a language change that restricts the use of
|
||||
<code>goto</code>. In essence, a <code>goto</code> statement outside a block
|
||||
cannot jump to a label inside that block. Your code may require changes if it
|
||||
uses <code>goto</code>.
|
||||
See <a href="//golang.org/change/dc6d3cf9279d">this
|
||||
changeset</a> for how the new rule affected the Go tree.
|
||||
</p>
|
||||
|
||||
<h3 id="r59.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
As usual, <a href="/cmd/gofix/">gofix</a> will handle the bulk of the rewrites
|
||||
necessary for these changes to package APIs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http">Package http</a> has a new
|
||||
<a href="/pkg/http/#FileSystem">FileSystem</a> interface that provides access
|
||||
to files. The <a href="/pkg/http/#FileServer">FileServer</a> helper now takes a
|
||||
<code>FileSystem</code> argument instead of an explicit file system root. By
|
||||
implementing your own <code>FileSystem</code> you can use the
|
||||
<code>FileServer</code> to serve arbitrary data.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/os/">Package os</a>'s <code>ErrorString</code> type has been
|
||||
hidden. Most uses of <code>os.ErrorString</code> can be replaced with
|
||||
<a href="/pkg/os/#NewError">os.NewError</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/reflect/">Package reflect</a> supports a new struct tag scheme
|
||||
that enables sharing of struct tags between multiple packages.
|
||||
In this scheme, the tags must be of the form:
|
||||
</p>
|
||||
<pre>
|
||||
`key:"value" key2:"value2"`
|
||||
</pre>
|
||||
<p>
|
||||
The <a href="/pkg/reflect/#StructField">StructField</a> type's Tag field now
|
||||
has type <a href="/pkg/reflect/#StructTag">StructTag</a>, which has a
|
||||
<code>Get</code> method. Clients of <a href="/pkg/json">json</a> and
|
||||
<a href="/pkg/xml">xml</a> will need to be updated. Code that says
|
||||
</p>
|
||||
<pre>
|
||||
type T struct {
|
||||
X int "name"
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
should become
|
||||
</p>
|
||||
<pre>
|
||||
type T struct {
|
||||
X int `json:"name"` // or `xml:"name"`
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
Use <a href="/cmd/govet/">govet</a> to identify struct tags that need to be
|
||||
changed to use the new syntax.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/sort/">Package sort</a>'s <code>IntArray</code> type has been
|
||||
renamed to <a href="/pkg/sort/#IntSlice">IntSlice</a>, and similarly for
|
||||
<a href="/pkg/sort/#Float64Slice">Float64Slice</a> and
|
||||
<a href="/pkg/sort/#StringSlice">StringSlice</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/strings/">Package strings</a>'s <code>Split</code> function has
|
||||
itself been split into <a href="/pkg/strings/#Split">Split</a> and
|
||||
<a href="/pkg/strings/#SplitN">SplitN</a>.
|
||||
<code>SplitN</code> is the same as the old <code>Split</code>.
|
||||
The new <code>Split</code> is equivalent to <code>SplitN</code> with a final
|
||||
argument of -1.
|
||||
</p>
|
||||
|
||||
<a href="/pkg/image/draw/">Package image/draw</a>'s
|
||||
<a href="/pkg/image/draw/#Draw">Draw</a> function now takes an additional
|
||||
argument, a compositing operator.
|
||||
If in doubt, use <a href="/pkg/image/draw/#Op">draw.Over</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r59.cmd">Tools</h3>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/goinstall/">Goinstall</a> now installs packages and commands from
|
||||
arbitrary remote repositories (not just Google Code, Github, and so on).
|
||||
See the <a href="/cmd/goinstall/">goinstall documentation</a> for details.
|
||||
</p>
|
||||
|
||||
<h2 id="r58">r58 (released 2011/06/29)</h2>
|
||||
|
||||
<p>
|
||||
The r58 release corresponds to
|
||||
<code><a href="weekly.html#2011-06-09">weekly.2011-06-09</a></code>
|
||||
with additional bug fixes.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-06-09">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="//code.google.com/p/go/source/list?r=release-branch.r58">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r58.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
This release fixes a <a href="//golang.org/change/b720749486e1">use of uninitialized memory in programs that misuse <code>goto</code></a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r58.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
As usual, <a href="/cmd/gofix/">gofix</a> will handle the bulk of the rewrites
|
||||
necessary for these changes to package APIs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http/">Package http</a> drops the <code>finalURL</code> return
|
||||
value from the <a href="/pkg/http/#Client.Get">Client.Get</a> method. The value
|
||||
is now available via the new <code>Request</code> field on <a
|
||||
href="/pkg/http/#Response">http.Response</a>.
|
||||
Most instances of the type map[string][]string in have been
|
||||
replaced with the new <a href="/pkg/http/#Values">Values</a> type.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/exec/">Package exec</a> has been redesigned with a more
|
||||
convenient and succinct API.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/strconv/">Package strconv</a>'s <a href="/pkg/strconv/#Quote">Quote</a>
|
||||
function now escapes only those Unicode code points not classified as printable
|
||||
by <a href="/pkg/unicode/#IsPrint">unicode.IsPrint</a>.
|
||||
Previously Quote would escape all non-ASCII characters.
|
||||
This also affects the <a href="/pkg/fmt/">fmt</a> package's <code>"%q"</code>
|
||||
formatting directive. The previous quoting behavior is still available via
|
||||
strconv's new <a href="/pkg/strconv/#QuoteToASCII">QuoteToASCII</a> function.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/os/signal/">Package os/signal</a>'s
|
||||
<a href="/pkg/os/#Signal">Signal</a> and
|
||||
<a href="/pkg/os/#UnixSignal">UnixSignal</a> types have been moved to the
|
||||
<a href="/pkg/os/">os</a> package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/image/draw/">Package image/draw</a> is the new name for
|
||||
<code>exp/draw</code>. The GUI-related code from <code>exp/draw</code> is now
|
||||
located in the <a href="/pkg/exp/gui/">exp/gui</a> package.
|
||||
</p>
|
||||
|
||||
<h3 id="r58.cmd">Tools</h3>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/goinstall/">Goinstall</a> now observes the GOPATH environment
|
||||
variable to build and install your own code and external libraries outside of
|
||||
the Go tree (and avoid writing Makefiles).
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="r58.minor">Minor revisions</h3>
|
||||
|
||||
<p>r58.1 adds
|
||||
<a href="//golang.org/change/293c25943586">build</a> and
|
||||
<a href="//golang.org/change/bf17e96b6582">runtime</a>
|
||||
changes to make Go run on OS X 10.7 Lion.
|
||||
</p>
|
||||
|
||||
<h2 id="r57">r57 (released 2011/05/03)</h2>
|
||||
|
||||
<p>
|
||||
The r57 release corresponds to
|
||||
<code><a href="weekly.html#2011-04-27">weekly.2011-04-27</a></code>
|
||||
with additional bug fixes.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-04-27">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="//code.google.com/p/go/source/list?r=release-branch.r57">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<p>The new <a href="/cmd/gofix">gofix</a> tool finds Go programs that use old APIs and rewrites them to use
|
||||
newer ones. After you update to a new Go release, gofix helps make the
|
||||
necessary changes to your programs. Gofix will handle the http, os, and syscall
|
||||
package changes described below, and we will update the program to keep up with
|
||||
future changes to the libraries.
|
||||
Gofix can’t
|
||||
handle all situations perfectly, so read and test the changes it makes before
|
||||
committing them.
|
||||
See <a href="//blog.golang.org/2011/04/introducing-gofix.html">the gofix blog post</a> for more
|
||||
information.</p>
|
||||
|
||||
<h3 id="r57.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
<a href="/doc/go_spec.html#Receive_operator">Multiple assignment syntax</a> replaces the <code>closed</code> function.
|
||||
The syntax for channel
|
||||
receives allows an optional second assigned value, a boolean value
|
||||
indicating whether the channel is closed. This code:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
v := <-ch
|
||||
if closed(ch) {
|
||||
// channel is closed
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>should now be written as:</p>
|
||||
|
||||
<pre>
|
||||
v, ok := <-ch
|
||||
if !ok {
|
||||
// channel is closed
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p><a href="/doc/go_spec.html#Label_scopes">Unused labels are now illegal</a>, just as unused local variables are.</p>
|
||||
|
||||
<h3 id="r57.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/gob/">Package gob</a> will now encode and decode values of types that implement the
|
||||
<a href="/pkg/gob/#GobEncoder">GobEncoder</a> and
|
||||
<a href="/pkg/gob/#GobDecoder">GobDecoder</a> interfaces. This allows types with unexported
|
||||
fields to transmit self-consistent descriptions; examples include
|
||||
<a href="/pkg/big/#Int.GobDecode">big.Int</a> and <a href="/pkg/big/#Rat.GobDecode">big.Rat</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http/">Package http</a> has been redesigned.
|
||||
For clients, there are new
|
||||
<a href="/pkg/http/#Client">Client</a> and <a href="/pkg/http/#Transport">Transport</a>
|
||||
abstractions that give more control over HTTP details such as headers sent
|
||||
and redirections followed. These abstractions make it easy to implement
|
||||
custom clients that add functionality such as <a href="//code.google.com/p/goauth2/source/browse/oauth/oauth.go">OAuth2</a>.
|
||||
For servers, <a href="/pkg/http/#ResponseWriter">ResponseWriter</a>
|
||||
has dropped its non-essential methods.
|
||||
The Hijack and Flush methods are no longer required;
|
||||
code can test for them by checking whether a specific value implements
|
||||
<a href="/pkg/http/#Hijacker">Hijacker</a> or <a href="/pkg/http/#Flusher">Flusher</a>.
|
||||
The RemoteAddr and UsingTLS methods are replaced by <a href="/pkg/http/#Request">Request</a>'s
|
||||
RemoteAddr and TLS fields.
|
||||
The SetHeader method is replaced by a Header method;
|
||||
its result, of type <a href="/pkg/http/#Header">Header</a>,
|
||||
implements Set and other methods.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/net/">Package net</a>
|
||||
drops the <code>laddr</code> argument from <a href="/pkg/net/#Conn.Dial">Dial</a>
|
||||
and drops the <code>cname</code> return value
|
||||
from <a href="/pkg/net/#LookupHost">LookupHost</a>.
|
||||
The implementation now uses <a href="/cmd/cgo/">cgo</a> to implement
|
||||
network name lookups using the C library getaddrinfo(3)
|
||||
function when possible. This ensures that Go and C programs
|
||||
resolve names the same way and also avoids the OS X
|
||||
application-level firewall.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/os/">Package os</a>
|
||||
introduces simplified <a href="/pkg/os/#File.Open">Open</a>
|
||||
and <a href="/pkg/os/#File.Create">Create</a> functions.
|
||||
The original Open is now available as <a href="/pkg/os/#File.OpenFile">OpenFile</a>.
|
||||
The final three arguments to <a href="/pkg/os/#Process.StartProcess">StartProcess</a>
|
||||
have been replaced by a pointer to a <a href="/pkg/os/#ProcAttr">ProcAttr</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/reflect/">Package reflect</a> has been redesigned.
|
||||
<a href="/pkg/reflect/#Type">Type</a> is now an interface that implements
|
||||
all the possible type methods.
|
||||
Instead of a type switch on a Type <code>t</code>, switch on <code>t.Kind()</code>.
|
||||
<a href="/pkg/reflect/#Value">Value</a> is now a struct value that
|
||||
implements all the possible value methods.
|
||||
Instead of a type switch on a Value <code>v</code>, switch on <code>v.Kind()</code>.
|
||||
Typeof and NewValue are now called <a href="/pkg/reflect/#Type.TypeOf">TypeOf</a> and <a href="/pkg/reflect/#Value.ValueOf">ValueOf</a>
|
||||
To create a writable Value, use <code>New(t).Elem()</code> instead of <code>Zero(t)</code>.
|
||||
See <a href="//golang.org/change/843855f3c026">the change description</a>
|
||||
for the full details.
|
||||
The new API allows a more efficient implementation of Value
|
||||
that avoids many of the allocations required by the previous API.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Remember that gofix will handle the bulk of the rewrites
|
||||
necessary for these changes to package APIs.
|
||||
</p>
|
||||
|
||||
<h3 id="r57.cmd">Tools</h3>
|
||||
|
||||
<p><a href="/cmd/gofix/">Gofix</a>, a new command, is described above.</p>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/gotest/">Gotest</a> is now a Go program instead of a shell script.
|
||||
The new <code>-test.short</code> flag in combination with package testing's Short function
|
||||
allows you to write tests that can be run in normal or “short” mode;
|
||||
all.bash runs tests in short mode to reduce installation time.
|
||||
The Makefiles know about the flag: use <code>make testshort</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The run-time support now implements CPU and memory profiling.
|
||||
Gotest's new
|
||||
<a href="/cmd/gotest/"><code>-test.cpuprofile</code> and
|
||||
<code>-test.memprofile</code> flags</a> make it easy to
|
||||
profile tests.
|
||||
To add profiling to your web server, see the <a href="/pkg/http/pprof/">http/pprof</a>
|
||||
documentation.
|
||||
For other uses, see the <a href="/pkg/runtime/pprof/">runtime/pprof</a> documentation.
|
||||
</p>
|
||||
|
||||
<h3 id="r57.minor">Minor revisions</h3>
|
||||
|
||||
<p>r57.1 fixes a <a href="//golang.org/change/ff2bc62726e7145eb2ecc1e0f076998e4a8f86f0">nil pointer dereference in http.FormFile</a>.</p>
|
||||
<p>r57.2 fixes a <a href="//golang.org/change/063b0ff67d8277df03c956208abc068076818dae">use of uninitialized memory in programs that misuse <code>goto</code></a>.</p>
|
||||
|
||||
<h2 id="r56">r56 (released 2011/03/16)</h2>
|
||||
|
||||
<p>
|
||||
The r56 release was the first stable release and corresponds to
|
||||
<code><a href="weekly.html#2011-03-07">weekly.2011-03-07.1</a></code>.
|
||||
The numbering starts at 56 because before this release,
|
||||
what we now consider weekly snapshots were called releases.
|
||||
</p>
|
||||
@@ -3,279 +3,29 @@
|
||||
}-->
|
||||
|
||||
<p>This page summarizes the changes between official stable releases of Go.
|
||||
The <a href="//golang.org/change">change log</a> has the full details.</p>
|
||||
The <a href="http://code.google.com/p/go/source/list">Mercurial change log</a>
|
||||
has the full details.</p>
|
||||
|
||||
<p>To update to a specific release, use:</p>
|
||||
|
||||
<pre>
|
||||
git pull
|
||||
git checkout <i>release-branch</i>
|
||||
hg pull
|
||||
hg update <i>tag</i>
|
||||
</pre>
|
||||
|
||||
<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.8.1, Go 1.8.2, and so on).
|
||||
</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>
|
||||
|
||||
<h2 id="go1.7">go1.7 (released 2016/08/15)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.7 is a major release of Go.
|
||||
Read the <a href="/doc/go1.7">Go 1.7 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.7.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.7.1 (released 2016/09/07) includes fixes to the compiler, runtime,
|
||||
documentation, and the <code>compress/flate</code>, <code>hash/crc32</code>,
|
||||
<code>io</code>, <code>net</code>, <code>net/http</code>,
|
||||
<code>path/filepath</code>, <code>reflect</code>, and <code>syscall</code>
|
||||
packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.1">Go
|
||||
1.7.1 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.7.2 should not be used. It was tagged but not fully released.
|
||||
The release was deferred due to a last minute bug report.
|
||||
Use go1.7.3 instead, and refer to the summary of changes below.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.7.3 (released 2016/10/19) includes fixes to the compiler, runtime,
|
||||
and the <code>crypto/cipher</code>, <code>crypto/tls</code>,
|
||||
<code>net/http</code>, and <code>strings</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.3">Go
|
||||
1.7.3 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.7.4 (released 2016/12/01) includes two security fixes.
|
||||
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>
|
||||
Go 1.6 is a major release of Go.
|
||||
Read the <a href="/doc/go1.6">Go 1.6 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.6.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.6.1 (released 2016/04/12) includes two security fixes.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.1">Go
|
||||
1.6.1 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.6.2 (released 2016/04/20) includes fixes to the compiler, runtime, tools,
|
||||
documentation, and the <code>mime/multipart</code>, <code>net/http</code>, and
|
||||
<code>sort</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.2">Go
|
||||
1.6.2 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.6.3 (released 2016/07/17) includes security fixes to the
|
||||
<code>net/http/cgi</code> package and <code>net/http</code> package when used in
|
||||
a CGI environment.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.3">Go
|
||||
1.6.3 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.6.4 (released 2016/12/01) includes two security fixes.
|
||||
It contains the same fixes as Go 1.7.4 and was released at the same time.
|
||||
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>
|
||||
|
||||
<h2 id="go1.5">go1.5 (released 2015/08/19)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.5 is a major release of Go.
|
||||
Read the <a href="/doc/go1.5">Go 1.5 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.5.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.5.1 (released 2015/09/08) includes bug fixes to the compiler, assembler, and
|
||||
the <code>fmt</code>, <code>net/textproto</code>, <code>net/http</code>, and
|
||||
<code>runtime</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.5.1">Go
|
||||
1.5.1 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.5.2 (released 2015/12/02) includes bug fixes to the compiler, linker, and
|
||||
the <code>mime/multipart</code>, <code>net</code>, and <code>runtime</code>
|
||||
packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.5.2">Go
|
||||
1.5.2 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.5.3 (released 2016/01/13) includes a security fix to the <code>math/big</code> package
|
||||
affecting the <code>crypto/tls</code> package.
|
||||
See the <a href="https://golang.org/s/go153announce">release announcement</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.5.4 (released 2016/04/12) includes two security fixes.
|
||||
It contains the same fixes as Go 1.6.1 and was released at the same time.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.1">Go
|
||||
1.6.1 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.4">go1.4 (released 2014/12/10)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.4 is a major release of Go.
|
||||
Read the <a href="/doc/go1.4">Go 1.4 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.4.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.4.1 (released 2015/01/15) includes bug fixes to the linker and the <code>log</code>, <code>syscall</code>, and <code>runtime</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.1">Go 1.4.1 milestone on our issue tracker</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.4.2 (released 2015/02/17) includes bug fixes to the <code>go</code> command, the compiler and linker, and the <code>runtime</code>, <code>syscall</code>, <code>reflect</code>, and <code>math/big</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.2">Go 1.4.2 milestone on our issue tracker</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.4.3 (released 2015/09/22) includes security fixes to the <code>net/http</code> package and bug fixes to the <code>runtime</code> package.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.3">Go 1.4.3 milestone on our issue tracker</a> for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.3">go1.3 (released 2014/06/18)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.3 is a major release of Go.
|
||||
Read the <a href="/doc/go1.3">Go 1.3 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.3.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.3.1 (released 2014/08/13) includes bug fixes to the compiler and the <code>runtime</code>, <code>net</code>, and <code>crypto/rsa</code> packages.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.3.1">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.3.2 (released 2014/09/25) includes bug fixes to cgo and the crypto/tls packages.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.3.2">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.3.3 (released 2014/09/30) includes further bug fixes to cgo, the runtime package, and the nacl port.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.3.3">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.2">go1.2 (released 2013/12/01)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.2 is a major release of Go.
|
||||
Read the <a href="/doc/go1.2">Go 1.2 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.2.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.2.1 (released 2014/03/02) includes bug fixes to the <code>runtime</code>, <code>net</code>, and <code>database/sql</code> packages.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.2.1">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.2.2 (released 2014/05/05) includes a
|
||||
<a href="https://github.com/golang/go/commits/go1.2.2">security fix</a>
|
||||
that affects the tour binary included in the binary distributions (thanks to Guillaume T).
|
||||
</p>
|
||||
|
||||
<h2 id="go1.1">go1.1 (released 2013/05/13)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.1 is a major release of Go.
|
||||
Read the <a href="/doc/go1.1">Go 1.1 Release Notes</a> for more information.
|
||||
Read the <a href="/doc/go1.1.html">Go 1.1 Release Notes</a> for
|
||||
more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.1.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.1.1 (released 2013/06/13) includes several compiler and runtime bug fixes.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.1.1">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.1.2 (released 2013/08/13) includes fixes to the <code>gc</code> compiler
|
||||
and <code>cgo</code>, and the <code>bufio</code>, <code>runtime</code>,
|
||||
<code>syscall</code>, and <code>time</code> packages.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.1.2">change history</a> for details.
|
||||
If you use package syscall's <code>Getrlimit</code> and <code>Setrlimit</code>
|
||||
functions under Linux on the ARM or 386 architectures, please note change
|
||||
<a href="//golang.org/cl/11803043">11803043</a>
|
||||
that fixes <a href="//golang.org/issue/5949">issue 5949</a>.
|
||||
See the <a href="https://code.google.com/p/go/source/list?name=release-branch.go1.1&r=43c4a41d24382a56a90e924800c681e435d9e399">change history</a> for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1">go1 (released 2012/03/28)</h2>
|
||||
@@ -301,17 +51,17 @@ The go1 release corresponds to
|
||||
|
||||
<p>
|
||||
go1.0.1 (released 2012/04/25) was issued to
|
||||
<a href="//golang.org/cl/6061043">fix</a> an
|
||||
<a href="//golang.org/issue/3545">escape analysis bug</a>
|
||||
that can lead to memory corruption.
|
||||
<a href="https://code.google.com/p/go/source/detail?r=a890477d3dfb">fix</a> an
|
||||
<a href="https://code.google.com/p/go/issues/detail?id=3545">escape analysis
|
||||
bug</a> that can lead to memory corruption.
|
||||
It also includes several minor code and documentation fixes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.0.2 (released 2012/06/13) was issued to fix two bugs in the implementation
|
||||
of maps using struct or array keys:
|
||||
<a href="//golang.org/issue/3695">issue 3695</a> and
|
||||
<a href="//golang.org/issue/3573">issue 3573</a>.
|
||||
<a href="http://code.google.com/p/go/issues/detail?id=3695">issue 3695</a> and
|
||||
<a href="http://code.google.com/p/go/issues/detail?id=3573">issue 3573</a>.
|
||||
It also includes many minor code and documentation fixes.
|
||||
</p>
|
||||
|
||||
@@ -320,13 +70,452 @@ go1.0.3 (released 2012/09/21) includes minor code and documentation fixes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
See the <a href="https://github.com/golang/go/commits/release-branch.go1">go1 release branch history</a> for the complete list of changes.
|
||||
See the <a href="http://code.google.com/p/go/source/list?name=release-branch.go1">go1 release branch history</a> for the complete list of changes.
|
||||
</p>
|
||||
|
||||
<h2 id="pre.go1">Older releases</h2>
|
||||
<h2 id="r60">r60 (released 2011/09/07)</h2>
|
||||
|
||||
<p>
|
||||
See the <a href="pre_go1.html">Pre-Go 1 Release History</a> page for notes
|
||||
on earlier releases.
|
||||
The r60 release corresponds to
|
||||
<code><a href="weekly.html#2011-08-17">weekly.2011-08-17</a></code>.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-08-17">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="http://code.google.com/p/go/source/list?r=release-branch.r60">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
An "else" block is now required to have braces except if the body of the "else"
|
||||
is another "if". Since gofmt always puts those braces in anyway,
|
||||
gofmt-formatted programs will not be affected.
|
||||
To fix other programs, run gofmt.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http/">Package http</a>'s URL parsing and query escaping code
|
||||
(such as <code>ParseURL</code> and <code>URLEscape</code>) has been moved to
|
||||
the new <a href="/pkg/url/">url package</a>, with several simplifications to
|
||||
the names. Client code can be updated automatically with gofix.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/image/">Package image</a> has had significant changes made to the
|
||||
<code>Pix</code> field of struct types such as
|
||||
<a href="/pkg/image/#RGBA">image.RGBA</a> and
|
||||
<a href="/pkg/image/#NRGBA">image.NRGBA</a>.
|
||||
The <a href="/pkg/image/#Image">image.Image</a> interface type has not changed,
|
||||
though, and you should not need to change your code if you don't explicitly
|
||||
refer to <code>Pix</code> fields. For example, if you decode a number of images
|
||||
using the <a href="/pkg/image/jpeg/">image/jpeg</a> package, compose them using
|
||||
<a href="/pkg/image/draw/">image/draw</a>, and then encode the result using
|
||||
<a href="/pkg/img/png">image/png</a>, then your code should still work as
|
||||
before.
|
||||
If your code <i>does</i> refer to <code>Pix</code> fields see the
|
||||
<a href="/doc/devel/weekly.html#2011-07-19">weekly.2011-07-19</a>
|
||||
snapshot notes for how to update your code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/template/">Package template</a> has been replaced with a new
|
||||
templating package (formerly <code>exp/template</code>). The original template
|
||||
package is still available as <a href="/pkg/old/template/">old/template</a>.
|
||||
The <code>old/template</code> package is deprecated and will be removed.
|
||||
The Go tree has been updated to use the new template package. We encourage
|
||||
users of the old template package to switch to the new one. Code that uses
|
||||
<code>template</code> or <code>exp/template</code> will need to change its
|
||||
import lines to <code>"old/template"</code> or <code>"template"</code>,
|
||||
respectively.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.cmd">Tools</h3>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/goinstall/">Goinstall</a> now uses a new tag selection scheme.
|
||||
When downloading or updating, goinstall looks for a tag or branch with the
|
||||
<code>"go."</code> prefix that corresponds to the local Go version. For Go
|
||||
<code>release.r58</code> it looks for <code>go.r58</code>. For
|
||||
<code>weekly.2011-06-03</code> it looks for <code>go.weekly.2011-06-03</code>.
|
||||
If the specific <code>go.X</code> tag or branch is not found, it chooses the
|
||||
closest earlier version. If an appropriate tag or branch is found, goinstall
|
||||
uses that version of the code. Otherwise it uses the default version selected
|
||||
by the version control system. Library authors are encouraged to use the
|
||||
appropriate tag or branch names in their repositories to make their libraries
|
||||
more accessible.
|
||||
</p>
|
||||
|
||||
<h3 id="r60.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
r60.1 includes a
|
||||
<a href="http://code.google.com/p/go/source/detail?r=1824581bf62d">linker
|
||||
fix</a>, a pair of
|
||||
<a href="http://code.google.com/p/go/source/detail?r=9ef4429c2c64">goplay</a>
|
||||
<a href="http://code.google.com/p/go/source/detail?r=d42ed8c3098e">fixes</a>,
|
||||
and a <code>json</code> package
|
||||
<a href="http://code.google.com/p/go/source/detail?r=d5e97874fe84">fix</a> and
|
||||
a new
|
||||
<a href="http://code.google.com/p/go/source/detail?r=4f0e6269213f">struct tag
|
||||
option</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
r60.2
|
||||
<a href="http://code.google.com/p/go/source/detail?r=ff19536042ac">fixes</a>
|
||||
a memory leak involving maps.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
r60.3 fixes a
|
||||
<a href="http://code.google.com/p/go/source/detail?r=01fa62f5e4e5">reflect bug</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="r59">r59 (released 2011/08/01)</h2>
|
||||
|
||||
<p>
|
||||
The r59 release corresponds to
|
||||
<code><a href="weekly.html#2011-07-07">weekly.2011-07-07</a></code>.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-07-07">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="http://code.google.com/p/go/source/list?r=release-branch.r59">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r59.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
This release includes a language change that restricts the use of
|
||||
<code>goto</code>. In essence, a <code>goto</code> statement outside a block
|
||||
cannot jump to a label inside that block. Your code may require changes if it
|
||||
uses <code>goto</code>.
|
||||
See <a href="http://code.google.com/p/go/source/detail?r=dc6d3cf9279d">this
|
||||
changeset</a> for how the new rule affected the Go tree.
|
||||
</p>
|
||||
|
||||
<h3 id="r59.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
As usual, <a href="/cmd/gofix/">gofix</a> will handle the bulk of the rewrites
|
||||
necessary for these changes to package APIs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http">Package http</a> has a new
|
||||
<a href="/pkg/http/#FileSystem">FileSystem</a> interface that provides access
|
||||
to files. The <a href="/pkg/http/#FileServer">FileServer</a> helper now takes a
|
||||
<code>FileSystem</code> argument instead of an explicit file system root. By
|
||||
implementing your own <code>FileSystem</code> you can use the
|
||||
<code>FileServer</code> to serve arbitrary data.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/os/">Package os</a>'s <code>ErrorString</code> type has been
|
||||
hidden. Most uses of <code>os.ErrorString</code> can be replaced with
|
||||
<a href="/pkg/os/#NewError">os.NewError</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/reflect/">Package reflect</a> supports a new struct tag scheme
|
||||
that enables sharing of struct tags between multiple packages.
|
||||
In this scheme, the tags must be of the form:
|
||||
</p>
|
||||
<pre>
|
||||
`key:"value" key2:"value2"`
|
||||
</pre>
|
||||
<p>
|
||||
The <a href="/pkg/reflect/#StructField">StructField</a> type's Tag field now
|
||||
has type <a href="/pkg/reflect/#StructTag">StructTag</a>, which has a
|
||||
<code>Get</code> method. Clients of <a href="/pkg/json">json</a> and
|
||||
<a href="/pkg/xml">xml</a> will need to be updated. Code that says
|
||||
</p>
|
||||
<pre>
|
||||
type T struct {
|
||||
X int "name"
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
should become
|
||||
</p>
|
||||
<pre>
|
||||
type T struct {
|
||||
X int `json:"name"` // or `xml:"name"`
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
Use <a href="/cmd/govet/">govet</a> to identify struct tags that need to be
|
||||
changed to use the new syntax.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/sort/">Package sort</a>'s <code>IntArray</code> type has been
|
||||
renamed to <a href="/pkg/sort/#IntSlice">IntSlice</a>, and similarly for
|
||||
<a href="/pkg/sort/#Float64Slice">Float64Slice</a> and
|
||||
<a href="/pkg/sort/#StringSlice">StringSlice</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/strings/">Package strings</a>'s <code>Split</code> function has
|
||||
itself been split into <a href="/pkg/strings/#Split">Split</a> and
|
||||
<a href="/pkg/strings/#SplitN">SplitN</a>.
|
||||
<code>SplitN</code> is the same as the old <code>Split</code>.
|
||||
The new <code>Split</code> is equivalent to <code>SplitN</code> with a final
|
||||
argument of -1.
|
||||
</p>
|
||||
|
||||
<a href="/pkg/image/draw/">Package image/draw</a>'s
|
||||
<a href="/pkg/image/draw/#Draw">Draw</a> function now takes an additional
|
||||
argument, a compositing operator.
|
||||
If in doubt, use <a href="/pkg/image/draw/#Op">draw.Over</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r59.cmd">Tools</h3>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/goinstall/">Goinstall</a> now installs packages and commands from
|
||||
arbitrary remote repositories (not just Google Code, Github, and so on).
|
||||
See the <a href="/cmd/goinstall/">goinstall documentation</a> for details.
|
||||
</p>
|
||||
|
||||
<h2 id="r58">r58 (released 2011/06/29)</h2>
|
||||
|
||||
<p>
|
||||
The r58 release corresponds to
|
||||
<code><a href="weekly.html#2011-06-09">weekly.2011-06-09</a></code>
|
||||
with additional bug fixes.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-06-09">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="http://code.google.com/p/go/source/list?r=release-branch.r58">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r58.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
This release fixes a <a href="http://code.google.com/p/go/source/detail?r=b720749486e1">use of uninitialized memory in programs that misuse <code>goto</code></a>.
|
||||
</p>
|
||||
|
||||
<h3 id="r58.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
As usual, <a href="/cmd/gofix/">gofix</a> will handle the bulk of the rewrites
|
||||
necessary for these changes to package APIs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http/">Package http</a> drops the <code>finalURL</code> return
|
||||
value from the <a href="/pkg/http/#Client.Get">Client.Get</a> method. The value
|
||||
is now available via the new <code>Request</code> field on <a
|
||||
href="/pkg/http/#Response">http.Response</a>.
|
||||
Most instances of the type map[string][]string in have been
|
||||
replaced with the new <a href="/pkg/http/#Values">Values</a> type.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/exec/">Package exec</a> has been redesigned with a more
|
||||
convenient and succinct API.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/strconv/">Package strconv</a>'s <a href="/pkg/strconv/#Quote">Quote</a>
|
||||
function now escapes only those Unicode code points not classified as printable
|
||||
by <a href="/pkg/unicode/#IsPrint">unicode.IsPrint</a>.
|
||||
Previously Quote would escape all non-ASCII characters.
|
||||
This also affects the <a href="/pkg/fmt/">fmt</a> package's <code>"%q"</code>
|
||||
formatting directive. The previous quoting behavior is still available via
|
||||
strconv's new <a href="/pkg/strconv/#QuoteToASCII">QuoteToASCII</a> function.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/os/signal/">Package os/signal</a>'s
|
||||
<a href="/pkg/os/#Signal">Signal</a> and
|
||||
<a href="/pkg/os/#UnixSignal">UnixSignal</a> types have been moved to the
|
||||
<a href="/pkg/os/">os</a> package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/image/draw/">Package image/draw</a> is the new name for
|
||||
<code>exp/draw</code>. The GUI-related code from <code>exp/draw</code> is now
|
||||
located in the <a href="/pkg/exp/gui/">exp/gui</a> package.
|
||||
</p>
|
||||
|
||||
<h3 id="r58.cmd">Tools</h3>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/goinstall/">Goinstall</a> now observes the GOPATH environment
|
||||
variable to build and install your own code and external libraries outside of
|
||||
the Go tree (and avoid writing Makefiles).
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="r58.minor">Minor revisions</h3>
|
||||
|
||||
<p>r58.1 adds
|
||||
<a href="http://code.google.com/p/go/source/detail?r=293c25943586">build</a> and
|
||||
<a href="http://code.google.com/p/go/source/detail?r=bf17e96b6582">runtime</a>
|
||||
changes to make Go run on OS X 10.7 Lion.
|
||||
</p>
|
||||
|
||||
<h2 id="r57">r57 (released 2011/05/03)</h2>
|
||||
|
||||
<p>
|
||||
The r57 release corresponds to
|
||||
<code><a href="weekly.html#2011-04-27">weekly.2011-04-27</a></code>
|
||||
with additional bug fixes.
|
||||
This section highlights the most significant changes in this release.
|
||||
For a more detailed summary, see the
|
||||
<a href="weekly.html#2011-04-27">weekly release notes</a>.
|
||||
For complete information, see the
|
||||
<a href="http://code.google.com/p/go/source/list?r=release-branch.r57">Mercurial change list</a>.
|
||||
</p>
|
||||
|
||||
<p>The new <a href="/cmd/gofix">gofix</a> tool finds Go programs that use old APIs and rewrites them to use
|
||||
newer ones. After you update to a new Go release, gofix helps make the
|
||||
necessary changes to your programs. Gofix will handle the http, os, and syscall
|
||||
package changes described below, and we will update the program to keep up with
|
||||
future changes to the libraries.
|
||||
Gofix can’t
|
||||
handle all situations perfectly, so read and test the changes it makes before
|
||||
committing them.
|
||||
See <a href="http://blog.golang.org/2011/04/introducing-gofix.html">the gofix blog post</a> for more
|
||||
information.</p>
|
||||
|
||||
<h3 id="r57.lang">Language</h3>
|
||||
|
||||
<p>
|
||||
<a href="/doc/go_spec.html#Receive_operator">Multiple assignment syntax</a> replaces the <code>closed</code> function.
|
||||
The syntax for channel
|
||||
receives allows an optional second assigned value, a boolean value
|
||||
indicating whether the channel is closed. This code:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
v := <-ch
|
||||
if closed(ch) {
|
||||
// channel is closed
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>should now be written as:</p>
|
||||
|
||||
<pre>
|
||||
v, ok := <-ch
|
||||
if !ok {
|
||||
// channel is closed
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p><a href="/doc/go_spec.html#Label_scopes">Unused labels are now illegal</a>, just as unused local variables are.</p>
|
||||
|
||||
<h3 id="r57.pkg">Packages</h3>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/gob/">Package gob</a> will now encode and decode values of types that implement the
|
||||
<a href="/pkg/gob/#GobEncoder">GobEncoder</a> and
|
||||
<a href="/pkg/gob/#GobDecoder">GobDecoder</a> interfaces. This allows types with unexported
|
||||
fields to transmit self-consistent descriptions; examples include
|
||||
<a href="/pkg/big/#Int.GobDecode">big.Int</a> and <a href="/pkg/big/#Rat.GobDecode">big.Rat</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/http/">Package http</a> has been redesigned.
|
||||
For clients, there are new
|
||||
<a href="/pkg/http/#Client">Client</a> and <a href="/pkg/http/#Transport">Transport</a>
|
||||
abstractions that give more control over HTTP details such as headers sent
|
||||
and redirections followed. These abstractions make it easy to implement
|
||||
custom clients that add functionality such as <a href="http://code.google.com/p/goauth2/source/browse/oauth/oauth.go">OAuth2</a>.
|
||||
For servers, <a href="/pkg/http/#ResponseWriter">ResponseWriter</a>
|
||||
has dropped its non-essential methods.
|
||||
The Hijack and Flush methods are no longer required;
|
||||
code can test for them by checking whether a specific value implements
|
||||
<a href="/pkg/http/#Hijacker">Hijacker</a> or <a href="/pkg/http/#Flusher">Flusher</a>.
|
||||
The RemoteAddr and UsingTLS methods are replaced by <a href="/pkg/http/#Request">Request</a>'s
|
||||
RemoteAddr and TLS fields.
|
||||
The SetHeader method is replaced by a Header method;
|
||||
its result, of type <a href="/pkg/http/#Header">Header</a>,
|
||||
implements Set and other methods.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/net/">Package net</a>
|
||||
drops the <code>laddr</code> argument from <a href="/pkg/net/#Conn.Dial">Dial</a>
|
||||
and drops the <code>cname</code> return value
|
||||
from <a href="/pkg/net/#LookupHost">LookupHost</a>.
|
||||
The implementation now uses <a href="/cmd/cgo/">cgo</a> to implement
|
||||
network name lookups using the C library getaddrinfo(3)
|
||||
function when possible. This ensures that Go and C programs
|
||||
resolve names the same way and also avoids the OS X
|
||||
application-level firewall.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/os/">Package os</a>
|
||||
introduces simplified <a href="/pkg/os/#File.Open">Open</a>
|
||||
and <a href="/pkg/os/#File.Create">Create</a> functions.
|
||||
The original Open is now available as <a href="/pkg/os/#File.OpenFile">OpenFile</a>.
|
||||
The final three arguments to <a href="/pkg/os/#Process.StartProcess">StartProcess</a>
|
||||
have been replaced by a pointer to a <a href="/pkg/os/#ProcAttr">ProcAttr</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/pkg/reflect/">Package reflect</a> has been redesigned.
|
||||
<a href="/pkg/reflect/#Type">Type</a> is now an interface that implements
|
||||
all the possible type methods.
|
||||
Instead of a type switch on a Type <code>t</code>, switch on <code>t.Kind()</code>.
|
||||
<a href="/pkg/reflect/#Value">Value</a> is now a struct value that
|
||||
implements all the possible value methods.
|
||||
Instead of a type switch on a Value <code>v</code>, switch on <code>v.Kind()</code>.
|
||||
Typeof and NewValue are now called <a href="/pkg/reflect/#Type.TypeOf">TypeOf</a> and <a href="/pkg/reflect/#Value.ValueOf">ValueOf</a>
|
||||
To create a writable Value, use <code>New(t).Elem()</code> instead of <code>Zero(t)</code>.
|
||||
See <a href="http://code.google.com/p/go/source/detail?r=843855f3c026">the change description</a>
|
||||
for the full details.
|
||||
The new API allows a more efficient implementation of Value
|
||||
that avoids many of the allocations required by the previous API.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Remember that gofix will handle the bulk of the rewrites
|
||||
necessary for these changes to package APIs.
|
||||
</p>
|
||||
|
||||
<h3 id="r57.cmd">Tools</h3>
|
||||
|
||||
<p><a href="/cmd/gofix/">Gofix</a>, a new command, is described above.</p>
|
||||
|
||||
<p>
|
||||
<a href="/cmd/gotest/">Gotest</a> is now a Go program instead of a shell script.
|
||||
The new <code>-test.short</code> flag in combination with package testing's Short function
|
||||
allows you to write tests that can be run in normal or “short” mode;
|
||||
all.bash runs tests in short mode to reduce installation time.
|
||||
The Makefiles know about the flag: use <code>make testshort</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The run-time support now implements CPU and memory profiling.
|
||||
Gotest's new
|
||||
<a href="/cmd/gotest/"><code>-test.cpuprofile</code> and
|
||||
<code>-test.memprofile</code> flags</a> make it easy to
|
||||
profile tests.
|
||||
To add profiling to your web server, see the <a href="/pkg/http/pprof/">http/pprof</a>
|
||||
documentation.
|
||||
For other uses, see the <a href="/pkg/runtime/pprof/">runtime/pprof</a> documentation.
|
||||
</p>
|
||||
|
||||
<h3 id="r57.minor">Minor revisions</h3>
|
||||
|
||||
<p>r57.1 fixes a <a href="http://code.google.com/p/go/source/detail?r=ff2bc62726e7145eb2ecc1e0f076998e4a8f86f0">nil pointer dereference in http.FormFile</a>.</p>
|
||||
<p>r57.2 fixes a <a href="http://code.google.com/p/go/source/detail?r=063b0ff67d8277df03c956208abc068076818dae">use of uninitialized memory in programs that misuse <code>goto</code></a>.</p>
|
||||
|
||||
<h2 id="r56">r56 (released 2011/03/16)</h2>
|
||||
|
||||
<p>
|
||||
The r56 release was the first stable release and corresponds to
|
||||
<code><a href="weekly.html#2011-03-07">weekly.2011-03-07.1</a></code>.
|
||||
The numbering starts at 56 because before this release,
|
||||
what we now consider weekly snapshots were called releases.
|
||||
</p>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<p>This page summarizes the changes between tagged weekly snapshots of Go.
|
||||
Such snapshots are no longer created. This page remains as a historical reference only.</p>
|
||||
|
||||
<p>For recent information, see the <a href="//golang.org/change">change log</a> and <a href="//groups.google.com/group/golang-dev/">development mailing list</a>.</p>
|
||||
<p>For recent information, see the <a href="http://code.google.com/p/go/source/list">Mercurial change log</a> and <a href="http://groups.google.com/group/golang-dev/">development mailing list</a>.</p>
|
||||
|
||||
<h2 id="2012-03-27">2012-03-27 (<a href="release.html#go1">Go 1</a>)</h2>
|
||||
|
||||
@@ -519,7 +519,7 @@ Other changes:
|
||||
fix FreeBSD signal handling around thread creation (thanks Devon H. O'Dell),
|
||||
goroutine profile, stack dumps,
|
||||
implement runtime.osyield on FreeBSD 386, amd64 (thanks Devon H. O'Dell),
|
||||
permit default behavior of SIGTSTP, SIGTTIN, SIGTTOU,
|
||||
permit default behaviour of SIGTSTP, SIGTTIN, SIGTTOU,
|
||||
release unused memory to the OS (thanks Sébastien Paolacci),
|
||||
remove an obsolete file (thanks Mikio Hara).
|
||||
* spec: make all comparison results untyped bool,
|
||||
@@ -2450,7 +2450,7 @@ The http package's URL parsing and query escaping code (such as ParseURL and
|
||||
URLEscape) has been moved to the new url package, with several simplifications
|
||||
to the names. Client code can be updated automatically with gofix.
|
||||
|
||||
* asn1: support unmarshaling structs with int32 members (thanks Dave Cheney).
|
||||
* asn1: support unmarshalling structs with int32 members (thanks Dave Cheney).
|
||||
* build: allow builds without cgo or hg,
|
||||
support versioning without hg (thanks Gustavo Niemeyer).
|
||||
* builtin: add documentation for builtins.
|
||||
@@ -3030,7 +3030,7 @@ Other changes:
|
||||
* 5g: alignment fixes.
|
||||
* 6l, 8l: fix Mach-O binaries with many dynamic libraries.
|
||||
* 8l: emit resources (.rsrc) in Windows PE. (thanks Wei Guangjing).
|
||||
* asn1: fix marshaling of empty optional RawValues (thanks Mikkel Krautz).
|
||||
* asn1: fix marshalling of empty optional RawValues (thanks Mikkel Krautz).
|
||||
* big: make Int and Rat implement fmt.Scanner (thanks Evan Shaw),
|
||||
~8x faster number scanning,
|
||||
remove some unnecessary conversions.
|
||||
@@ -4157,7 +4157,7 @@ Other changes in this release:
|
||||
* suffixarray: use binary search for both ends of Lookup (thanks Eric Eisner).
|
||||
* syscall: add missing network interface constants (thanks Mikio Hara).
|
||||
* template: treat map keys as zero, not non-existent (thanks Roger Peppe).
|
||||
* time: allow canceling of After events (thanks Roger Peppe),
|
||||
* time: allow cancelling of After events (thanks Roger Peppe),
|
||||
support Solaris zoneinfo directory.
|
||||
* token/position: added SetLinesForContent.
|
||||
* unicode: update to unicode 6.0.0.
|
||||
@@ -4238,7 +4238,7 @@ example: http://golang.org/pkg/xml/
|
||||
<pre>
|
||||
The json, gob, and template packages have changed, and code that uses them
|
||||
may need to be updated after this release. They will no longer read or write
|
||||
unexported struct fields. When marshaling a struct with json or gob the
|
||||
unexported struct fields. When marshalling a struct with json or gob the
|
||||
unexported fields will be silently ignored. Attempting to unmarshal json or
|
||||
gob data into an unexported field will generate an error. Accessing an
|
||||
unexported field from a template will cause the Execute function to return
|
||||
@@ -5682,7 +5682,7 @@ Other changes:
|
||||
pidigits ~10% performance win by using adds instead of shifts.
|
||||
* time: remove incorrect time.ISO8601 and add time.RFC3339 (thanks Micah Stetson).
|
||||
* utf16: add DecodeRune, EncodeRune.
|
||||
* xml: add support for XML marshaling embedded structs (thanks Raif S. Naffah),
|
||||
* xml: add support for XML marshalling embedded structs (thanks Raif S. Naffah),
|
||||
new "innerxml" tag to collect inner XML.
|
||||
</pre>
|
||||
|
||||
@@ -5696,7 +5696,7 @@ This release contains many changes:
|
||||
* cmath: new complex math library (thanks Charles L. Dorian).
|
||||
* docs: update to match current coding style (thanks Christopher Wedgwood).
|
||||
* exp/eval: fix example and add target to Makefile (thanks Evan Shaw).
|
||||
* fmt: change behavior of format verb %b to match %x when negative (thanks Andrei Vieru).
|
||||
* fmt: change behaviour of format verb %b to match %x when negative (thanks Andrei Vieru).
|
||||
* gc: compile s == "" as len(s) == 0,
|
||||
distinguish fatal compiler bug from error+exit,
|
||||
fix alignment on non-amd64,
|
||||
@@ -5925,10 +5925,10 @@ Other changes and fixes:
|
||||
* 8a/8l: Added CMOVcc instructions (thanks Evan Shaw)
|
||||
* 8l: pe executable building code changed to include import table for kernel32.dll functions (thanks Alex Brainman)
|
||||
* 5g/6g/8g: bug fixes
|
||||
* asn1: bug fixes and additions (incl marshaling)
|
||||
* asn1: bug fixes and additions (incl marshalling)
|
||||
* build: fix build for Native Client, Linux/ARM
|
||||
* dashboard: show benchmarks, add garbage collector benchmarks
|
||||
* encoding/pem: add marshaling support
|
||||
* encoding/pem: add marshalling support
|
||||
* exp/draw: fast paths for a nil mask
|
||||
* godoc: support for directories outside $GOROOT
|
||||
* http: sort header keys when writing Response or Request to wire (thanks Petar Maymounkov)
|
||||
@@ -5971,7 +5971,7 @@ You can now check build status on various platforms at the Go Dashboard:
|
||||
* runtime: add SetFinalizer
|
||||
* time: Sleep through interruptions (thanks Chris Wedgwood)
|
||||
add RFC822 formats
|
||||
experimental implementation of Ticker using two goroutines for all tickers
|
||||
experimental implemenation of Ticker using two goroutines for all tickers
|
||||
* xml: allow underscores in XML element names (thanks Michael Hoisie)
|
||||
allow any scalar type in xml.Unmarshal
|
||||
</pre>
|
||||
|
||||
177
doc/docs.html
@@ -33,36 +33,24 @@ libraries.
|
||||
|
||||
<img class="gopher" src="/doc/gopher/doc.png"/>
|
||||
|
||||
<h3 id="go_tour"><a href="//tour.golang.org/">A Tour of Go</a></h3>
|
||||
<h3 id="go_tour"><a href="http://tour.golang.org/">A Tour of Go</a></h3>
|
||||
<p>
|
||||
An interactive introduction to Go in three sections.
|
||||
The first section covers basic syntax and data structures; the second discusses
|
||||
methods and interfaces; and the third introduces Go's concurrency primitives.
|
||||
Each section concludes with a few exercises so you can practice what you've
|
||||
learned. You can <a href="//tour.golang.org/">take the tour online</a> or
|
||||
install it locally with:
|
||||
</p>
|
||||
<p>
|
||||
<pre>
|
||||
$ go get golang.org/x/tour/gotour
|
||||
</pre>
|
||||
This will place the <code>gotour</code> binary in your workspace's <code>bin</code> directory.
|
||||
learned. You can <a href="http://tour.golang.org/">take the tour online</a> or
|
||||
<a href="http://code.google.com/p/go-tour/">install it locally</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="code"><a href="code.html">How to write Go code</a></h3>
|
||||
<p>
|
||||
Also available as a
|
||||
<a href="//www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>, this doc
|
||||
<a href="http://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="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.
|
||||
</p>
|
||||
|
||||
<h3 id="effective_go"><a href="effective_go.html">Effective Go</a></h3>
|
||||
<p>
|
||||
A document that gives tips for writing clear, idiomatic Go code.
|
||||
@@ -70,52 +58,45 @@ A must read for any new Go programmer. It augments the tour and
|
||||
the language specification, both of which should be read first.
|
||||
</p>
|
||||
|
||||
<h3 id="faq"><a href="/doc/faq">Frequently Asked Questions (FAQ)</a></h3>
|
||||
<h3 id="ref"><a href="/ref/">Go References</a></h3>
|
||||
<p>Language specification, memory model, and detailed documentation for the commands and packages.</p>
|
||||
|
||||
<h3 id="appengine"><a href="https://developers.google.com/appengine/docs/go/gettingstarted/">Getting Started with Go on App Engine</a></h3>
|
||||
<p>
|
||||
How to develop and deploy a simple Go project with
|
||||
<a href="https://developers.google.com/appengine/">Google App Engine</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="go_faq"><a href="go_faq.html">Frequently Asked Questions (FAQ)</a></h3>
|
||||
<p>
|
||||
Answers to common questions about Go.
|
||||
</p>
|
||||
|
||||
<h3 id="wiki"><a href="/wiki">The Go Wiki</a></h3>
|
||||
<h3 id="wiki"><a href="http://code.google.com/p/go-wiki/wiki">Go Language Community Wiki</a></h3>
|
||||
<p>A wiki maintained by the Go community.</p>
|
||||
|
||||
<h4 id="learn_more">More</h4>
|
||||
<h2 id="go1">Go version 1</h2>
|
||||
|
||||
<h3 id="go1notes"><a href="/doc/go1.html">Go 1 Release Notes</a></h3>
|
||||
<p>
|
||||
See the <a href="/wiki/Learn">Learn</a> page at the <a href="/wiki">Wiki</a>
|
||||
for more Go learning resources.
|
||||
A guide for updating your code to work with Go 1.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="references">References</h2>
|
||||
|
||||
<h3 id="pkg"><a href="/pkg/">Package Documentation</a></h3>
|
||||
<h3 id="go1.1notes"><a href="/doc/go1.1.html">Go 1.1 Release Notes</a></h3>
|
||||
<p>
|
||||
The documentation for the Go standard library.
|
||||
A list of significant changes in Go 1.1, with instructions for updating your
|
||||
code where necessary.
|
||||
</p>
|
||||
|
||||
<h3 id="cmd"><a href="/doc/cmd">Command Documentation</a></h3>
|
||||
<h3 id="go1compat"><a href="/doc/go1compat.html">Go 1 and the Future of Go Programs</a></h3>
|
||||
<p>
|
||||
The documentation for the Go tools.
|
||||
What Go 1 defines and the backwards-compatibility guarantees one can expect as
|
||||
Go 1 matures.
|
||||
</p>
|
||||
|
||||
<h3 id="spec"><a href="/ref/spec">Language Specification</a></h3>
|
||||
<p>
|
||||
The official Go Language specification.
|
||||
</p>
|
||||
<h2 id="articles">Go Articles</h2>
|
||||
|
||||
<h3 id="go_mem"><a href="/ref/mem">The Go Memory Model</a></h3>
|
||||
<p>
|
||||
A document that specifies the conditions under which reads of a variable in
|
||||
one goroutine can be guaranteed to observe values produced by writes to the
|
||||
same variable in a different goroutine.
|
||||
</p>
|
||||
|
||||
<h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3>
|
||||
<p>A summary of the changes between Go releases.</p>
|
||||
|
||||
|
||||
<h2 id="articles">Articles</h2>
|
||||
|
||||
<h3 id="blog"><a href="//blog.golang.org/">The Go Blog</a></h3>
|
||||
<h3 id="blog"><a href="http://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>
|
||||
|
||||
@@ -132,48 +113,44 @@ Guided tours of Go programs.
|
||||
|
||||
<h4>Language</h4>
|
||||
<ul>
|
||||
<li><a href="/blog/json-rpc-tale-of-interfaces">JSON-RPC: a tale of interfaces</a></li>
|
||||
<li><a href="/blog/gos-declaration-syntax">Go's Declaration Syntax</a></li>
|
||||
<li><a href="/blog/defer-panic-and-recover">Defer, Panic, and Recover</a></li>
|
||||
<li><a href="/blog/go-concurrency-patterns-timing-out-and">Go Concurrency Patterns: Timing out, moving on</a></li>
|
||||
<li><a href="/blog/go-slices-usage-and-internals">Go Slices: usage and internals</a></li>
|
||||
<li><a href="/blog/gif-decoder-exercise-in-go-interfaces">A GIF decoder: an exercise in Go interfaces</a></li>
|
||||
<li><a href="/blog/error-handling-and-go">Error Handling and Go</a></li>
|
||||
<li><a href="/blog/organizing-go-code">Organizing Go code</a></li>
|
||||
<li><a href="/doc/articles/json_rpc_tale_of_interfaces.html">JSON-RPC: a tale of interfaces</a></li>
|
||||
<li><a href="/doc/articles/gos_declaration_syntax.html">Go's Declaration Syntax</a></li>
|
||||
<li><a href="/doc/articles/defer_panic_recover.html">Defer, Panic, and Recover</a></li>
|
||||
<li><a href="/doc/articles/concurrency_patterns.html">Go Concurrency Patterns: Timing out, moving on</a></li>
|
||||
<li><a href="/doc/articles/slices_usage_and_internals.html">Go Slices: usage and internals</a></li>
|
||||
<li><a href="http://blog.golang.org/2011/05/gif-decoder-exercise-in-go-interfaces.html">A GIF decoder: an exercise in Go interfaces</a></li>
|
||||
<li><a href="/doc/articles/error_handling.html">Error Handling and Go</a></li>
|
||||
</ul>
|
||||
|
||||
<h4>Packages</h4>
|
||||
<ul>
|
||||
<li><a href="/blog/json-and-go">JSON and Go</a> - using the <a href="/pkg/encoding/json/">json</a> package.</li>
|
||||
<li><a href="/blog/gobs-of-data">Gobs of data</a> - the design and use of the <a href="/pkg/encoding/gob/">gob</a> package.</li>
|
||||
<li><a href="/blog/laws-of-reflection">The Laws of Reflection</a> - the fundamentals of the <a href="/pkg/reflect/">reflect</a> package.</li>
|
||||
<li><a href="/blog/go-image-package">The Go image package</a> - the fundamentals of the <a href="/pkg/image/">image</a> package.</li>
|
||||
<li><a href="/blog/go-imagedraw-package">The Go image/draw package</a> - the fundamentals of the <a href="/pkg/image/draw/">image/draw</a> package.</li>
|
||||
<li><a href="/doc/articles/json_and_go.html">JSON and Go</a> - using the <a href="/pkg/encoding/json/">json</a> package.</li>
|
||||
<li><a href="/doc/articles/gobs_of_data.html">Gobs of data</a> - the design and use of the <a href="/pkg/encoding/gob/">gob</a> package.</li>
|
||||
<li><a href="/doc/articles/laws_of_reflection.html">The Laws of Reflection</a> - the fundamentals of the <a href="/pkg/reflect/">reflect</a> package.</li>
|
||||
<li><a href="/doc/articles/image_package.html">The Go image package</a> - the fundamentals of the <a href="/pkg/image/">image</a> package.</li>
|
||||
<li><a href="/doc/articles/image_draw.html">The Go image/draw package</a> - the fundamentals of the <a href="/pkg/image/draw/">image/draw</a> package.</li>
|
||||
</ul>
|
||||
|
||||
<h4>Tools</h4>
|
||||
<ul>
|
||||
<li><a href="/doc/articles/go_command.html">About the Go command</a> - why we wrote it, what it is, what it's not, and how to use it.</li>
|
||||
<li><a href="/blog/c-go-cgo">C? Go? Cgo!</a> - linking against C code with <a href="/cmd/cgo/">cgo</a>.</li>
|
||||
<li><a href="/doc/articles/c_go_cgo.html">C? Go? Cgo!</a> - linking against C code with <a href="/cmd/cgo/">cgo</a>.</li>
|
||||
<li><a href="/doc/gdb">Debugging Go Code with GDB</a></li>
|
||||
<li><a href="/blog/godoc-documenting-go-code">Godoc: documenting Go code</a> - writing good documentation for <a href="/cmd/godoc/">godoc</a>.</li>
|
||||
<li><a href="/blog/profiling-go-programs">Profiling Go Programs</a></li>
|
||||
<li><a href="/doc/articles/race_detector.html">Data Race Detector</a> - a manual for the data race detector.</li>
|
||||
<li><a href="/blog/race-detector">Introducing the Go Race Detector</a> - an introduction to the race detector.</li>
|
||||
<li><a href="/doc/asm">A Quick Guide to Go's Assembler</a> - an introduction to the assembler used by Go.</li>
|
||||
<li><a href="/doc/articles/godoc_documenting_go_code.html">Godoc: documenting Go code</a> - writing good documentation for <a href="/cmd/godoc/">godoc</a>.</li>
|
||||
<li><a href="http://blog.golang.org/2011/06/profiling-go-programs.html">Profiling Go Programs</a></li>
|
||||
<li><a href="/doc/articles/race_detector.html">Data Race Detector</a> - testing Go programs for race conditions.</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="articles_more">More</h4>
|
||||
<p>
|
||||
See the <a href="/wiki/Articles">Articles page</a> at the
|
||||
<a href="/wiki">Wiki</a> for more Go articles.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="talks">Talks</h2>
|
||||
|
||||
<img class="gopher" src="/doc/gopher/talks.png"/>
|
||||
|
||||
<p>
|
||||
The talks marked with a red asterisk (<font color="red">*</font>) were written
|
||||
before Go 1 and contain some examples that are no longer correct, but they are
|
||||
still of value.
|
||||
</p>
|
||||
|
||||
<h3 id="video_tour_of_go"><a href="http://research.swtch.com/gotour">A Video Tour of Go</a></h3>
|
||||
<p>
|
||||
Three things that make Go fast, fun, and productive:
|
||||
@@ -181,31 +158,63 @@ interfaces, reflection, and concurrency. Builds a toy web crawler to
|
||||
demonstrate these.
|
||||
</p>
|
||||
|
||||
<h3 id="go_code_that_grows"><a href="//vimeo.com/53221560">Code that grows with grace</a></h3>
|
||||
<p>
|
||||
One of Go's key design goals is code adaptability; that it should be easy to take a simple design and build upon it in a clean and natural way. In this talk Andrew Gerrand describes a simple "chat roulette" server that matches pairs of incoming TCP connections, and then use Go's concurrency mechanisms, interfaces, and standard library to extend it with a web interface and other features. While the function of the program changes dramatically, Go's flexibility preserves the original design as it grows.
|
||||
</p>
|
||||
|
||||
<h3 id="go_concurrency_patterns"><a href="//www.youtube.com/watch?v=f6kdp27TYZs">Go Concurrency Patterns</a></h3>
|
||||
<h3 id="go_concurrency_patterns"><a href="http://www.youtube.com/watch?v=f6kdp27TYZs">Go Concurrency Patterns</a></h3>
|
||||
<p>
|
||||
Concurrency is the key to designing high performance network services. Go's concurrency primitives (goroutines and channels) provide a simple and efficient means of expressing concurrent execution. In this talk we see how tricky concurrency problems can be solved gracefully with simple Go code.
|
||||
</p>
|
||||
|
||||
<h3 id="advanced_go_concurrency_patterns"><a href="//www.youtube.com/watch?v=QDDwwePbDtw">Advanced Go Concurrency Patterns</a></h3>
|
||||
<h3 id="meet_the_go_team"><a href="http://www.youtube.com/watch?v=sln-gJaURzk">Meet the Go team</a></h3>
|
||||
<p>
|
||||
This talk expands on the <i>Go Concurrency Patterns</i> talk to dive deeper into Go's concurrency primitives.
|
||||
A panel discussion with David Symonds, Robert Griesemer, Rob Pike, Ken Thompson, Andrew Gerrand, and Brad Fitzpatrick.
|
||||
</p>
|
||||
|
||||
<h3 id="writing_web_apps"><a href="http://www.youtube.com/watch?v=-i0hat7pdpk">Writing Web Apps in Go</a><font color="red">*</font></h3>
|
||||
<p>
|
||||
A talk by Rob Pike and Andrew Gerrand presented at Google I/O 2011.
|
||||
It walks through the construction and deployment of a simple web application
|
||||
and unveils the <a href="http://blog.golang.org/2011/05/go-and-google-app-engine.html">Go runtime for App Engine</a>.
|
||||
See the <a href="http://talks.golang.org/2011/Writing_Web_Apps_in_Go.pdf">presentation slides</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="go_programming"><a href="http://www.youtube.com/watch?v=jgVhBThJdXc">Go Programming</a><font color="red">*</font></h3>
|
||||
<p>
|
||||
A presentation delivered by Rob Pike and Russ Cox at Google I/O 2010. It
|
||||
illustrates how programming in Go differs from other languages through a set of
|
||||
examples demonstrating features particular to Go. These include concurrency,
|
||||
embedded types, methods on any type, and program construction using interfaces.
|
||||
</p>
|
||||
|
||||
<h4 id="talks_more">More</h4>
|
||||
<p>
|
||||
See the <a href="/talks">Go Talks site</a> and <a href="/wiki/GoTalks">wiki page</a> for more Go talks.
|
||||
See the <a href="http://code.google.com/p/go-wiki/wiki/GoTalks">GoTalks
|
||||
page</a> at the <a href="http://code.google.com/p/go-wiki/wiki">Go Wiki</a> for
|
||||
more Go talks.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="nonenglish">Non-English Documentation</h2>
|
||||
|
||||
<p>
|
||||
See the <a href="/wiki/NonEnglish">NonEnglish</a> page
|
||||
at the <a href="/wiki">Wiki</a> for localized
|
||||
See the <a href="http://code.google.com/p/go-wiki/wiki/NonEnglish">NonEnglish</a> page
|
||||
at the <a href="http://code.google.com/p/go-wiki/wiki">Go Wiki</a> for localized
|
||||
documentation.
|
||||
</p>
|
||||
|
||||
<h2 id="community">The Go Community</h2>
|
||||
|
||||
<img class="gopher" src="/doc/gopher/project.png"/>
|
||||
|
||||
<h3 id="mailinglist"><a href="http://groups.google.com/group/golang-nuts">Go Nuts Mailing List</a></h3>
|
||||
<p>The <a href="http://groups.google.com/group/golang-nuts">golang-nuts</a>
|
||||
mailing list is for general Go discussion.</p>
|
||||
|
||||
<h3 id="projects"><a href="http://code.google.com/p/go-wiki/wiki/Projects">Go Wiki Projects Page</a></h3>
|
||||
<p>A list of external Go projects including programs and libraries.</p>
|
||||
|
||||
<h3 id="irc"><a href="irc:irc.freenode.net/go-nuts">Go IRC Channel</a></h3>
|
||||
<p><b>#go-nuts</b> on <b>irc.freenode.net</b> is the official Go IRC channel.</p>
|
||||
|
||||
<h3 id="plus"><a href="https://plus.google.com/101406623878176903605/posts">The Go Programming Language at Google+</a></h3>
|
||||
<p>The Go project's Google+ page.</p>
|
||||
|
||||
<h3 id="twitter"><a href="http://twitter.com/go_nuts">@go_nuts at Twitter</a></h3>
|
||||
<p>The Go project's official Twitter account.</p>
|
||||
|
||||
210
doc/editors.html
@@ -1,210 +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 Go</a>: a plugin for Vim to provide Go programming language support</li>
|
||||
<li><a href="https://marketplace.visualstudio.com/items?itemName=lukehoban.Go">Visual Studio Code Go</a>:
|
||||
an extension for Visual Studio Code to provide support for the Go programming language</li>
|
||||
<li><a href="https://www.jetbrains.com/go">Gogland</a>: Gogland is distributed either as a standalone IDE
|
||||
or as a plugin for the IntelliJ Platform IDEs</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>
|
||||
|
||||
<p>
|
||||
Each development environment integrates a number of Go-specific tools.
|
||||
The following feature matrix lists and compares the most significant features.
|
||||
</p>
|
||||
|
||||
<table class="features-matrix">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><img title="Vim Go" src="/doc/editors/vimgo.png"><br>Vim Go</th>
|
||||
<th><img title="Visual Studio Code" src="/doc/editors/vscodego.png"><br>Visual Studio Code Go</th>
|
||||
<th><img title="Gogland" src="/doc/editors/gogland.png"><br>Gogland</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-row" colspan="4">Editing features</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Build and run from the editor/IDE</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Autocompletion of identifers (variable, method, and function names)</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Autocompletion based on type</td>
|
||||
<td class="no">No</td>
|
||||
<td class="no">No</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rename identifiers</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Auto format, build, vet, and lint on save</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes<sup>1</sup></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Auto insert import paths and remove unused on save</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes<sup>2</sup></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Auto generate JSON, XML tags for struct fields</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-row" colspan="4">Navigation features</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Display documentation inline, or open godoc in browser</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Switch between <code>*.go</code> and <code>*_test.go</code> file</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jump to definition and referees</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Look up for interface implementations</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Search for callers and callees</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-row" colspan="4">Testing and debugging features</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Debugger support</td>
|
||||
<td class="no">No</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Run a single test case, all tests from file, or all tests from a package</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Auto generate tests for packages, files and identifiers</td>
|
||||
<td class="no">No</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="no">No</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Debug tests</td>
|
||||
<td class="no">No</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Display test coverage</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr class="download">
|
||||
<td></td>
|
||||
<td><a href="https://github.com/fatih/vim-go">Install<a/></td>
|
||||
<td><a href="https://marketplace.visualstudio.com/items?itemName=lukehoban.Go">Install<a/></td>
|
||||
<td><a href="https://www.jetbrains.com/go">Install<a/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<sup>1</sup>: Possible when enabled via Settings > Go > On Save, <code>go</code> <code>vet</code> and <code>golint</code> are available via plugins. Also runs tests on save if configured.
|
||||
<br>
|
||||
<sup>2</sup>: Additionally, user input can disambiguate when two or more options are available.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.features-matrix {
|
||||
min-width: 800px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.features-matrix th {
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
.features-matrix th img {
|
||||
width: 48px;
|
||||
}
|
||||
.features-matrix .yes {
|
||||
text-align: center;
|
||||
}
|
||||
.features-matrix .no {
|
||||
text-align: center;
|
||||
background-color: #ffe9e9;
|
||||
}
|
||||
.features-matrix .download {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
.features-matrix td {
|
||||
padding: 11px 5px 11px 5px;
|
||||
border-bottom: solid 1px #ebebeb;
|
||||
}
|
||||
.features-matrix .feature-row {
|
||||
background-color: #ebebeb;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--TODO(jbd): Add the Atom comparison-->
|
||||
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
@@ -28,7 +28,7 @@ will be easy for other Go programmers to understand.
|
||||
<p>
|
||||
This document gives tips for writing clear, idiomatic Go code.
|
||||
It augments the <a href="/ref/spec">language specification</a>,
|
||||
the <a href="//tour.golang.org/">Tour of Go</a>,
|
||||
the <a href="http://tour.golang.org/">Tour of Go</a>,
|
||||
and <a href="/doc/code.html">How to Write Go Code</a>,
|
||||
all of which you
|
||||
should read first.
|
||||
@@ -37,15 +37,15 @@ should read first.
|
||||
<h3 id="examples">Examples</h3>
|
||||
|
||||
<p>
|
||||
The <a href="/src/">Go package sources</a>
|
||||
The <a href="/src/pkg/">Go package sources</a>
|
||||
are intended to serve not
|
||||
only as the core library but also as examples of how to
|
||||
use the language.
|
||||
Moreover, many of the packages contain working, self-contained
|
||||
executable examples you can run directly from the
|
||||
<a href="//golang.org">golang.org</a> web site, such as
|
||||
<a href="//golang.org/pkg/strings/#example_Map">this one</a> (if
|
||||
necessary, click on the word "Example" to open it up).
|
||||
<a href="http://golang.org">golang.org</a> web site, such as
|
||||
<a href="http://golang.org/pkg/strings/#example_Map">this one</a> (click
|
||||
on the word "Example" to open it up).
|
||||
If you have a question about how to approach a problem or how something
|
||||
might be implemented, the documentation, code and examples in the
|
||||
library can provide answers, ideas and
|
||||
@@ -214,7 +214,7 @@ not be used.
|
||||
One adjustment <code>godoc</code> does do is to display indented
|
||||
text in a fixed-width font, suitable for program snippets.
|
||||
The package comment for the
|
||||
<a href="/pkg/fmt/"><code>fmt</code> package</a> uses this to good effect.
|
||||
<a href="http://golang.org/pkg/fmt/"><code>fmt</code> package</a> uses this to good effect.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -239,21 +239,21 @@ starts with the name being declared.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// Compile parses a regular expression and returns, if successful,
|
||||
// a Regexp that can be used to match against text.
|
||||
func Compile(str string) (*Regexp, error) {
|
||||
// Compile parses a regular expression and returns, if successful, a Regexp
|
||||
// object that can be used to match against text.
|
||||
func Compile(str string) (regexp *Regexp, err error) {
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If every doc comment begins with the name of the item it describes,
|
||||
the output of <code>godoc</code> can usefully be run through <code>grep</code>.
|
||||
If the name always begins the comment, the output of <code>godoc</code>
|
||||
can usefully be run through <code>grep</code>.
|
||||
Imagine you couldn't remember the name "Compile" but were looking for
|
||||
the parsing function for regular expressions, so you ran
|
||||
the command,
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ godoc regexp | grep -i parse
|
||||
$ godoc regexp | grep parse
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -288,7 +288,7 @@ var (
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Grouping can also indicate relationships between items,
|
||||
Even for private names, grouping can also indicate relationships between items,
|
||||
such as the fact that a set of variables is protected by a mutex.
|
||||
</p>
|
||||
|
||||
@@ -344,13 +344,13 @@ determines just which package is being used.
|
||||
<p>
|
||||
Another convention is that the package name is the base name of
|
||||
its source directory;
|
||||
the package in <code>src/encoding/base64</code>
|
||||
the package in <code>src/pkg/encoding/base64</code>
|
||||
is imported as <code>"encoding/base64"</code> but has name <code>base64</code>,
|
||||
not <code>encoding_base64</code> and not <code>encodingBase64</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The importer of a package will use the name to refer to its contents,
|
||||
The importer of a package will use the name to refer to its contents.
|
||||
so exported names in the package can use that fact
|
||||
to avoid stutter.
|
||||
(Don't use the <code>import .</code> notation, which can simplify
|
||||
@@ -506,8 +506,6 @@ slightly generalized
|
||||
<code>switch</code> is more flexible;
|
||||
<code>if</code> and <code>switch</code> accept an optional
|
||||
initialization statement like that of <code>for</code>;
|
||||
<code>break</code> and <code>continue</code> statements
|
||||
take an optional label to identify what to break or continue;
|
||||
and there are new control structures including a type switch and a
|
||||
multiway communications multiplexer, <code>select</code>.
|
||||
The syntax is also slightly different:
|
||||
@@ -701,7 +699,6 @@ for _, value := range array {
|
||||
|
||||
<p>
|
||||
The blank identifier has many uses, as described in <a href="#blank">a later section</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For strings, the <code>range</code> does more work for you, breaking out individual
|
||||
@@ -710,7 +707,7 @@ Erroneous encodings consume one byte and produce the
|
||||
replacement rune U+FFFD.
|
||||
(The name (with associated builtin type) <code>rune</code> is Go terminology for a
|
||||
single Unicode code point.
|
||||
See <a href="/ref/spec#Rune_literals">the language specification</a>
|
||||
See <a href="http://golang.org/ref/spec#Rune_literals">the language specification</a>
|
||||
for details.)
|
||||
The loop
|
||||
</p>
|
||||
@@ -784,47 +781,7 @@ func shouldEscape(c byte) bool {
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Although they are not nearly as common in Go as some other C-like
|
||||
languages, <code>break</code> statements can be used to terminate
|
||||
a <code>switch</code> early.
|
||||
Sometimes, though, it's necessary to break out of a surrounding loop,
|
||||
not the switch, and in Go that can be accomplished by putting a label
|
||||
on the loop and "breaking" to that label.
|
||||
This example shows both uses.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
Loop:
|
||||
for n := 0; n < len(src); n += size {
|
||||
switch {
|
||||
case src[n] < sizeOne:
|
||||
if validateOnly {
|
||||
break
|
||||
}
|
||||
size = 1
|
||||
update(src[n])
|
||||
|
||||
case src[n] < sizeTwo:
|
||||
if n+1 >= len(src) {
|
||||
err = errShortInput
|
||||
break Loop
|
||||
}
|
||||
if validateOnly {
|
||||
break
|
||||
}
|
||||
size = 2
|
||||
update(src[n] + src[n+1]<<shift)
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Of course, the <code>continue</code> statement also accepts an optional label
|
||||
but it applies only to loops.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To close this section, here's a comparison routine for byte slices that uses two
|
||||
Here's a comparison routine for byte slices that uses two
|
||||
<code>switch</code> statements:
|
||||
</p>
|
||||
<pre>
|
||||
@@ -841,16 +798,16 @@ func Compare(a, b []byte) int {
|
||||
}
|
||||
}
|
||||
switch {
|
||||
case len(a) > len(b):
|
||||
return 1
|
||||
case len(a) < len(b):
|
||||
return -1
|
||||
case len(a) > len(b):
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3 id="type_switch">Type switch</h3>
|
||||
<h2 id="type_switch">Type switch</h2>
|
||||
|
||||
<p>
|
||||
A switch can also be used to discover the dynamic type of an interface
|
||||
@@ -866,7 +823,7 @@ var t interface{}
|
||||
t = functionOfSomeType()
|
||||
switch t := t.(type) {
|
||||
default:
|
||||
fmt.Printf("unexpected type %T\n", t) // %T prints whatever type t has
|
||||
fmt.Printf("unexpected type %T", t) // %T prints whatever type t has
|
||||
case bool:
|
||||
fmt.Printf("boolean %t\n", t) // t has type bool
|
||||
case int:
|
||||
@@ -925,7 +882,7 @@ func nextInt(b []byte, i int) (int, int) {
|
||||
}
|
||||
x := 0
|
||||
for ; i < len(b) && isDigit(b[i]); i++ {
|
||||
x = x*10 + int(b[i]) - '0'
|
||||
x = x*10 + int(b[i])-'0'
|
||||
}
|
||||
return x, i
|
||||
}
|
||||
@@ -1382,13 +1339,12 @@ limit of how much data to read. Here is the signature of the
|
||||
<code>os</code>:
|
||||
</p>
|
||||
<pre>
|
||||
func (f *File) Read(buf []byte) (n int, err error)
|
||||
func (file *File) Read(buf []byte) (n int, err error)
|
||||
</pre>
|
||||
<p>
|
||||
The method returns the number of bytes read and an error value, if
|
||||
any.
|
||||
To read into the first 32 bytes of a larger buffer
|
||||
<code>buf</code>, <i>slice</i> (here used as a verb) the buffer.
|
||||
any. To read into the first 32 bytes of a larger buffer
|
||||
<code>b</code>, <i>slice</i> (here used as a verb) the buffer.
|
||||
</p>
|
||||
<pre>
|
||||
n, err := f.Read(buf[0:32])
|
||||
@@ -1421,7 +1377,7 @@ resulting slice is returned. The function uses the fact that
|
||||
<code>nil</code> slice, and return 0.
|
||||
</p>
|
||||
<pre>
|
||||
func Append(slice, data []byte) []byte {
|
||||
func Append(slice, data[]byte) []byte {
|
||||
l := len(slice)
|
||||
if l + len(data) > cap(slice) { // reallocate
|
||||
// Allocate double what's needed, for future growth.
|
||||
@@ -1489,7 +1445,7 @@ If the slices might grow or shrink, they should be allocated independently
|
||||
to avoid overwriting the next line; if not, it can be more efficient to construct
|
||||
the object with a single allocation.
|
||||
For reference, here are sketches of the two methods.
|
||||
First, a line at a time:
|
||||
First, a line a time:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -1540,7 +1496,7 @@ with colon-separated key-value pairs,
|
||||
so it's easy to build them during initialization.
|
||||
</p>
|
||||
<pre>
|
||||
var timeZone = map[string]int{
|
||||
var timeZone = map[string] int {
|
||||
"UTC": 0*60*60,
|
||||
"EST": -5*60*60,
|
||||
"CST": -6*60*60,
|
||||
@@ -1567,7 +1523,7 @@ Set the map entry to <code>true</code> to put the value in the set, and then
|
||||
test it by simple indexing.
|
||||
</p>
|
||||
<pre>
|
||||
attended := map[string]bool{
|
||||
attended := map[string] bool {
|
||||
"Ann": true,
|
||||
"Joe": true,
|
||||
...
|
||||
@@ -1580,7 +1536,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>
|
||||
@@ -1833,7 +1789,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
|
||||
@@ -1959,7 +1915,7 @@ initializer can be a general expression computed at run time.
|
||||
var (
|
||||
home = os.Getenv("HOME")
|
||||
user = os.Getenv("USER")
|
||||
gopath = os.Getenv("GOPATH")
|
||||
goRoot = os.Getenv("GOROOT")
|
||||
)
|
||||
</pre>
|
||||
|
||||
@@ -1988,11 +1944,11 @@ func init() {
|
||||
if home == "" {
|
||||
home = "/home/" + user
|
||||
}
|
||||
if gopath == "" {
|
||||
gopath = home + "/go"
|
||||
if goRoot == "" {
|
||||
goRoot = home + "/go"
|
||||
}
|
||||
// gopath may be overridden by --gopath flag on command line.
|
||||
flag.StringVar(&gopath, "gopath", gopath, "override default GOPATH")
|
||||
// goRoot may be overridden by --goroot flag on command line.
|
||||
flag.StringVar(&goRoot, "goroot", goRoot, "Go root directory")
|
||||
}
|
||||
</pre>
|
||||
|
||||
@@ -2014,7 +1970,7 @@ then make the receiver for the method a value of that type.
|
||||
type ByteSlice []byte
|
||||
|
||||
func (slice ByteSlice) Append(data []byte) []byte {
|
||||
// Body exactly the same as the Append function defined above.
|
||||
// Body exactly the same as above
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
@@ -2056,22 +2012,10 @@ We pass the address of a <code>ByteSlice</code>
|
||||
because only <code>*ByteSlice</code> satisfies <code>io.Writer</code>.
|
||||
The rule about pointers vs. values for receivers is that value methods
|
||||
can be invoked on pointers and values, but pointer methods can only be
|
||||
invoked on pointers.
|
||||
invoked on pointers. This is because pointer methods can modify the
|
||||
receiver; invoking them on a copy of the value would cause those
|
||||
modifications to be discarded.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This rule arises because pointer methods can modify the receiver; invoking
|
||||
them on a value would cause the method to receive a copy of the value, so
|
||||
any modifications would be discarded.
|
||||
The language therefore disallows this mistake.
|
||||
There is a handy exception, though. When the value is addressable, the
|
||||
language takes care of the common case of invoking a pointer method on a
|
||||
value by inserting the address operator automatically.
|
||||
In our example, the variable <code>b</code> is addressable, so we can call
|
||||
its <code>Write</code> method with just <code>b.Write</code>. The compiler
|
||||
will rewrite that to <code>(&b).Write</code> for us.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
By the way, the idea of using <code>Write</code> on a slice of bytes
|
||||
is central to the implementation of <code>bytes.Buffer</code>.
|
||||
@@ -2187,7 +2131,6 @@ A one-case type switch would do, but so would a <em>type assertion</em>.
|
||||
A type assertion takes an interface value and extracts from it a value of the specified explicit type.
|
||||
The syntax borrows from the clause opening a type switch, but with an explicit
|
||||
type rather than the <code>type</code> keyword:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
value.(typeName)
|
||||
@@ -2238,12 +2181,13 @@ if str, ok := value.(string); ok {
|
||||
|
||||
<h3 id="generality">Generality</h3>
|
||||
<p>
|
||||
If a type exists only to implement an interface and will
|
||||
never have exported methods beyond that interface, there is
|
||||
no need to export the type itself.
|
||||
Exporting just the interface makes it clear the value has no
|
||||
interesting behavior beyond what is described in the
|
||||
interface.
|
||||
If a type exists only to implement an interface
|
||||
and has no exported methods beyond that interface,
|
||||
there is no need to export the type itself.
|
||||
Exporting just the interface makes it clear that
|
||||
it's the behavior that matters, not the implementation,
|
||||
and that other implementations with different properties
|
||||
can mirror the behavior of the original type.
|
||||
It also avoids the need to repeat the documentation
|
||||
on every instance of a common method.
|
||||
</p>
|
||||
@@ -2409,7 +2353,7 @@ The <code>http</code> package contains this code:
|
||||
// Handler object that calls f.
|
||||
type HandlerFunc func(ResponseWriter, *Request)
|
||||
|
||||
// ServeHTTP calls f(w, req).
|
||||
// ServeHTTP calls f(c, req).
|
||||
func (f HandlerFunc) ServeHTTP(w ResponseWriter, req *Request) {
|
||||
f(w, req)
|
||||
}
|
||||
@@ -2447,7 +2391,7 @@ the handler installed at that page has value <code>ArgServer</code>
|
||||
and type <code>HandlerFunc</code>.
|
||||
The HTTP server will invoke the method <code>ServeHTTP</code>
|
||||
of that type, with <code>ArgServer</code> as the receiver, which will in turn call
|
||||
<code>ArgServer</code> (via the invocation <code>f(w, req)</code>
|
||||
<code>ArgServer</code> (via the invocation <code>f(c, req)</code>
|
||||
inside <code>HandlerFunc.ServeHTTP</code>).
|
||||
The arguments will then be displayed.
|
||||
</p>
|
||||
@@ -2477,8 +2421,6 @@ It has uses beyond those we've seen already.
|
||||
<p>
|
||||
The use of a blank identifier in a <code>for</code> <code>range</code> loop is a
|
||||
special case of a general situation: multiple assignment.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If an assignment requires multiple values on the left side,
|
||||
but one of the values will not be used by the program,
|
||||
@@ -2594,7 +2536,7 @@ package, which defines a <code><a href="/pkg/encoding/json/#Marshaler">Marshaler
|
||||
interface. When the JSON encoder receives a value that implements that interface,
|
||||
the encoder invokes the value's marshaling method to convert it to JSON
|
||||
instead of doing the standard conversion.
|
||||
The encoder checks this property at run time with a <a href="#interface_conversions">type assertion</a> like:
|
||||
The encoder checks this property at run time with a <a href="interface_conversions">type assertion</a> like:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -2618,7 +2560,7 @@ One place this situation arises is when it is necessary to guarantee within the
|
||||
it actually satisfies the interface.
|
||||
If a type—for example,
|
||||
<code><a href="/pkg/encoding/json/#RawMessage">json.RawMessage</a></code>—needs
|
||||
a custom JSON representation, it should implement
|
||||
a custom its JSON representation, it should implement
|
||||
<code>json.Marshaler</code>, but there are no static conversions that would
|
||||
cause the compiler to verify this automatically.
|
||||
If the type inadvertently fails to satisfy the interface, the JSON encoder will still work,
|
||||
@@ -2953,19 +2895,26 @@ means waiting until some receiver has retrieved a value.
|
||||
<p>
|
||||
A buffered channel can be used like a semaphore, for instance to
|
||||
limit throughput. In this example, incoming requests are passed
|
||||
to <code>handle</code>, which sends a value into the channel, processes
|
||||
the request, and then receives a value from the channel
|
||||
to ready the “semaphore” for the next consumer.
|
||||
to <code>handle</code>, which receives a value from the channel, processes
|
||||
the request, and then sends a value back to the channel
|
||||
to ready the "semaphore" for the next consumer.
|
||||
The capacity of the channel buffer limits the number of
|
||||
simultaneous calls to <code>process</code>.
|
||||
simultaneous calls to <code>process</code>,
|
||||
so during initialization we prime the channel by filling it to capacity.
|
||||
</p>
|
||||
<pre>
|
||||
var sem = make(chan int, MaxOutstanding)
|
||||
|
||||
func handle(r *Request) {
|
||||
sem <- 1 // Wait for active queue to drain.
|
||||
process(r) // May take a long time.
|
||||
<-sem // Done; enable next request to run.
|
||||
<-sem // Wait for active queue to drain.
|
||||
process(r) // May take a long time.
|
||||
sem <- 1 // Done; enable next request to run.
|
||||
}
|
||||
|
||||
func init() {
|
||||
for i := 0; i < MaxOutstanding; i++ {
|
||||
sem <- 1
|
||||
}
|
||||
}
|
||||
|
||||
func Serve(queue chan *Request) {
|
||||
@@ -2977,9 +2926,10 @@ func Serve(queue chan *Request) {
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Once <code>MaxOutstanding</code> handlers are executing <code>process</code>,
|
||||
any more will block trying to send into the filled channel buffer,
|
||||
until one of the existing handlers finishes and receives from the buffer.
|
||||
Because data synchronization occurs on a receive from a channel
|
||||
(that is, the send "happens before" the receive; see
|
||||
<a href="/ref/mem">The Go Memory Model</a>),
|
||||
acquisition of the semaphore must be on a channel receive, not a send.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -2990,77 +2940,21 @@ of them can run at any moment.
|
||||
As a result, the program can consume unlimited resources if the requests come in too fast.
|
||||
We can address that deficiency by changing <code>Serve</code> to
|
||||
gate the creation of the goroutines.
|
||||
Here's an obvious solution, but beware it has a bug we'll fix subsequently:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func Serve(queue chan *Request) {
|
||||
for req := range queue {
|
||||
sem <- 1
|
||||
<-sem
|
||||
go func() {
|
||||
process(req) // Buggy; see explanation below.
|
||||
<-sem
|
||||
process(req)
|
||||
sem <- 1
|
||||
}()
|
||||
}
|
||||
}</pre>
|
||||
|
||||
<p>
|
||||
The bug is that in a Go <code>for</code> loop, the loop variable
|
||||
is reused for each iteration, so the <code>req</code>
|
||||
variable is shared across all goroutines.
|
||||
That's not what we want.
|
||||
We need to make sure that <code>req</code> is unique for each goroutine.
|
||||
Here's one way to do that, passing the value of <code>req</code> as an argument
|
||||
to the closure in the goroutine:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func Serve(queue chan *Request) {
|
||||
for req := range queue {
|
||||
sem <- 1
|
||||
go func(req *Request) {
|
||||
process(req)
|
||||
<-sem
|
||||
}(req)
|
||||
}
|
||||
}</pre>
|
||||
|
||||
<p>
|
||||
Compare this version with the previous to see the difference in how
|
||||
the closure is declared and run.
|
||||
Another solution is just to create a new variable with the same
|
||||
name, as in this example:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func Serve(queue chan *Request) {
|
||||
for req := range queue {
|
||||
req := req // Create new instance of req for the goroutine.
|
||||
sem <- 1
|
||||
go func() {
|
||||
process(req)
|
||||
<-sem
|
||||
}()
|
||||
}
|
||||
}</pre>
|
||||
|
||||
<p>
|
||||
It may seem odd to write
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
req := req
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
but it's legal and idiomatic in Go to do this.
|
||||
You get a fresh version of the variable with the same name, deliberately
|
||||
shadowing the loop variable locally but unique to each goroutine.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Going back to the general problem of writing the server,
|
||||
another approach that manages resources well is to start a fixed
|
||||
Another solution that manages resources well is to start a fixed
|
||||
number of <code>handle</code> goroutines all reading from the request
|
||||
channel.
|
||||
The number of goroutines limits the number of simultaneous
|
||||
@@ -3171,44 +3065,40 @@ count the completion signals by draining the channel after
|
||||
launching all the goroutines.
|
||||
</p>
|
||||
<pre>
|
||||
const numCPU = 4 // number of CPU cores
|
||||
const NCPU = 4 // number of CPU cores
|
||||
|
||||
func (v Vector) DoAll(u Vector) {
|
||||
c := make(chan int, numCPU) // Buffering optional but sensible.
|
||||
for i := 0; i < numCPU; i++ {
|
||||
go v.DoSome(i*len(v)/numCPU, (i+1)*len(v)/numCPU, u, c)
|
||||
c := make(chan int, NCPU) // Buffering optional but sensible.
|
||||
for i := 0; i < NCPU; i++ {
|
||||
go v.DoSome(i*len(v)/NCPU, (i+1)*len(v)/NCPU, u, c)
|
||||
}
|
||||
// Drain the channel.
|
||||
for i := 0; i < numCPU; i++ {
|
||||
for i := 0; i < NCPU; i++ {
|
||||
<-c // wait for one task to complete
|
||||
}
|
||||
// All done.
|
||||
}
|
||||
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Rather than create a constant value for numCPU, we can ask the runtime what
|
||||
value is appropriate.
|
||||
The function <code><a href="/pkg/runtime#NumCPU">runtime.NumCPU</a></code>
|
||||
returns the number of hardware CPU cores in the machine, so we could write
|
||||
The current implementation of the Go runtime
|
||||
will not parallelize this code by default.
|
||||
It dedicates only a single core to user-level processing. An
|
||||
arbitrary number of goroutines can be blocked in system calls, but
|
||||
by default only one can be executing user-level code at any time.
|
||||
It should be smarter and one day it will be smarter, but until it
|
||||
is if you want CPU parallelism you must tell the run-time
|
||||
how many goroutines you want executing code simultaneously. There
|
||||
are two related ways to do this. Either run your job with environment
|
||||
variable <code>GOMAXPROCS</code> set to the number of cores to use
|
||||
or import the <code>runtime</code> package and call
|
||||
<code>runtime.GOMAXPROCS(NCPU)</code>.
|
||||
A helpful value might be <code>runtime.NumCPU()</code>, which reports the number
|
||||
of logical CPUs on the local machine.
|
||||
Again, this requirement is expected to be retired as the scheduling and run-time improve.
|
||||
</p>
|
||||
<pre>
|
||||
var numCPU = runtime.NumCPU()
|
||||
</pre>
|
||||
<p>
|
||||
There is also a function
|
||||
<code><a href="/pkg/runtime#GOMAXPROCS">runtime.GOMAXPROCS</a></code>,
|
||||
which reports (or sets)
|
||||
the user-specified number of cores that a Go program can have running
|
||||
simultaneously.
|
||||
It defaults to the value of <code>runtime.NumCPU</code> but can be
|
||||
overridden by setting the similarly named shell environment variable
|
||||
or by calling the function with a positive number. Calling it with
|
||||
zero just queries the value.
|
||||
Therefore if we want to honor the user's resource request, we should write
|
||||
</p>
|
||||
<pre>
|
||||
var numCPU = runtime.GOMAXPROCS(0)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Be sure not to confuse the ideas of concurrency—structuring a program
|
||||
as independently executing components—and parallelism—executing
|
||||
@@ -3217,7 +3107,7 @@ Although the concurrency features of Go can make some problems easy
|
||||
to structure as parallel computations, Go is a concurrent language,
|
||||
not a parallel one, and not all parallelization problems fit Go's model.
|
||||
For a discussion of the distinction, see the talk cited in
|
||||
<a href="//blog.golang.org/2013/01/concurrency-is-not-parallelism.html">this
|
||||
<a href="http://blog.golang.org/2013/01/concurrency-is-not-parallelism.html">this
|
||||
blog post</a>.
|
||||
|
||||
<h3 id="leaky_buffer">A leaky buffer</h3>
|
||||
@@ -3290,18 +3180,9 @@ the garbage collector for bookkeeping.
|
||||
|
||||
<p>
|
||||
Library routines must often return some sort of error indication to
|
||||
the caller.
|
||||
As mentioned earlier, Go's multivalue return makes it
|
||||
the caller. As mentioned earlier, Go's multivalue return makes it
|
||||
easy to return a detailed error description alongside the normal
|
||||
return value.
|
||||
It is good style to use this feature to provide detailed error information.
|
||||
For example, as we'll see, <code>os.Open</code> doesn't
|
||||
just return a <code>nil</code> pointer on failure, it also returns an
|
||||
error value that describes what went wrong.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
By convention, errors have type <code>error</code>,
|
||||
return value. By convention, errors have type <code>error</code>,
|
||||
a simple built-in interface.
|
||||
</p>
|
||||
<pre>
|
||||
@@ -3313,12 +3194,7 @@ type error interface {
|
||||
A library writer is free to implement this interface with a
|
||||
richer model under the covers, making it possible not only
|
||||
to see the error but also to provide some context.
|
||||
As mentioned, alongside the usual <code>*os.File</code>
|
||||
return value, <code>os.Open</code> also returns an
|
||||
error value.
|
||||
If the file is opened successfully, the error will be <code>nil</code>,
|
||||
but when there is a problem, it will hold an
|
||||
<code>os.PathError</code>:
|
||||
For example, <code>os.Open</code> returns an <code>os.PathError</code>.
|
||||
</p>
|
||||
<pre>
|
||||
// PathError records an error and the operation and
|
||||
@@ -3378,7 +3254,7 @@ for try := 0; try < 2; try++ {
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The second <code>if</code> statement here is another <a href="#interface_conversions">type assertion</a>.
|
||||
The second <code>if</code> statement here is another <a href="#interface_conversion">type assertion</a>.
|
||||
If it fails, <code>ok</code> will be false, and <code>e</code>
|
||||
will be <code>nil</code>.
|
||||
If it succeeds, <code>ok</code> will be true, which means the
|
||||
@@ -3561,7 +3437,7 @@ the parse stack by hand:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
if pos == 0 {
|
||||
if pos==0 {
|
||||
re.error("'*' illegal at start of expression")
|
||||
}
|
||||
</pre>
|
||||
@@ -3664,3 +3540,4 @@ var _ image.Color = Black
|
||||
var _ image.Image = Black
|
||||
</pre>
|
||||
-->
|
||||
|
||||
|
||||
@@ -10,10 +10,6 @@ For information on contributing to parts of Go other than gccgo,
|
||||
see <a href="/doc/contribute.html">Contributing to the Go project</a>. For
|
||||
information on building gccgo for yourself,
|
||||
see <a href="/doc/gccgo_install.html">Setting up and using gccgo</a>.
|
||||
For more of the gritty details on the process of doing development
|
||||
with the gccgo frontend,
|
||||
see <a href="https://go.googlesource.com/gofrontend/+/master/HACKING">the
|
||||
file HACKING</a> in the gofrontend repository.
|
||||
</p>
|
||||
|
||||
<h2>Legal Prerequisites</h2>
|
||||
@@ -30,9 +26,7 @@ contribution rules</a>.
|
||||
|
||||
<p>
|
||||
The master sources for the gccgo frontend may be found at
|
||||
<a href="http://go.googlesource.com/gofrontend">http://go.googlesource.com/gofrontend</a>.
|
||||
They are mirrored
|
||||
at <a href="http://github.com/golang/gofrontend">http://github.com/golang/gofrontend</a>.
|
||||
<a href="http://code.google.com/p/gofrontend">http://code.google.com/p/gofrontend</a>.
|
||||
The master sources are not buildable by themselves, but only in
|
||||
conjunction with GCC (in the future, other compilers may be
|
||||
supported). Changes made to the gccgo frontend are also applied to
|
||||
@@ -42,7 +36,7 @@ is mirrored to the <code>gcc/go/gofrontend</code> directory in the GCC
|
||||
repository, and the <code>gofrontend</code> <code>libgo</code>
|
||||
directory is mirrored to the GCC <code>libgo</code> directory. In
|
||||
addition, the <code>test</code> directory
|
||||
from <a href="//go.googlesource.com/go">the main Go repository</a>
|
||||
from <a href="http://code.google.com/p/go">the main Go repository</a>
|
||||
is mirrored to the <code>gcc/testsuite/go.test/test</code> directory
|
||||
in the GCC repository.
|
||||
</p>
|
||||
@@ -55,17 +49,19 @@ them.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The gccgo frontend is written in C++.
|
||||
It follows the GNU and GCC coding standards for C++.
|
||||
In writing code for the frontend, follow the formatting of the
|
||||
surrounding code.
|
||||
Almost all GCC-specific code is not in the frontend proper and is
|
||||
instead in the GCC sources in the <code>gcc/go</code> directory.
|
||||
The gccgo frontend is written in C++. It follows the GNU coding
|
||||
standards to the extent that they apply to C++. In writing code for
|
||||
the frontend, follow the formatting of the surrounding code. Although
|
||||
the frontend is currently tied to the rest of the GCC codebase, we
|
||||
plan to make it more independent. Eventually all GCC-specific code
|
||||
will migrate out of the frontend proper and into GCC proper. In the
|
||||
GCC sources this will generally mean moving code
|
||||
from <code>gcc/go/gofrontend</code> to <code>gcc/go</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The run-time library for gccgo is mostly the same as the library
|
||||
in <a href="//go.googlesource.com/go">the main Go repository</a>.
|
||||
in <a href="http://code.google.com/p/go">the main Go repository</a>.
|
||||
The library code in the Go repository is periodically merged into
|
||||
the <code>libgo/go</code> directory of the <code>gofrontend</code> and
|
||||
then the GCC repositories, using the shell
|
||||
@@ -73,7 +69,7 @@ script <code>libgo/merge.sh</code>. Accordingly, most library changes
|
||||
should be made in the main Go repository. The files outside
|
||||
of <code>libgo/go</code> are gccgo-specific; that said, some of the
|
||||
files in <code>libgo/runtime</code> are based on files
|
||||
in <code>src/runtime</code> in the main Go repository.
|
||||
in <code>src/pkg/runtime</code> in the main Go repository.
|
||||
</p>
|
||||
|
||||
<h2>Testing</h2>
|
||||
@@ -105,7 +101,7 @@ or <code>gcc/testsuite/go.dg</code> directories in the GCC repository.
|
||||
<p>
|
||||
Changes to the Go frontend should follow the same process as for the
|
||||
main Go repository, only for the <code>gofrontend</code> project and
|
||||
the <code>gofrontend-dev@googlegroups.com</code> mailing list
|
||||
the<code>gofrontend-dev@googlegroups.com</code> mailing list
|
||||
rather than the <code>go</code> project and the
|
||||
<code>golang-dev@googlegroups.com</code> mailing list. Those changes
|
||||
will then be merged into the GCC sources.
|
||||
|
||||
@@ -32,37 +32,10 @@ will include Go support.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GCC 4.7.1 release and all later 4.7 releases include a complete
|
||||
<a href="/doc/go1.html">Go 1</a> compiler and libraries.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Due to timing, the GCC 4.8.0 and 4.8.1 releases are close to but not
|
||||
identical to Go 1.1. The GCC 4.8.2 release includes a complete Go
|
||||
1.1.2 implementation.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GCC 4.9 releases include a complete Go 1.2 implementation.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GCC 5 releases include a complete implementation of the Go 1.4
|
||||
user libraries. The Go 1.4 runtime is not fully merged, but that
|
||||
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 are expected to include a complete implementation
|
||||
of the Go 1.8 user libraries. As with earlier releases, the Go 1.8
|
||||
runtime is not fully merged, but that should not be visible to Go
|
||||
programs.
|
||||
The GCC 4.7.0 release includes Go support that is very close to
|
||||
<a href="/doc/go1.html">Go 1</a>. Due to release timing it will not
|
||||
include the last few changes to the Go 1 libraries. The GCC 4.7.1
|
||||
release should include a complete Go 1 compiler and libraries.
|
||||
</p>
|
||||
|
||||
<h2 id="Source_code">Source code</h2>
|
||||
@@ -152,8 +125,6 @@ described on
|
||||
the <a href="http://gcc.gnu.org/install/prerequisites.html">gcc web
|
||||
site</a>. It is important to install all the prerequisites before
|
||||
running the gcc <code>configure</code> script.
|
||||
The prerequisite libraries can be conveniently downloaded using the
|
||||
script <code>contrib/download_prerequisites</code> in the GCC sources.
|
||||
|
||||
<h3 id="Build_commands">Build commands</h3>
|
||||
|
||||
@@ -173,13 +144,33 @@ make
|
||||
make install
|
||||
</pre>
|
||||
|
||||
<h3 id="Ubuntu">A note on Ubuntu</h3>
|
||||
|
||||
<p>
|
||||
Current versions of Ubuntu and current versions of gcc disagree on
|
||||
where system libraries and header files are found. This is not a
|
||||
gccgo issue, and we hope this will be resolved soon. Until it is,
|
||||
setting these environment variables while configuring and building
|
||||
gccgo may fix the problem.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
|
||||
C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
|
||||
CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
|
||||
export LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH
|
||||
</pre>
|
||||
|
||||
<h2 id="Using_gccgo">Using gccgo</h2>
|
||||
|
||||
<p>
|
||||
The gccgo compiler works like other gcc frontends. As of GCC 5 the gccgo
|
||||
installation also includes a version of the <code>go</code> command,
|
||||
which may be used to build Go programs as described at
|
||||
<a href="https://golang.org/cmd/go">https://golang.org/cmd/go</a>.
|
||||
The gccgo compiler works like other gcc frontends. The gccgo
|
||||
installation does not currently include a version of
|
||||
the <code>go</code> command. However if you have the <code>go</code>
|
||||
command from an installation of the <code>gc</code> compiler, you can
|
||||
use it with gccgo by passing the option <code>-compiler gccgo</code>
|
||||
to <code>go build</code> or <code>go install</code> or <code>go
|
||||
test</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -231,14 +222,13 @@ name the directory where <code>libgo.so</code> is found.
|
||||
|
||||
<li>
|
||||
<p>
|
||||
Passing a <code>-Wl,-R</code> option when you link (replace lib with
|
||||
lib64 if appropriate for your system):
|
||||
Passing a <code>-Wl,-R</code> option when you link:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
go build -gccgoflags -Wl,-R,${prefix}/lib/gcc/MACHINE/VERSION
|
||||
[or]
|
||||
gccgo -o file file.o -Wl,-R,${prefix}/lib/gcc/MACHINE/VERSION
|
||||
[or]
|
||||
gccgo -o file file.o -Wl,-R,${prefix}/lib64/gcc/MACHINE/VERSION
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
@@ -266,33 +256,27 @@ and <code>-g</code> options.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>-fgo-pkgpath=PKGPATH</code> option may be used to set a
|
||||
unique prefix for the package being compiled.
|
||||
This option is automatically used by the go command, but you may want
|
||||
to use it if you invoke gccgo directly.
|
||||
This option is intended for use with large
|
||||
programs that contain many packages, in order to allow multiple
|
||||
packages to use the same identifier as the package name.
|
||||
The <code>PKGPATH</code> may be any string; a good choice for the
|
||||
string is the path used to import the package.
|
||||
The <code>-fgo-prefix=PREFIX</code> option may be used to set a unique
|
||||
prefix for the package being compiled. This option is intended for
|
||||
use with large programs that contain many packages, in order to allow
|
||||
multiple packages to use the same identifier as the package name.
|
||||
The <code>PREFIX</code> may be any string; a good choice for the
|
||||
string is the directory where the package will be installed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>-I</code> and <code>-L</code> options, which are synonyms
|
||||
for the compiler, may be used to set the search path for finding
|
||||
imports.
|
||||
These options are not needed if you build with the go command.
|
||||
</p>
|
||||
|
||||
<h2 id="Imports">Imports</h2>
|
||||
|
||||
<p>
|
||||
When you compile a file that exports something, the export
|
||||
information will be stored directly in the object file.
|
||||
If you build with gccgo directly, rather than with the go command,
|
||||
then when you import a package, you must tell gccgo how to find the
|
||||
file.
|
||||
</p>
|
||||
information will be stored directly in the object file. When
|
||||
you import a package, you must tell gccgo how to
|
||||
find the file.
|
||||
|
||||
<p>
|
||||
When you import the package <var>FILE</var> with gccgo,
|
||||
@@ -301,9 +285,9 @@ first one that it finds.
|
||||
|
||||
<ul>
|
||||
<li><code><var>FILE</var>.gox</code>
|
||||
<li><code><var>FILE</var>.o</code>
|
||||
<li><code>lib<var>FILE</var>.so</code>
|
||||
<li><code>lib<var>FILE</var>.a</code>
|
||||
<li><code><var>FILE</var>.o</code>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
@@ -325,10 +309,9 @@ gccgo. Both options take directories to search. The
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The gccgo compiler does not currently (2015-06-15) record
|
||||
The gccgo compiler does not currently (2012-03-20) record
|
||||
the file name of imported packages in the object file. You must
|
||||
arrange for the imported data to be linked into the program.
|
||||
Again, this is not necessary when building with the go command.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -360,15 +343,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>
|
||||
@@ -379,7 +359,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>
|
||||
|
||||
@@ -399,29 +379,29 @@ 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>
|
||||
|
||||
<p>
|
||||
The type of a Go function is a pointer to a struct (this is
|
||||
<b style="color: red;">subject to change</b>). The first field in the
|
||||
struct points to the code of the function, which will be equivalent to
|
||||
a pointer to a C function whose parameter types are equivalent, with
|
||||
an additional trailing parameter. The trailing parameter is the
|
||||
closure, and the argument to pass is a pointer to the Go function
|
||||
struct.
|
||||
|
||||
When a Go function returns more than one value, the C function returns
|
||||
a struct. For example, these functions are roughly equivalent:
|
||||
The type of a Go function with no receiver is equivalent to a C function
|
||||
whose parameter types are equivalent. When a Go function returns more
|
||||
than one value, the C function returns a struct. For example, these
|
||||
functions have equivalent types:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
func GoFunction(int) (int, float64)
|
||||
struct { int i; float64 f; } CFunction(int, void*)
|
||||
struct { int i; float64 f; } CFunction(int)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
A pointer to a Go function is equivalent to a pointer to a C function
|
||||
when the functions have equivalent types (this is
|
||||
<b style="color: red;">subject to change</b>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go <code>interface</code>, <code>channel</code>, and <code>map</code>
|
||||
types have no corresponding C type (<code>interface</code> is a
|
||||
@@ -477,14 +457,6 @@ i := c_open(&name[0], syscall.O_RDONLY, 0);
|
||||
<code>os.Open</code> function instead).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that if the C function can block, such as in a call
|
||||
to <code>read</code>, calling the C function may block the Go program.
|
||||
Unless you have a clear understanding of what you are doing, all calls
|
||||
between C and Go should be implemented through cgo or SWIG, as for
|
||||
the <code>gc</code> compiler.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The name of Go functions accessed from C is subject to change. At present
|
||||
the name of a Go function that does not have a receiver is
|
||||
@@ -525,3 +497,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.com/wiki/index.php/GCCGoRTEMS"><code>RTEMS</code> Wiki page</a>.
|
||||
|
||||
@@ -118,7 +118,7 @@ func (w *bufio.Writer, p []byte) (n int, err error) {
|
||||
<h3 id="return">Return requirements</h3>
|
||||
|
||||
<p>
|
||||
Before Go 1.1, a function that returned a value needed an explicit "return"
|
||||
Before Go 1.1, a function that returned a value needed an explicit "return"
|
||||
or call to <code>panic</code> at
|
||||
the end of the function; this was a simple way to make the programmer
|
||||
be explicit about the meaning of the function. But there are many cases
|
||||
@@ -129,9 +129,9 @@ only an infinite "for" loop.
|
||||
<p>
|
||||
In Go 1.1, the rule about final "return" statements is more permissive.
|
||||
It introduces the concept of a
|
||||
<a href="/ref/spec#Terminating_statements"><em>terminating statement</em></a>,
|
||||
<a href="/ref/spec/#Terminating_statements"><em>terminating statement</em></a>,
|
||||
a statement that is guaranteed to be the last one a function executes.
|
||||
Examples include
|
||||
Examples include
|
||||
"for" loops with no condition and "if-else"
|
||||
statements in which each half ends in a "return".
|
||||
If the final statement of a function can be shown <em>syntactically</em> to
|
||||
@@ -160,7 +160,7 @@ The GCC release schedule does not coincide with the Go release schedule, so some
|
||||
The 4.8.0 version of GCC shipped in March, 2013 and includes a nearly-Go 1.1 version of <code>gccgo</code>.
|
||||
Its library is a little behind the release, but the biggest difference is that method values are not implemented.
|
||||
Sometime around July 2013, we expect 4.8.2 of GCC to ship with a <code>gccgo</code>
|
||||
providing a complete Go 1.1 implementation.
|
||||
providing a complete Go 1.1 implementaiton.
|
||||
</p>
|
||||
|
||||
<h3 id="gc_flag">Command-line flag parsing</h3>
|
||||
@@ -172,7 +172,7 @@ from the traditional Unix flag parsing. This may affect scripts that invoke
|
||||
the tool directly.
|
||||
For example,
|
||||
<code>go tool 6c -Fw -Dfoo</code> must now be written
|
||||
<code>go tool 6c -F -w -D foo</code>.
|
||||
<code>go tool 6c -F -w -D foo</code>.
|
||||
</p>
|
||||
|
||||
<h3 id="int">Size of int on 64-bit platforms</h3>
|
||||
@@ -191,13 +191,12 @@ more than 2 billion elements on 64-bit platforms.
|
||||
<em>Updating</em>:
|
||||
Most programs will be unaffected by this change.
|
||||
Because Go does not allow implicit conversions between distinct
|
||||
<a href="/ref/spec#Numeric_types">numeric types</a>,
|
||||
<a href="/ref/spec/#Numeric_types">numeric types</a>,
|
||||
no programs will stop compiling due to this change.
|
||||
However, programs that contain implicit assumptions
|
||||
that <code>int</code> is only 32 bits may change behavior.
|
||||
For example, this code prints a positive number on 64-bit systems and
|
||||
a negative one on 32-bit systems:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
x := ^uint32(0) // x is 0xffffffff
|
||||
@@ -295,7 +294,7 @@ variable, where at least one of the accesses is a write.
|
||||
This new facility is built into the <code>go</code> tool.
|
||||
For now, it is only available on Linux, Mac OS X, and Windows systems with
|
||||
64-bit x86 processors.
|
||||
To enable it, set the <code>-race</code> flag when building or testing your program
|
||||
To enable it, set the <code>-race</code> flag when building or testing your program
|
||||
(for instance, <code>go test -race</code>).
|
||||
The race detector is documented in <a href="/doc/articles/race_detector.html">a separate article</a>.
|
||||
</p>
|
||||
@@ -304,7 +303,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>,
|
||||
a new internal <a href="http://golang.org/s/go11func">representation of functions</a>,
|
||||
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.
|
||||
@@ -332,7 +331,7 @@ including a list of paths searched, when a package cannot be located.
|
||||
$ go build foo/quxx
|
||||
can't load package: package foo/quxx: cannot find package "foo/quxx" in any of:
|
||||
/home/you/go/src/pkg/foo/quxx (from $GOROOT)
|
||||
/home/you/src/foo/quxx (from $GOPATH)
|
||||
/home/you/src/foo/quxx (from $GOPATH)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -344,12 +343,12 @@ command, a <a href="/doc/code.html#GOPATH">valid <code>$GOPATH</code></a> is now
|
||||
|
||||
<pre>
|
||||
$ GOPATH= go get code.google.com/p/foo/quxx
|
||||
package code.google.com/p/foo/quxx: cannot download, $GOPATH not set. For more details see: go help gopath
|
||||
package code.google.com/p/foo/quxx: cannot download, $GOPATH not set. For more details see: go help gopath
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Finally, as a result of the previous change, the <code>go get</code> command will also fail
|
||||
when <code>$GOPATH</code> and <code>$GOROOT</code> are set to the same value.
|
||||
when <code>$GOPATH</code> and <code>$GOROOT</code> are set to the same value.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -428,7 +427,7 @@ To build a file only with Go 1.0.x, use the converse constraint:
|
||||
|
||||
<p>
|
||||
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>netbsd/386</code>, <code>netbsd/amd64</code>, <code>netbsd/arm</code>,
|
||||
<code>openbsd/386</code> and <code>openbsd/amd64</code> platforms.
|
||||
</p>
|
||||
|
||||
@@ -547,7 +546,7 @@ The Go 1.1 implementation instead returns a
|
||||
to allow reading and writing
|
||||
with its
|
||||
<a href="/pkg/net/#UnixConn.ReadFrom"><code>ReadFrom</code></a>
|
||||
and
|
||||
and
|
||||
<a href="/pkg/net/#UnixConn.WriteTo"><code>WriteTo</code></a>
|
||||
methods.
|
||||
</p>
|
||||
@@ -666,7 +665,6 @@ This function addresses a common source of confusion in the time API.
|
||||
<em>Updating</em>:
|
||||
Code that needs to read and write times using an external format with
|
||||
lower precision should be modified to use the new methods.
|
||||
</p>
|
||||
|
||||
<h3 id="exp_old">Exp and old subtrees moved to go.exp and go.text subrepositories</h3>
|
||||
|
||||
@@ -734,7 +732,7 @@ See the relevant package documentation for more information about each change.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<li>
|
||||
The <a href="/pkg/bytes/"><code>bytes</code></a> package has two new functions,
|
||||
<a href="/pkg/bytes/#TrimPrefix"><code>TrimPrefix</code></a>
|
||||
and
|
||||
@@ -747,7 +745,7 @@ provides some control over memory allocation inside the buffer.
|
||||
Finally, the
|
||||
<a href="/pkg/bytes/#Reader"><code>Reader</code></a> type now has a
|
||||
<a href="/pkg/strings/#Reader.WriteTo"><code>WriteTo</code></a> method
|
||||
so it implements the
|
||||
so it implements the
|
||||
<a href="/pkg/io/#WriterTo"><code>io.WriterTo</code></a> interface.
|
||||
</li>
|
||||
|
||||
@@ -774,7 +772,7 @@ and a new function
|
||||
|
||||
<li>
|
||||
The <a href="/pkg/database/sql/"><code>database/sql</code></a> package
|
||||
has a new
|
||||
has a new
|
||||
<a href="/pkg/database/sql/#DB.Ping"><code>Ping</code></a>
|
||||
method for its
|
||||
<a href="/pkg/database/sql/#DB"><code>DB</code></a>
|
||||
@@ -924,11 +922,11 @@ The <a href="/pkg/net/"><code>net</code></a> package adds
|
||||
</li>
|
||||
|
||||
<li>
|
||||
The <a href="/pkg/net/"><code>net</code></a> package adds protocol-specific
|
||||
The <a href="/pkg/net/"><code>net</code></a> package adds protocol-specific
|
||||
packet reading and writing methods to
|
||||
<a href="/pkg/net/#IPConn"><code>IPConn</code></a>
|
||||
(<a href="/pkg/net/#IPConn.ReadMsgIP"><code>ReadMsgIP</code></a>
|
||||
and <a href="/pkg/net/#IPConn.WriteMsgIP"><code>WriteMsgIP</code></a>) and
|
||||
and <a href="/pkg/net/#IPConn.WriteMsgIP"><code>WriteMsgIP</code></a>) and
|
||||
<a href="/pkg/net/#UDPConn"><code>UDPConn</code></a>
|
||||
(<a href="/pkg/net/#UDPConn.ReadMsgUDP"><code>ReadMsgUDP</code></a> and
|
||||
<a href="/pkg/net/#UDPConn.WriteMsgUDP"><code>WriteMsgUDP</code></a>).
|
||||
@@ -936,15 +934,15 @@ These are specialized versions of <a href="/pkg/net/#PacketConn"><code>PacketCon
|
||||
<code>ReadFrom</code> and <code>WriteTo</code> methods that provide access to out-of-band data associated
|
||||
with the packets.
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
The <a href="/pkg/net/"><code>net</code></a> package adds methods to
|
||||
<a href="/pkg/net/#UnixConn"><code>UnixConn</code></a> to allow closing half of the connection
|
||||
<a href="/pkg/net/#UnixConn"><code>UnixConn</code></a> to allow closing half of the connection
|
||||
(<a href="/pkg/net/#UnixConn.CloseRead"><code>CloseRead</code></a> and
|
||||
<a href="/pkg/net/#UnixConn.CloseWrite"><code>CloseWrite</code></a>),
|
||||
matching the existing methods of <a href="/pkg/net/#TCPConn"><code>TCPConn</code></a>.
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
The <a href="/pkg/net/http/"><code>net/http</code></a> package includes several new additions.
|
||||
<a href="/pkg/net/http/#ParseTime"><code>ParseTime</code></a> parses a time string, trying
|
||||
@@ -1022,7 +1020,7 @@ including disabling it altogether.
|
||||
<li>
|
||||
The <a href="/pkg/sort/"><code>sort</code></a> package has a new function,
|
||||
<a href="/pkg/sort/#Reverse"><code>Reverse</code></a>.
|
||||
Wrapping the argument of a call to
|
||||
Wrapping the argument of a call to
|
||||
<a href="/pkg/sort/#Sort"><code>sort.Sort</code></a>
|
||||
with a call to <code>Reverse</code> causes the sort order to be reversed.
|
||||
</li>
|
||||
|
||||