mirror of
https://github.com/golang/go.git
synced 2026-01-30 15:42:04 +03:00
Compare commits
131 Commits
dev.inline
...
go1.17.12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ed3c127da | ||
|
|
cd54600b86 | ||
|
|
76f8b7304d | ||
|
|
8c1d8c8362 | ||
|
|
0117dee7dc | ||
|
|
ba8788ebce | ||
|
|
2678d0c957 | ||
|
|
58facfbe7d | ||
|
|
ed2f33e1a7 | ||
|
|
d13431c37a | ||
|
|
ae2dfcc1c8 | ||
|
|
fc07039e23 | ||
|
|
9ef614f5aa | ||
|
|
b1be664d64 | ||
|
|
77cc1c0def | ||
|
|
8d2935ab7c | ||
|
|
651a8d81ba | ||
|
|
26cdea3acc | ||
|
|
4c69fd51a9 | ||
|
|
909881db03 | ||
|
|
03c2e56f68 | ||
|
|
c15a8e2dbb | ||
|
|
590b53fac9 | ||
|
|
2be03d789d | ||
|
|
65701ad2b4 | ||
|
|
e846f3f2d6 | ||
|
|
a9003376d5 | ||
|
|
0e7138a102 | ||
|
|
085c61ae51 | ||
|
|
f7209f904d | ||
|
|
5b45e19a53 | ||
|
|
feec92c423 | ||
|
|
04781d14d2 | ||
|
|
4c5acd4b57 | ||
|
|
78992411de | ||
|
|
2150be1a9b | ||
|
|
9511f6deb6 | ||
|
|
0fdca725c7 | ||
|
|
346b18ee9d | ||
|
|
2116d60993 | ||
|
|
7139e8b024 | ||
|
|
eb75219438 | ||
|
|
4e69fddc64 | ||
|
|
efed283e79 | ||
|
|
88be85f18b | ||
|
|
7dd10d4ce2 | ||
|
|
7f04645b7a | ||
|
|
7d8fa65789 | ||
|
|
1ba25fa288 | ||
|
|
7d70adf3f5 | ||
|
|
ac071634c4 | ||
|
|
cd6e0d7cad | ||
|
|
6a70ee2873 | ||
|
|
1952c65f9a | ||
|
|
4a31565cc0 | ||
|
|
e163319023 | ||
|
|
fbcc30a2c9 | ||
|
|
acb1ce53f9 | ||
|
|
1651426f77 | ||
|
|
17e179e187 | ||
|
|
faa04090f8 | ||
|
|
1b867ce3ef | ||
|
|
539d430efb | ||
|
|
3a34273b8a | ||
|
|
9de1ac6ac2 | ||
|
|
dbdf055101 | ||
|
|
ab70d7c799 | ||
|
|
1242f430a9 | ||
|
|
59f1a26262 | ||
|
|
ebd1b4d97d | ||
|
|
0aa7f8fd4d | ||
|
|
4223f6eb23 | ||
|
|
de690c2ff8 | ||
|
|
48d948963c | ||
|
|
65633fee16 | ||
|
|
e46abcb816 | ||
|
|
61317ef99e | ||
|
|
0f2d0d0694 | ||
|
|
759a9211d4 | ||
|
|
01779135c0 | ||
|
|
66007e5cfc | ||
|
|
3c50f27391 | ||
|
|
ab175939e2 | ||
|
|
f0ee7c6f96 | ||
|
|
b7651e5046 | ||
|
|
4eaf0b7a58 | ||
|
|
4536558f16 | ||
|
|
e347c89598 | ||
|
|
1c05b9b024 | ||
|
|
364f15ff9f | ||
|
|
b954f58e9d | ||
|
|
f1935e2c43 | ||
|
|
f58c78a577 | ||
|
|
b212ba6829 | ||
|
|
f9cb33c7c9 | ||
|
|
4a842985bf | ||
|
|
f6f024f120 | ||
|
|
18b970277e | ||
|
|
91aa2f190a | ||
|
|
8bdb0b235a | ||
|
|
3a03ddf735 | ||
|
|
644555d34e | ||
|
|
11b64b428b | ||
|
|
2ac3bdf378 | ||
|
|
4925e0766f | ||
|
|
b18ba59aaf | ||
|
|
04242ac88f | ||
|
|
c5c1d069da | ||
|
|
abc4f092ac | ||
|
|
e79c297fa8 | ||
|
|
21a4e67ad5 | ||
|
|
328cf2e8b2 | ||
|
|
fcce86c4cf | ||
|
|
36c171763e | ||
|
|
678b07d5e5 | ||
|
|
14c9b1e00b | ||
|
|
c35f8a37d9 | ||
|
|
47a57bc4f0 | ||
|
|
2d97a87287 | ||
|
|
3969694203 | ||
|
|
1dd24caf08 | ||
|
|
ec5170397c | ||
|
|
fdd6dfd507 | ||
|
|
f7b9470992 | ||
|
|
4397d66bdd | ||
|
|
eb5a7b5050 | ||
|
|
72ab3ff68b | ||
|
|
c3ccb77d1e | ||
|
|
c3b47cb598 | ||
|
|
ddfd72f7d1 | ||
|
|
d6f4d9a2be |
38
.github/ISSUE_TEMPLATE
vendored
Normal file
38
.github/ISSUE_TEMPLATE
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<!--
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
|
||||
-->
|
||||
|
||||
### What version of Go are you using (`go version`)?
|
||||
|
||||
<pre>
|
||||
$ go version
|
||||
|
||||
</pre>
|
||||
|
||||
### Does this issue reproduce with the latest release?
|
||||
|
||||
|
||||
|
||||
### What operating system and processor architecture are you using (`go env`)?
|
||||
|
||||
<details><summary><code>go env</code> Output</summary><br><pre>
|
||||
$ go env
|
||||
|
||||
</pre></details>
|
||||
|
||||
### What did you do?
|
||||
|
||||
<!--
|
||||
If possible, provide a recipe for reproducing the error.
|
||||
A complete runnable program is good.
|
||||
A link on play.golang.org is best.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### What did you expect to see?
|
||||
|
||||
|
||||
|
||||
### What did you see instead?
|
||||
45
.github/ISSUE_TEMPLATE/00-bug.md
vendored
45
.github/ISSUE_TEMPLATE/00-bug.md
vendored
@@ -1,45 +0,0 @@
|
||||
---
|
||||
name: Bugs
|
||||
about: The go command, standard library, or anything else
|
||||
title: "affected/package: "
|
||||
---
|
||||
|
||||
<!--
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
-->
|
||||
|
||||
### What version of Go are you using (`go version`)?
|
||||
|
||||
<pre>
|
||||
$ go version
|
||||
|
||||
</pre>
|
||||
|
||||
### Does this issue reproduce with the latest release?
|
||||
|
||||
|
||||
|
||||
### What operating system and processor architecture are you using (`go env`)?
|
||||
|
||||
<details><summary><code>go env</code> Output</summary><br><pre>
|
||||
$ go env
|
||||
|
||||
</pre></details>
|
||||
|
||||
### What did you do?
|
||||
|
||||
<!--
|
||||
If possible, provide a recipe for reproducing the error.
|
||||
A complete runnable program is good.
|
||||
A link on go.dev/play is best.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### What did you expect to see?
|
||||
|
||||
|
||||
|
||||
### What did you see instead?
|
||||
|
||||
|
||||
49
.github/ISSUE_TEMPLATE/01-pkgsite.md
vendored
49
.github/ISSUE_TEMPLATE/01-pkgsite.md
vendored
@@ -1,49 +0,0 @@
|
||||
---
|
||||
name: Pkg.go.dev bugs or feature requests
|
||||
about: Issues or feature requests for the documentation site
|
||||
title: "x/pkgsite: "
|
||||
labels: pkgsite
|
||||
---
|
||||
|
||||
<!--
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
-->
|
||||
|
||||
### What is the URL of the page with the issue?
|
||||
|
||||
|
||||
|
||||
### What is your user agent?
|
||||
|
||||
<!--
|
||||
You can find your user agent here:
|
||||
https://www.google.com/search?q=what+is+my+user+agent
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### Screenshot
|
||||
|
||||
<!--
|
||||
Please paste a screenshot of the page.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### What did you do?
|
||||
|
||||
<!--
|
||||
If possible, provide a recipe for reproducing the error.
|
||||
|
||||
Starting with a Private/Incognito tab/window may help rule out problematic browser extensions.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### What did you expect to see?
|
||||
|
||||
|
||||
|
||||
### What did you see instead?
|
||||
|
||||
|
||||
39
.github/ISSUE_TEMPLATE/02-pkgsite-removal.md
vendored
39
.github/ISSUE_TEMPLATE/02-pkgsite-removal.md
vendored
@@ -1,39 +0,0 @@
|
||||
---
|
||||
name: Pkg.go.dev package removal request
|
||||
about: Request a package be removed from the documentation site (pkg.go.dev)
|
||||
title: "x/pkgsite: package removal request for [type path here]"
|
||||
labels: pkgsite/package-removal
|
||||
---
|
||||
|
||||
<!--
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
-->
|
||||
|
||||
### What is the path of the package that you would like to have removed?
|
||||
|
||||
<!---
|
||||
We can remove packages with a shared path prefix.
|
||||
For example, a request for "github.com/author" would remove all pkg.go.dev pages with that package path prefix.
|
||||
--->
|
||||
|
||||
|
||||
|
||||
### Are you the owner of this package?
|
||||
|
||||
<!---
|
||||
Only the package owners can request to have their packages removed from pkg.go.dev.
|
||||
--->
|
||||
|
||||
|
||||
|
||||
### What is the reason that you could not retract this package instead?
|
||||
|
||||
<!---
|
||||
If you would like to have your module removed from pkg.go.dev, we recommend that you retract them, so that they can be removed from the go command and proxy.golang.org as well.
|
||||
|
||||
Retracting a module version involves adding a retract directive to your go.mod file and publishing a new version. For example: https://github.com/jba/retract-demo/blob/main/go.mod#L5-L8
|
||||
|
||||
See https://pkg.go.dev/about#removing-a-package for additional tips on retractions.
|
||||
--->
|
||||
|
||||
|
||||
61
.github/ISSUE_TEMPLATE/03-gopls.md
vendored
61
.github/ISSUE_TEMPLATE/03-gopls.md
vendored
@@ -1,61 +0,0 @@
|
||||
---
|
||||
name: Gopls bugs or feature requests
|
||||
about: Issues or feature requests for the Go language server (gopls)
|
||||
title: "x/tools/gopls: "
|
||||
labels: gopls Tools
|
||||
---
|
||||
|
||||
<!--
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
-->
|
||||
|
||||
### gopls version
|
||||
|
||||
<!--
|
||||
Output of `gopls -v version` on the command line
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### go env
|
||||
|
||||
<!--
|
||||
Output of `go env` on the command line in your workspace directory
|
||||
-->
|
||||
|
||||
|
||||
### What did you do?
|
||||
|
||||
<!--
|
||||
If possible, provide a recipe for reproducing the error.
|
||||
A complete runnable program is good.
|
||||
A link on go.dev/play is better.
|
||||
A failing unit test is the best.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### What did you expect to see?
|
||||
|
||||
|
||||
|
||||
### What did you see instead?
|
||||
|
||||
|
||||
|
||||
### Editor and settings
|
||||
|
||||
<!--
|
||||
Your editor and any settings you have configured (for example, your VSCode settings.json file)
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### Logs
|
||||
|
||||
<!--
|
||||
If possible please include gopls logs. Instructions for capturing them can be found here:
|
||||
https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capture-logs
|
||||
-->
|
||||
|
||||
|
||||
51
.github/ISSUE_TEMPLATE/04-vuln.md
vendored
51
.github/ISSUE_TEMPLATE/04-vuln.md
vendored
@@ -1,51 +0,0 @@
|
||||
---
|
||||
name: Go vulnerability management - bugs and feature requests
|
||||
about: Issues or feature requests about Go vulnerability management
|
||||
title: "x/vuln: "
|
||||
labels: "vulncheck or vulndb"
|
||||
---
|
||||
|
||||
<!--
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
|
||||
To add a new vulnerability to the Go vulnerability database
|
||||
(https://vuln.go.dev), see https://go.dev/s/vulndb-report-new.
|
||||
|
||||
To report an issue about a report, see https://go.dev/s/vulndb-report-feedback.
|
||||
-->
|
||||
|
||||
### What version of Go are you using (`go version`)?
|
||||
|
||||
<pre>
|
||||
$ go version
|
||||
|
||||
</pre>
|
||||
|
||||
### Does this issue reproduce at the latest version of golang.org/x/vuln?
|
||||
|
||||
|
||||
|
||||
### What operating system and processor architecture are you using (`go env`)?
|
||||
|
||||
<details><summary><code>go env</code> Output</summary><br><pre>
|
||||
$ go env
|
||||
|
||||
</pre></details>
|
||||
|
||||
### What did you do?
|
||||
|
||||
<!--
|
||||
If possible, provide a recipe for reproducing the error.
|
||||
A complete runnable program is good.
|
||||
A link on go.dev/play is best.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### What did you expect to see?
|
||||
|
||||
|
||||
|
||||
### What did you see instead?
|
||||
|
||||
|
||||
13
.github/ISSUE_TEMPLATE/10-proposal.md
vendored
13
.github/ISSUE_TEMPLATE/10-proposal.md
vendored
@@ -1,13 +0,0 @@
|
||||
---
|
||||
name: Proposals
|
||||
about: New external API or other notable changes
|
||||
title: "proposal: affected/package: "
|
||||
labels: Proposal
|
||||
---
|
||||
|
||||
<!--
|
||||
Our proposal process is documented here:
|
||||
https://go.dev/s/proposal-process
|
||||
-->
|
||||
|
||||
|
||||
52
.github/ISSUE_TEMPLATE/11-language-change.md
vendored
52
.github/ISSUE_TEMPLATE/11-language-change.md
vendored
@@ -1,52 +0,0 @@
|
||||
---
|
||||
name: Language Change Proposals
|
||||
about: Changes to the language
|
||||
title: "proposal: Go 2: "
|
||||
labels: Proposal Go2 LanguageChange
|
||||
---
|
||||
|
||||
<!--
|
||||
Our process for evaluating language changes can be found here:
|
||||
https://go.googlesource.com/proposal/+/refs/heads/master#language-changes
|
||||
-->
|
||||
|
||||
### Author background
|
||||
|
||||
- **Would you consider yourself a novice, intermediate, or experienced Go programmer?**
|
||||
- **What other languages do you have experience with?**
|
||||
|
||||
### Related proposals
|
||||
|
||||
- **Has this idea, or one like it, been proposed before?**
|
||||
- **If so, how does this proposal differ?**
|
||||
- **Does this affect error handling?**
|
||||
- **If so, how does this differ from previous error handling proposals?**
|
||||
- **Is this about generics?**
|
||||
- **If so, how does this relate to the accepted design and other generics proposals?**
|
||||
|
||||
### Proposal
|
||||
|
||||
- **What is the proposed change?**
|
||||
- **Who does this proposal help, and why?**
|
||||
- **Please describe as precisely as possible the change to the language.**
|
||||
- **What would change in the language spec?**
|
||||
- **Please also describe the change informally, as in a class teaching Go.**
|
||||
- **Is this change backward compatible?**
|
||||
- Breaking the Go 1 compatibility guarantee is a large cost and requires a large benefit.
|
||||
Show example code before and after the change.
|
||||
- **Before**
|
||||
- **After**
|
||||
- **Orthogonality: how does this change interact or overlap with existing features?**
|
||||
- **Is the goal of this change a performance improvement?**
|
||||
- **If so, what quantifiable improvement should we expect?**
|
||||
- **How would we measure it?**
|
||||
|
||||
### Costs
|
||||
|
||||
- **Would this change make Go easier or harder to learn, and why?**
|
||||
- **What is the cost of this proposal? (Every language change has a cost).**
|
||||
- **How many tools (such as vet, gopls, gofmt, goimports, etc.) would be affected?**
|
||||
- **What is the compile time cost?**
|
||||
- **What is the run time cost?**
|
||||
- **Can you describe a possible implementation?**
|
||||
- **Do you have a prototype? (This is not required.)**
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Questions
|
||||
about: Please use one of the forums for questions or general discussions
|
||||
url: https://go.dev/wiki/Questions
|
||||
4
.github/SUPPORT.md
vendored
4
.github/SUPPORT.md
vendored
@@ -1,5 +1,5 @@
|
||||
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://go.dev/s/proposal-process).
|
||||
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:
|
||||
|
||||
@@ -11,4 +11,4 @@ For asking questions, see:
|
||||
|
||||
* [Stack Overflow](https://stackoverflow.com/questions/tagged/go) with questions tagged "go"
|
||||
|
||||
* **IRC** channel #go-nuts on Libera
|
||||
* **IRC** channel #go-nuts on Freenode
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -33,13 +33,13 @@ _testmain.go
|
||||
/src/cmd/cgo/zdefaultcc.go
|
||||
/src/cmd/dist/dist
|
||||
/src/cmd/go/internal/cfg/zdefaultcc.go
|
||||
/src/cmd/go/internal/cfg/zosarch.go
|
||||
/src/cmd/internal/objabi/zbootstrap.go
|
||||
/src/go/build/zcgo.go
|
||||
/src/go/doc/headscan
|
||||
/src/internal/buildcfg/zbootstrap.go
|
||||
/src/runtime/internal/sys/zversion.go
|
||||
/src/unicode/maketables
|
||||
/src/time/tzdata/zzipdata.go
|
||||
/test.out
|
||||
/test/garbage/*.out
|
||||
/test/pass.out
|
||||
|
||||
@@ -24,7 +24,7 @@ Otherwise, when filing an issue, make sure to answer these five questions:
|
||||
4. What did you expect to see?
|
||||
5. What did you see instead?
|
||||
|
||||
For change proposals, see [Proposing Changes To Go](https://go.dev/s/proposal-process).
|
||||
For change proposals, see [Proposing Changes To Go](https://github.com/golang/proposal/).
|
||||
|
||||
## Contributing code
|
||||
|
||||
|
||||
2761
CONTRIBUTORS
Normal file
2761
CONTRIBUTORS
Normal file
File diff suppressed because it is too large
Load Diff
14
README.md
14
README.md
@@ -4,7 +4,7 @@ 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 4.0 Attributions license][cc4-by].*
|
||||
*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.
|
||||
@@ -16,27 +16,27 @@ BSD-style license found in the LICENSE file.
|
||||
|
||||
#### Binary Distributions
|
||||
|
||||
Official binary distributions are available at https://go.dev/dl/.
|
||||
Official binary distributions are available at https://golang.org/dl/.
|
||||
|
||||
After downloading a binary release, visit https://go.dev/doc/install
|
||||
After downloading a binary release, visit https://golang.org/doc/install
|
||||
for installation instructions.
|
||||
|
||||
#### Install From Source
|
||||
|
||||
If a binary distribution is not available for your combination of
|
||||
operating system and architecture, visit
|
||||
https://go.dev/doc/install/source
|
||||
https://golang.org/doc/install/source
|
||||
for source installation instructions.
|
||||
|
||||
### Contributing
|
||||
|
||||
Go is the work of thousands of contributors. We appreciate your help!
|
||||
|
||||
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
|
||||
To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.html.
|
||||
|
||||
Note that the Go project uses the issue tracker for bug reports and
|
||||
proposals only. See https://go.dev/wiki/Questions for a list of
|
||||
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/
|
||||
[cc4-by]: https://creativecommons.org/licenses/by/4.0/
|
||||
[cc3-by]: https://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
## Supported Versions
|
||||
|
||||
We support the past two Go releases (for example, Go 1.17.x and Go 1.18.x when Go 1.18.x is the latest stable release).
|
||||
We support the past two Go releases (for example, Go 1.12.x and Go 1.13.x).
|
||||
|
||||
See https://go.dev/wiki/Go-Release-Cycle and in particular the
|
||||
[Release Maintenance](https://go.dev/wiki/Go-Release-Cycle#release-maintenance)
|
||||
See https://golang.org/wiki/Go-Release-Cycle and in particular the
|
||||
[Release Maintenance](https://github.com/golang/go/wiki/Go-Release-Cycle#release-maintenance)
|
||||
part of that page.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
See https://go.dev/security for how to report a vulnerability.
|
||||
See https://golang.org/security for how to report a vulnerability.
|
||||
|
||||
16
api/README
16
api/README
@@ -8,16 +8,6 @@ shipped. Each file adds new lines but does not remove any.
|
||||
except.txt lists features that may disappear without breaking true
|
||||
compatibility.
|
||||
|
||||
Starting with go1.19.txt, each API feature line must end in "#nnnnn"
|
||||
giving the GitHub issue number of the proposal issue that accepted
|
||||
the new API. This helps with our end-of-cycle audit of new APIs.
|
||||
The same requirement applies to next/* (described below), which will
|
||||
become a go1.XX.txt for XX >= 19.
|
||||
|
||||
The next/ directory contains the only files intended to be mutated.
|
||||
Each file in that directory contains a list of features that may be added
|
||||
to the next release of Go. The files in this directory only affect the
|
||||
warning output from the go api tool. Each file should be named
|
||||
nnnnn.txt, after the issue number for the accepted proposal.
|
||||
(The #nnnnn suffix must also appear at the end of each line in the file;
|
||||
that will be preserved when next/*.txt is concatenated into go1.XX.txt.)
|
||||
next.txt is the only file intended to be mutated. It's a list of
|
||||
features that may be added to the next version. It only affects
|
||||
warning output from the go api tool.
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
pkg crypto/tls, type ConnectionState struct, TLSUnique //deprecated
|
||||
pkg debug/elf, const R_PPC64_SECTOFF_LO_DS = 61
|
||||
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
|
||||
pkg math, const MaxFloat64 = 1.79769e+308 // 179769313486231570814527423731704356798100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
pkg math, const SmallestNonzeroFloat32 = 1.4013e-45 // 17516230804060213386546619791123951641/12500000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
@@ -494,7 +492,6 @@ pkg syscall (windows-amd64), type CertRevocationInfo struct, OidSpecificInfo uin
|
||||
pkg syscall (windows-amd64), type CertSimpleChain struct, TrustListInfo uintptr
|
||||
pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [96]int8
|
||||
pkg testing, func MainStart(func(string, string) (bool, error), []InternalTest, []InternalBenchmark, []InternalExample) *M
|
||||
pkg testing, func MainStart(testDeps, []InternalTest, []InternalBenchmark, []InternalExample) *M
|
||||
pkg testing, func RegisterCover(Cover)
|
||||
pkg text/scanner, const GoTokens = 1012
|
||||
pkg text/template/parse, type DotNode bool
|
||||
@@ -502,99 +499,8 @@ pkg text/template/parse, type Node interface { Copy, String, Type }
|
||||
pkg unicode, const Version = "10.0.0"
|
||||
pkg unicode, const Version = "11.0.0"
|
||||
pkg unicode, const Version = "12.0.0"
|
||||
pkg unicode, const Version = "13.0.0"
|
||||
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 unicode, const Version = "9.0.0"
|
||||
pkg html/template, method (*Template) Funcs(FuncMap) *Template
|
||||
pkg html/template, type FuncMap map[string]interface{}
|
||||
pkg syscall (freebsd-386), const SYS_FSTAT = 189
|
||||
pkg syscall (freebsd-386), const SYS_FSTATAT = 493
|
||||
pkg syscall (freebsd-386), const SYS_FSTATFS = 397
|
||||
pkg syscall (freebsd-386), const SYS_GETDIRENTRIES = 196
|
||||
pkg syscall (freebsd-386), const SYS_GETFSSTAT = 395
|
||||
pkg syscall (freebsd-386), const SYS_LSTAT = 190
|
||||
pkg syscall (freebsd-386), const SYS_LSTAT ideal-int
|
||||
pkg syscall (freebsd-386), const SYS_MKNODAT = 498
|
||||
pkg syscall (freebsd-386), const SYS_STAT = 188
|
||||
pkg syscall (freebsd-386), const SYS_STAT ideal-int
|
||||
pkg syscall (freebsd-386), const SYS_STATFS = 396
|
||||
pkg syscall (freebsd-386-cgo), const SYS_FSTAT = 189
|
||||
pkg syscall (freebsd-386-cgo), const SYS_FSTATAT = 493
|
||||
pkg syscall (freebsd-386-cgo), const SYS_FSTATFS = 397
|
||||
pkg syscall (freebsd-386-cgo), const SYS_GETDIRENTRIES = 196
|
||||
pkg syscall (freebsd-386-cgo), const SYS_GETFSSTAT = 395
|
||||
pkg syscall (freebsd-386-cgo), const SYS_LSTAT = 190
|
||||
pkg syscall (freebsd-386-cgo), const SYS_LSTAT ideal-int
|
||||
pkg syscall (freebsd-386-cgo), const SYS_MKNODAT = 498
|
||||
pkg syscall (freebsd-386-cgo), const SYS_STAT = 188
|
||||
pkg syscall (freebsd-386-cgo), const SYS_STAT ideal-int
|
||||
pkg syscall (freebsd-386-cgo), const SYS_STATFS = 396
|
||||
pkg syscall (freebsd-amd64), const SYS_FSTAT = 189
|
||||
pkg syscall (freebsd-amd64), const SYS_FSTATAT = 493
|
||||
pkg syscall (freebsd-amd64), const SYS_FSTATFS = 397
|
||||
pkg syscall (freebsd-amd64), const SYS_GETDIRENTRIES = 196
|
||||
pkg syscall (freebsd-amd64), const SYS_GETFSSTAT = 395
|
||||
pkg syscall (freebsd-amd64), const SYS_LSTAT = 190
|
||||
pkg syscall (freebsd-amd64), const SYS_LSTAT ideal-int
|
||||
pkg syscall (freebsd-amd64), const SYS_MKNODAT = 498
|
||||
pkg syscall (freebsd-amd64), const SYS_STAT = 188
|
||||
pkg syscall (freebsd-amd64), const SYS_STAT ideal-int
|
||||
pkg syscall (freebsd-amd64), const SYS_STATFS = 396
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_FSTAT = 189
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_FSTATAT = 493
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_FSTATFS = 397
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_GETDIRENTRIES = 196
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_GETFSSTAT = 395
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_LSTAT = 190
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_LSTAT ideal-int
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_MKNODAT = 498
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_STAT = 188
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_STAT ideal-int
|
||||
pkg syscall (freebsd-amd64-cgo), const SYS_STATFS = 396
|
||||
pkg syscall (freebsd-arm), const SYS_FSTAT = 189
|
||||
pkg syscall (freebsd-arm), const SYS_FSTATAT = 493
|
||||
pkg syscall (freebsd-arm), const SYS_FSTATFS = 397
|
||||
pkg syscall (freebsd-arm), const SYS_GETDIRENTRIES = 196
|
||||
pkg syscall (freebsd-arm), const SYS_GETFSSTAT = 395
|
||||
pkg syscall (freebsd-arm), const SYS_LSTAT = 190
|
||||
pkg syscall (freebsd-arm), const SYS_LSTAT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_MKNODAT = 498
|
||||
pkg syscall (freebsd-arm), const SYS_STAT = 188
|
||||
pkg syscall (freebsd-arm), const SYS_STAT ideal-int
|
||||
pkg syscall (freebsd-arm), const SYS_STATFS = 396
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_FSTAT = 189
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_FSTATAT = 493
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_FSTATFS = 397
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_GETDIRENTRIES = 196
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_GETFSSTAT = 395
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_LSTAT = 190
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_LSTAT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_MKNODAT = 498
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_STAT = 188
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_STAT ideal-int
|
||||
pkg syscall (freebsd-arm-cgo), const SYS_STATFS = 396
|
||||
pkg syscall (freebsd-arm64), const SYS_FSTAT = 189
|
||||
pkg syscall (freebsd-arm64), const SYS_FSTATAT = 493
|
||||
pkg syscall (freebsd-arm64), const SYS_FSTATFS = 397
|
||||
pkg syscall (freebsd-arm64), const SYS_GETDIRENTRIES = 196
|
||||
pkg syscall (freebsd-arm64), const SYS_GETFSSTAT = 395
|
||||
pkg syscall (freebsd-arm64), const SYS_LSTAT = 190
|
||||
pkg syscall (freebsd-arm64), const SYS_LSTAT ideal-int
|
||||
pkg syscall (freebsd-arm64), const SYS_MKNODAT = 498
|
||||
pkg syscall (freebsd-arm64), const SYS_STAT = 188
|
||||
pkg syscall (freebsd-arm64), const SYS_STAT ideal-int
|
||||
pkg syscall (freebsd-arm64), const SYS_STATFS = 396
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_FSTAT = 189
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_FSTATAT = 493
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_FSTATFS = 397
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_GETDIRENTRIES = 196
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_GETFSSTAT = 395
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_LSTAT = 190
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_LSTAT ideal-int
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_MKNODAT = 498
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_STAT = 188
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_STAT ideal-int
|
||||
pkg syscall (freebsd-arm64-cgo), const SYS_STATFS = 396
|
||||
|
||||
@@ -371,7 +371,7 @@ pkg debug/elf, const ELFCLASSNONE = 0
|
||||
pkg debug/elf, const ELFDATA2LSB = 1
|
||||
pkg debug/elf, const ELFDATA2MSB = 2
|
||||
pkg debug/elf, const ELFDATANONE = 0
|
||||
pkg debug/elf, const ELFMAG = "\x7fELF"
|
||||
pkg debug/elf, const ELFMAG = "\u007fELF"
|
||||
pkg debug/elf, const ELFOSABI_86OPEN = 5
|
||||
pkg debug/elf, const ELFOSABI_AIX = 7
|
||||
pkg debug/elf, const ELFOSABI_ARM = 97
|
||||
@@ -2603,34 +2603,7 @@ pkg runtime/debug, type GCStats struct, Pause []time.Duration
|
||||
pkg runtime/debug, type GCStats struct, PauseQuantiles []time.Duration
|
||||
pkg runtime/debug, type GCStats struct, PauseTotal time.Duration
|
||||
pkg sort, func Reverse(Interface) Interface
|
||||
pkg strconv (darwin-amd64), const IntSize = 64
|
||||
pkg strconv (darwin-amd64-cgo), const IntSize = 64
|
||||
pkg strconv (freebsd-386), const IntSize = 32
|
||||
pkg strconv (freebsd-386-cgo), const IntSize = 32
|
||||
pkg strconv (freebsd-amd64), const IntSize = 64
|
||||
pkg strconv (freebsd-amd64-cgo), const IntSize = 64
|
||||
pkg strconv (freebsd-arm), const IntSize = 32
|
||||
pkg strconv (freebsd-arm-cgo), const IntSize = 32
|
||||
pkg strconv (linux-386), const IntSize = 32
|
||||
pkg strconv (linux-386-cgo), const IntSize = 32
|
||||
pkg strconv (linux-amd64), const IntSize = 64
|
||||
pkg strconv (linux-amd64-cgo), const IntSize = 64
|
||||
pkg strconv (linux-arm), const IntSize = 32
|
||||
pkg strconv (linux-arm-cgo), const IntSize = 32
|
||||
pkg strconv (netbsd-386), const IntSize = 32
|
||||
pkg strconv (netbsd-386-cgo), const IntSize = 32
|
||||
pkg strconv (netbsd-amd64), const IntSize = 64
|
||||
pkg strconv (netbsd-amd64-cgo), const IntSize = 64
|
||||
pkg strconv (netbsd-arm), const IntSize = 32
|
||||
pkg strconv (netbsd-arm-cgo), const IntSize = 32
|
||||
pkg strconv (netbsd-arm64), const IntSize = 64
|
||||
pkg strconv (netbsd-arm64-cgo), const IntSize = 64
|
||||
pkg strconv (openbsd-386), const IntSize = 32
|
||||
pkg strconv (openbsd-386-cgo), const IntSize = 32
|
||||
pkg strconv (openbsd-amd64), const IntSize = 64
|
||||
pkg strconv (openbsd-amd64-cgo), const IntSize = 64
|
||||
pkg strconv (windows-386), const IntSize = 32
|
||||
pkg strconv (windows-amd64), const IntSize = 64
|
||||
pkg strconv, const IntSize = 64
|
||||
pkg strings, func TrimPrefix(string, string) string
|
||||
pkg strings, func TrimSuffix(string, string) string
|
||||
pkg strings, method (*Reader) WriteTo(io.Writer) (int64, error)
|
||||
@@ -49393,7 +49366,7 @@ pkg syscall (windows-386), const IP_MULTICAST_TTL = 10
|
||||
pkg syscall (windows-386), const IP_TOS = 3
|
||||
pkg syscall (windows-386), const IP_TTL = 4
|
||||
pkg syscall (windows-386), const ImplementsGetwd = true
|
||||
pkg syscall (windows-386), const InvalidHandle = 4294967295
|
||||
pkg syscall (windows-386), const InvalidHandle = 18446744073709551615
|
||||
pkg syscall (windows-386), const KEY_ALL_ACCESS = 983103
|
||||
pkg syscall (windows-386), const KEY_CREATE_LINK = 32
|
||||
pkg syscall (windows-386), const KEY_CREATE_SUB_KEY = 4
|
||||
|
||||
8717
api/go1.14.txt
8717
api/go1.14.txt
File diff suppressed because it is too large
Load Diff
8026
api/go1.16.txt
8026
api/go1.16.txt
File diff suppressed because it is too large
Load Diff
114
api/go1.17.txt
114
api/go1.17.txt
@@ -63,105 +63,12 @@ pkg image/draw, type RGBA64Image interface, RGBA64At(int, int) color.RGBA64
|
||||
pkg image/draw, type RGBA64Image interface, Set(int, int, color.Color)
|
||||
pkg image/draw, type RGBA64Image interface, SetRGBA64(int, int, color.RGBA64)
|
||||
pkg io/fs, func FileInfoToDirEntry(FileInfo) DirEntry
|
||||
pkg math (darwin-amd64), const MaxInt = 9223372036854775807
|
||||
pkg math (darwin-amd64), const MaxUint = 18446744073709551615
|
||||
pkg math (darwin-amd64), const MinInt = -9223372036854775808
|
||||
pkg math (darwin-amd64-cgo), const MaxInt = 9223372036854775807
|
||||
pkg math (darwin-amd64-cgo), const MaxUint = 18446744073709551615
|
||||
pkg math (darwin-amd64-cgo), const MinInt = -9223372036854775808
|
||||
pkg math (darwin-arm64), const MaxInt = 9223372036854775807
|
||||
pkg math (darwin-arm64), const MaxUint = 18446744073709551615
|
||||
pkg math (darwin-arm64), const MinInt = -9223372036854775808
|
||||
pkg math (darwin-arm64-cgo), const MaxInt = 9223372036854775807
|
||||
pkg math (darwin-arm64-cgo), const MaxUint = 18446744073709551615
|
||||
pkg math (darwin-arm64-cgo), const MinInt = -9223372036854775808
|
||||
pkg math (freebsd-386), const MaxInt = 2147483647
|
||||
pkg math (freebsd-386), const MaxUint = 4294967295
|
||||
pkg math (freebsd-386), const MinInt = -2147483648
|
||||
pkg math (freebsd-386-cgo), const MaxInt = 2147483647
|
||||
pkg math (freebsd-386-cgo), const MaxUint = 4294967295
|
||||
pkg math (freebsd-386-cgo), const MinInt = -2147483648
|
||||
pkg math (freebsd-amd64), const MaxInt = 9223372036854775807
|
||||
pkg math (freebsd-amd64), const MaxUint = 18446744073709551615
|
||||
pkg math (freebsd-amd64), const MinInt = -9223372036854775808
|
||||
pkg math (freebsd-amd64-cgo), const MaxInt = 9223372036854775807
|
||||
pkg math (freebsd-amd64-cgo), const MaxUint = 18446744073709551615
|
||||
pkg math (freebsd-amd64-cgo), const MinInt = -9223372036854775808
|
||||
pkg math (freebsd-arm), const MaxInt = 2147483647
|
||||
pkg math (freebsd-arm), const MaxUint = 4294967295
|
||||
pkg math (freebsd-arm), const MinInt = -2147483648
|
||||
pkg math (freebsd-arm-cgo), const MaxInt = 2147483647
|
||||
pkg math (freebsd-arm-cgo), const MaxUint = 4294967295
|
||||
pkg math (freebsd-arm-cgo), const MinInt = -2147483648
|
||||
pkg math (freebsd-arm64), const MaxInt = 9223372036854775807
|
||||
pkg math (freebsd-arm64), const MaxUint = 18446744073709551615
|
||||
pkg math (freebsd-arm64), const MinInt = -9223372036854775808
|
||||
pkg math (freebsd-arm64-cgo), const MaxInt = 9223372036854775807
|
||||
pkg math (freebsd-arm64-cgo), const MaxUint = 18446744073709551615
|
||||
pkg math (freebsd-arm64-cgo), const MinInt = -9223372036854775808
|
||||
pkg math (linux-386), const MaxInt = 2147483647
|
||||
pkg math (linux-386), const MaxUint = 4294967295
|
||||
pkg math (linux-386), const MinInt = -2147483648
|
||||
pkg math (linux-386-cgo), const MaxInt = 2147483647
|
||||
pkg math (linux-386-cgo), const MaxUint = 4294967295
|
||||
pkg math (linux-386-cgo), const MinInt = -2147483648
|
||||
pkg math (linux-amd64), const MaxInt = 9223372036854775807
|
||||
pkg math (linux-amd64), const MaxUint = 18446744073709551615
|
||||
pkg math (linux-amd64), const MinInt = -9223372036854775808
|
||||
pkg math (linux-amd64-cgo), const MaxInt = 9223372036854775807
|
||||
pkg math (linux-amd64-cgo), const MaxUint = 18446744073709551615
|
||||
pkg math (linux-amd64-cgo), const MinInt = -9223372036854775808
|
||||
pkg math (linux-arm), const MaxInt = 2147483647
|
||||
pkg math (linux-arm), const MaxUint = 4294967295
|
||||
pkg math (linux-arm), const MinInt = -2147483648
|
||||
pkg math (linux-arm-cgo), const MaxInt = 2147483647
|
||||
pkg math (linux-arm-cgo), const MaxUint = 4294967295
|
||||
pkg math (linux-arm-cgo), const MinInt = -2147483648
|
||||
pkg math (netbsd-386), const MaxInt = 2147483647
|
||||
pkg math (netbsd-386), const MaxUint = 4294967295
|
||||
pkg math (netbsd-386), const MinInt = -2147483648
|
||||
pkg math (netbsd-386-cgo), const MaxInt = 2147483647
|
||||
pkg math (netbsd-386-cgo), const MaxUint = 4294967295
|
||||
pkg math (netbsd-386-cgo), const MinInt = -2147483648
|
||||
pkg math (netbsd-amd64), const MaxInt = 9223372036854775807
|
||||
pkg math (netbsd-amd64), const MaxUint = 18446744073709551615
|
||||
pkg math (netbsd-amd64), const MinInt = -9223372036854775808
|
||||
pkg math (netbsd-amd64-cgo), const MaxInt = 9223372036854775807
|
||||
pkg math (netbsd-amd64-cgo), const MaxUint = 18446744073709551615
|
||||
pkg math (netbsd-amd64-cgo), const MinInt = -9223372036854775808
|
||||
pkg math (netbsd-arm), const MaxInt = 2147483647
|
||||
pkg math (netbsd-arm), const MaxUint = 4294967295
|
||||
pkg math (netbsd-arm), const MinInt = -2147483648
|
||||
pkg math (netbsd-arm-cgo), const MaxInt = 2147483647
|
||||
pkg math (netbsd-arm-cgo), const MaxUint = 4294967295
|
||||
pkg math (netbsd-arm-cgo), const MinInt = -2147483648
|
||||
pkg math (netbsd-arm64), const MaxInt = 9223372036854775807
|
||||
pkg math (netbsd-arm64), const MaxUint = 18446744073709551615
|
||||
pkg math (netbsd-arm64), const MinInt = -9223372036854775808
|
||||
pkg math (netbsd-arm64-cgo), const MaxInt = 9223372036854775807
|
||||
pkg math (netbsd-arm64-cgo), const MaxUint = 18446744073709551615
|
||||
pkg math (netbsd-arm64-cgo), const MinInt = -9223372036854775808
|
||||
pkg math (openbsd-386), const MaxInt = 2147483647
|
||||
pkg math (openbsd-386), const MaxUint = 4294967295
|
||||
pkg math (openbsd-386), const MinInt = -2147483648
|
||||
pkg math (openbsd-386-cgo), const MaxInt = 2147483647
|
||||
pkg math (openbsd-386-cgo), const MaxUint = 4294967295
|
||||
pkg math (openbsd-386-cgo), const MinInt = -2147483648
|
||||
pkg math (openbsd-amd64), const MaxInt = 9223372036854775807
|
||||
pkg math (openbsd-amd64), const MaxUint = 18446744073709551615
|
||||
pkg math (openbsd-amd64), const MinInt = -9223372036854775808
|
||||
pkg math (openbsd-amd64-cgo), const MaxInt = 9223372036854775807
|
||||
pkg math (openbsd-amd64-cgo), const MaxUint = 18446744073709551615
|
||||
pkg math (openbsd-amd64-cgo), const MinInt = -9223372036854775808
|
||||
pkg math (windows-386), const MaxInt = 2147483647
|
||||
pkg math (windows-386), const MaxUint = 4294967295
|
||||
pkg math (windows-386), const MinInt = -2147483648
|
||||
pkg math (windows-amd64), const MaxInt = 9223372036854775807
|
||||
pkg math (windows-amd64), const MaxUint = 18446744073709551615
|
||||
pkg math (windows-amd64), const MinInt = -9223372036854775808
|
||||
pkg math, const MaxFloat64 = 1.79769e+308 // 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
|
||||
pkg math, const MaxInt = 9223372036854775807
|
||||
pkg math, const MaxInt ideal-int
|
||||
pkg math, const MaxUint = 18446744073709551615
|
||||
pkg math, const MaxUint ideal-int
|
||||
pkg math, const MinInt = -9223372036854775808
|
||||
pkg math, const MinInt ideal-int
|
||||
pkg math, const SmallestNonzeroFloat32 = 1.4013e-45 // 1/713623846352979940529142984724747568191373312
|
||||
pkg math, const SmallestNonzeroFloat64 = 4.94066e-324 // 1/202402253307310618352495346718917307049556649764142118356901358027430339567995346891960383701437124495187077864316811911389808737385793476867013399940738509921517424276566361364466907742093216341239767678472745068562007483424692698618103355649159556340810056512358769552333414615230502532186327508646006263307707741093494784
|
||||
@@ -174,15 +81,10 @@ pkg reflect, func VisibleFields(Type) []StructField
|
||||
pkg reflect, method (Method) IsExported() bool
|
||||
pkg reflect, method (StructField) IsExported() bool
|
||||
pkg reflect, method (Value) CanConvert(Type) bool
|
||||
pkg reflect, method (Value) InterfaceData //deprecated
|
||||
pkg runtime/cgo (darwin-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (darwin-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (darwin-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (darwin-amd64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (darwin-arm64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (darwin-arm64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (darwin-arm64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (darwin-arm64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (freebsd-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (freebsd-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (freebsd-386-cgo), method (Handle) Value() interface{}
|
||||
@@ -195,10 +97,6 @@ pkg runtime/cgo (freebsd-arm-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (freebsd-arm-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (freebsd-arm-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (freebsd-arm-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (freebsd-arm64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (freebsd-arm64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (freebsd-arm64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (freebsd-arm64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (linux-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (linux-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (linux-386-cgo), method (Handle) Value() interface{}
|
||||
@@ -278,14 +176,8 @@ pkg syscall (openbsd-amd64), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-amd64), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-amd64-cgo), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (windows-386), func CreateIoCompletionPort //deprecated
|
||||
pkg syscall (windows-386), func GetQueuedCompletionStatus //deprecated
|
||||
pkg syscall (windows-386), func PostQueuedCompletionStatus //deprecated
|
||||
pkg syscall (windows-386), type SysProcAttr struct, AdditionalInheritedHandles []Handle
|
||||
pkg syscall (windows-386), type SysProcAttr struct, ParentProcess Handle
|
||||
pkg syscall (windows-amd64), func CreateIoCompletionPort //deprecated
|
||||
pkg syscall (windows-amd64), func GetQueuedCompletionStatus //deprecated
|
||||
pkg syscall (windows-amd64), func PostQueuedCompletionStatus //deprecated
|
||||
pkg syscall (windows-amd64), type SysProcAttr struct, AdditionalInheritedHandles []Handle
|
||||
pkg syscall (windows-amd64), type SysProcAttr struct, ParentProcess Handle
|
||||
pkg testing, method (*B) Setenv(string, string)
|
||||
|
||||
253
api/go1.18.txt
253
api/go1.18.txt
@@ -1,253 +0,0 @@
|
||||
pkg bufio, method (*Writer) AvailableBuffer() []uint8
|
||||
pkg bufio, method (ReadWriter) AvailableBuffer() []uint8
|
||||
pkg bytes, func Cut([]uint8, []uint8) ([]uint8, []uint8, bool)
|
||||
pkg bytes, func Title //deprecated
|
||||
pkg crypto/tls, method (*Conn) NetConn() net.Conn
|
||||
pkg crypto/tls, type Config struct, PreferServerCipherSuites //deprecated
|
||||
pkg crypto/x509, method (*CertPool) Subjects //deprecated
|
||||
pkg debug/buildinfo, func Read(io.ReaderAt) (*debug.BuildInfo, error)
|
||||
pkg debug/buildinfo, func ReadFile(string) (*debug.BuildInfo, error)
|
||||
pkg debug/buildinfo, type BuildInfo = debug.BuildInfo
|
||||
pkg debug/dwarf, type BasicType struct, DataBitOffset int64
|
||||
pkg debug/dwarf, type StructField struct, DataBitOffset int64
|
||||
pkg debug/elf, const R_PPC64_RELATIVE = 22
|
||||
pkg debug/elf, const R_PPC64_RELATIVE R_PPC64
|
||||
pkg debug/plan9obj, var ErrNoSymbols error
|
||||
pkg go/ast, method (*IndexListExpr) End() token.Pos
|
||||
pkg go/ast, method (*IndexListExpr) Pos() token.Pos
|
||||
pkg go/ast, type FuncType struct, TypeParams *FieldList
|
||||
pkg go/ast, type IndexListExpr struct
|
||||
pkg go/ast, type IndexListExpr struct, Indices []Expr
|
||||
pkg go/ast, type IndexListExpr struct, Lbrack token.Pos
|
||||
pkg go/ast, type IndexListExpr struct, Rbrack token.Pos
|
||||
pkg go/ast, type IndexListExpr struct, X Expr
|
||||
pkg go/ast, type TypeSpec struct, TypeParams *FieldList
|
||||
pkg go/constant, method (Kind) String() string
|
||||
pkg go/token, const TILDE = 88
|
||||
pkg go/token, const TILDE Token
|
||||
pkg go/types, func Instantiate(*Context, Type, []Type, bool) (Type, error)
|
||||
pkg go/types, func NewContext() *Context
|
||||
pkg go/types, func NewSignature //deprecated
|
||||
pkg go/types, func NewSignatureType(*Var, []*TypeParam, []*TypeParam, *Tuple, *Tuple, bool) *Signature
|
||||
pkg go/types, func NewTerm(bool, Type) *Term
|
||||
pkg go/types, func NewTypeParam(*TypeName, Type) *TypeParam
|
||||
pkg go/types, func NewUnion([]*Term) *Union
|
||||
pkg go/types, method (*ArgumentError) Error() string
|
||||
pkg go/types, method (*ArgumentError) Unwrap() error
|
||||
pkg go/types, method (*Interface) IsComparable() bool
|
||||
pkg go/types, method (*Interface) IsImplicit() bool
|
||||
pkg go/types, method (*Interface) IsMethodSet() bool
|
||||
pkg go/types, method (*Interface) MarkImplicit()
|
||||
pkg go/types, method (*Named) Origin() *Named
|
||||
pkg go/types, method (*Named) SetTypeParams([]*TypeParam)
|
||||
pkg go/types, method (*Named) TypeArgs() *TypeList
|
||||
pkg go/types, method (*Named) TypeParams() *TypeParamList
|
||||
pkg go/types, method (*Signature) RecvTypeParams() *TypeParamList
|
||||
pkg go/types, method (*Signature) TypeParams() *TypeParamList
|
||||
pkg go/types, method (*Term) String() string
|
||||
pkg go/types, method (*Term) Tilde() bool
|
||||
pkg go/types, method (*Term) Type() Type
|
||||
pkg go/types, method (*TypeList) At(int) Type
|
||||
pkg go/types, method (*TypeList) Len() int
|
||||
pkg go/types, method (*TypeParam) Constraint() Type
|
||||
pkg go/types, method (*TypeParam) Index() int
|
||||
pkg go/types, method (*TypeParam) Obj() *TypeName
|
||||
pkg go/types, method (*TypeParam) SetConstraint(Type)
|
||||
pkg go/types, method (*TypeParam) String() string
|
||||
pkg go/types, method (*TypeParam) Underlying() Type
|
||||
pkg go/types, method (*TypeParamList) At(int) *TypeParam
|
||||
pkg go/types, method (*TypeParamList) Len() int
|
||||
pkg go/types, method (*Union) Len() int
|
||||
pkg go/types, method (*Union) String() string
|
||||
pkg go/types, method (*Union) Term(int) *Term
|
||||
pkg go/types, method (*Union) Underlying() Type
|
||||
pkg go/types, type ArgumentError struct
|
||||
pkg go/types, type ArgumentError struct, Err error
|
||||
pkg go/types, type ArgumentError struct, Index int
|
||||
pkg go/types, type Config struct, Context *Context
|
||||
pkg go/types, type Config struct, GoVersion string
|
||||
pkg go/types, type Context struct
|
||||
pkg go/types, type Info struct, Instances map[*ast.Ident]Instance
|
||||
pkg go/types, type Instance struct
|
||||
pkg go/types, type Instance struct, Type Type
|
||||
pkg go/types, type Instance struct, TypeArgs *TypeList
|
||||
pkg go/types, type Term struct
|
||||
pkg go/types, type TypeList struct
|
||||
pkg go/types, type TypeParam struct
|
||||
pkg go/types, type TypeParamList struct
|
||||
pkg go/types, type Union struct
|
||||
pkg net, func TCPAddrFromAddrPort(netip.AddrPort) *TCPAddr
|
||||
pkg net, func UDPAddrFromAddrPort(netip.AddrPort) *UDPAddr
|
||||
pkg net, method (*Resolver) LookupNetIP(context.Context, string, string) ([]netip.Addr, error)
|
||||
pkg net, method (*TCPAddr) AddrPort() netip.AddrPort
|
||||
pkg net, method (*UDPAddr) AddrPort() netip.AddrPort
|
||||
pkg net, method (*UDPConn) ReadFromUDPAddrPort([]uint8) (int, netip.AddrPort, error)
|
||||
pkg net, method (*UDPConn) ReadMsgUDPAddrPort([]uint8, []uint8) (int, int, int, netip.AddrPort, error)
|
||||
pkg net, method (*UDPConn) WriteMsgUDPAddrPort([]uint8, []uint8, netip.AddrPort) (int, int, error)
|
||||
pkg net, method (*UDPConn) WriteToUDPAddrPort([]uint8, netip.AddrPort) (int, error)
|
||||
pkg net, type Error interface, Temporary //deprecated
|
||||
pkg net/http, func MaxBytesHandler(Handler, int64) Handler
|
||||
pkg net/http, method (*Cookie) Valid() error
|
||||
pkg net/netip, func AddrFrom16([16]uint8) Addr
|
||||
pkg net/netip, func AddrFrom4([4]uint8) Addr
|
||||
pkg net/netip, func AddrFromSlice([]uint8) (Addr, bool)
|
||||
pkg net/netip, func AddrPortFrom(Addr, uint16) AddrPort
|
||||
pkg net/netip, func IPv4Unspecified() Addr
|
||||
pkg net/netip, func IPv6LinkLocalAllNodes() Addr
|
||||
pkg net/netip, func IPv6Unspecified() Addr
|
||||
pkg net/netip, func MustParseAddr(string) Addr
|
||||
pkg net/netip, func MustParseAddrPort(string) AddrPort
|
||||
pkg net/netip, func MustParsePrefix(string) Prefix
|
||||
pkg net/netip, func ParseAddr(string) (Addr, error)
|
||||
pkg net/netip, func ParseAddrPort(string) (AddrPort, error)
|
||||
pkg net/netip, func ParsePrefix(string) (Prefix, error)
|
||||
pkg net/netip, func PrefixFrom(Addr, int) Prefix
|
||||
pkg net/netip, method (*Addr) UnmarshalBinary([]uint8) error
|
||||
pkg net/netip, method (*Addr) UnmarshalText([]uint8) error
|
||||
pkg net/netip, method (*AddrPort) UnmarshalBinary([]uint8) error
|
||||
pkg net/netip, method (*AddrPort) UnmarshalText([]uint8) error
|
||||
pkg net/netip, method (*Prefix) UnmarshalBinary([]uint8) error
|
||||
pkg net/netip, method (*Prefix) UnmarshalText([]uint8) error
|
||||
pkg net/netip, method (Addr) AppendTo([]uint8) []uint8
|
||||
pkg net/netip, method (Addr) As16() [16]uint8
|
||||
pkg net/netip, method (Addr) As4() [4]uint8
|
||||
pkg net/netip, method (Addr) AsSlice() []uint8
|
||||
pkg net/netip, method (Addr) BitLen() int
|
||||
pkg net/netip, method (Addr) Compare(Addr) int
|
||||
pkg net/netip, method (Addr) Is4() bool
|
||||
pkg net/netip, method (Addr) Is4In6() bool
|
||||
pkg net/netip, method (Addr) Is6() bool
|
||||
pkg net/netip, method (Addr) IsGlobalUnicast() bool
|
||||
pkg net/netip, method (Addr) IsInterfaceLocalMulticast() bool
|
||||
pkg net/netip, method (Addr) IsLinkLocalMulticast() bool
|
||||
pkg net/netip, method (Addr) IsLinkLocalUnicast() bool
|
||||
pkg net/netip, method (Addr) IsLoopback() bool
|
||||
pkg net/netip, method (Addr) IsMulticast() bool
|
||||
pkg net/netip, method (Addr) IsPrivate() bool
|
||||
pkg net/netip, method (Addr) IsUnspecified() bool
|
||||
pkg net/netip, method (Addr) IsValid() bool
|
||||
pkg net/netip, method (Addr) Less(Addr) bool
|
||||
pkg net/netip, method (Addr) MarshalBinary() ([]uint8, error)
|
||||
pkg net/netip, method (Addr) MarshalText() ([]uint8, error)
|
||||
pkg net/netip, method (Addr) Next() Addr
|
||||
pkg net/netip, method (Addr) Prefix(int) (Prefix, error)
|
||||
pkg net/netip, method (Addr) Prev() Addr
|
||||
pkg net/netip, method (Addr) String() string
|
||||
pkg net/netip, method (Addr) StringExpanded() string
|
||||
pkg net/netip, method (Addr) Unmap() Addr
|
||||
pkg net/netip, method (Addr) WithZone(string) Addr
|
||||
pkg net/netip, method (Addr) Zone() string
|
||||
pkg net/netip, method (AddrPort) Addr() Addr
|
||||
pkg net/netip, method (AddrPort) AppendTo([]uint8) []uint8
|
||||
pkg net/netip, method (AddrPort) IsValid() bool
|
||||
pkg net/netip, method (AddrPort) MarshalBinary() ([]uint8, error)
|
||||
pkg net/netip, method (AddrPort) MarshalText() ([]uint8, error)
|
||||
pkg net/netip, method (AddrPort) Port() uint16
|
||||
pkg net/netip, method (AddrPort) String() string
|
||||
pkg net/netip, method (Prefix) Addr() Addr
|
||||
pkg net/netip, method (Prefix) AppendTo([]uint8) []uint8
|
||||
pkg net/netip, method (Prefix) Bits() int
|
||||
pkg net/netip, method (Prefix) Contains(Addr) bool
|
||||
pkg net/netip, method (Prefix) IsSingleIP() bool
|
||||
pkg net/netip, method (Prefix) IsValid() bool
|
||||
pkg net/netip, method (Prefix) MarshalBinary() ([]uint8, error)
|
||||
pkg net/netip, method (Prefix) MarshalText() ([]uint8, error)
|
||||
pkg net/netip, method (Prefix) Masked() Prefix
|
||||
pkg net/netip, method (Prefix) Overlaps(Prefix) bool
|
||||
pkg net/netip, method (Prefix) String() string
|
||||
pkg net/netip, type Addr struct
|
||||
pkg net/netip, type AddrPort struct
|
||||
pkg net/netip, type Prefix struct
|
||||
pkg reflect, const Pointer = 22
|
||||
pkg reflect, const Pointer Kind
|
||||
pkg reflect, func PointerTo(Type) Type
|
||||
pkg reflect, method (*MapIter) Reset(Value)
|
||||
pkg reflect, method (Value) CanComplex() bool
|
||||
pkg reflect, method (Value) CanFloat() bool
|
||||
pkg reflect, method (Value) CanInt() bool
|
||||
pkg reflect, method (Value) CanUint() bool
|
||||
pkg reflect, method (Value) FieldByIndexErr([]int) (Value, error)
|
||||
pkg reflect, method (Value) SetIterKey(*MapIter)
|
||||
pkg reflect, method (Value) SetIterValue(*MapIter)
|
||||
pkg reflect, method (Value) UnsafePointer() unsafe.Pointer
|
||||
pkg runtime/debug, func ParseBuildInfo(string) (*BuildInfo, error)
|
||||
pkg runtime/debug, method (*BuildInfo) String() string
|
||||
pkg runtime/debug, type BuildInfo struct, GoVersion string
|
||||
pkg runtime/debug, type BuildInfo struct, Settings []BuildSetting
|
||||
pkg runtime/debug, type BuildSetting struct
|
||||
pkg runtime/debug, type BuildSetting struct, Key string
|
||||
pkg runtime/debug, type BuildSetting struct, Value string
|
||||
pkg strings, func Clone(string) string
|
||||
pkg strings, func Cut(string, string) (string, string, bool)
|
||||
pkg strings, func Title //deprecated
|
||||
pkg sync, method (*Mutex) TryLock() bool
|
||||
pkg sync, method (*RWMutex) TryLock() bool
|
||||
pkg sync, method (*RWMutex) TryRLock() bool
|
||||
pkg syscall (freebsd-386), type SysProcAttr struct, Pdeathsig Signal
|
||||
pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Pdeathsig Signal
|
||||
pkg syscall (freebsd-amd64), type SysProcAttr struct, Pdeathsig Signal
|
||||
pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Pdeathsig Signal
|
||||
pkg syscall (freebsd-arm), type SysProcAttr struct, Pdeathsig Signal
|
||||
pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Pdeathsig Signal
|
||||
pkg syscall (freebsd-arm64), type SysProcAttr struct, Pdeathsig Signal
|
||||
pkg syscall (freebsd-arm64-cgo), type SysProcAttr struct, Pdeathsig Signal
|
||||
pkg syscall (windows-386), func Syscall //deprecated
|
||||
pkg syscall (windows-386), func Syscall12 //deprecated
|
||||
pkg syscall (windows-386), func Syscall15 //deprecated
|
||||
pkg syscall (windows-386), func Syscall18 //deprecated
|
||||
pkg syscall (windows-386), func Syscall6 //deprecated
|
||||
pkg syscall (windows-386), func Syscall9 //deprecated
|
||||
pkg syscall (windows-386), func SyscallN(uintptr, ...uintptr) (uintptr, uintptr, Errno)
|
||||
pkg syscall (windows-amd64), func Syscall //deprecated
|
||||
pkg syscall (windows-amd64), func Syscall12 //deprecated
|
||||
pkg syscall (windows-amd64), func Syscall15 //deprecated
|
||||
pkg syscall (windows-amd64), func Syscall18 //deprecated
|
||||
pkg syscall (windows-amd64), func Syscall6 //deprecated
|
||||
pkg syscall (windows-amd64), func Syscall9 //deprecated
|
||||
pkg syscall (windows-amd64), func SyscallN(uintptr, ...uintptr) (uintptr, uintptr, Errno)
|
||||
pkg testing, func MainStart(testDeps, []InternalTest, []InternalBenchmark, []InternalFuzzTarget, []InternalExample) *M
|
||||
pkg testing, method (*F) Add(...interface{})
|
||||
pkg testing, method (*F) Cleanup(func())
|
||||
pkg testing, method (*F) Error(...interface{})
|
||||
pkg testing, method (*F) Errorf(string, ...interface{})
|
||||
pkg testing, method (*F) Fail()
|
||||
pkg testing, method (*F) FailNow()
|
||||
pkg testing, method (*F) Failed() bool
|
||||
pkg testing, method (*F) Fatal(...interface{})
|
||||
pkg testing, method (*F) Fatalf(string, ...interface{})
|
||||
pkg testing, method (*F) Fuzz(interface{})
|
||||
pkg testing, method (*F) Helper()
|
||||
pkg testing, method (*F) Log(...interface{})
|
||||
pkg testing, method (*F) Logf(string, ...interface{})
|
||||
pkg testing, method (*F) Name() string
|
||||
pkg testing, method (*F) Setenv(string, string)
|
||||
pkg testing, method (*F) Skip(...interface{})
|
||||
pkg testing, method (*F) SkipNow()
|
||||
pkg testing, method (*F) Skipf(string, ...interface{})
|
||||
pkg testing, method (*F) Skipped() bool
|
||||
pkg testing, method (*F) TempDir() string
|
||||
pkg testing, type F struct
|
||||
pkg testing, type InternalFuzzTarget struct
|
||||
pkg testing, type InternalFuzzTarget struct, Fn func(*F)
|
||||
pkg testing, type InternalFuzzTarget struct, Name string
|
||||
pkg text/template/parse, const NodeBreak = 21
|
||||
pkg text/template/parse, const NodeBreak NodeType
|
||||
pkg text/template/parse, const NodeContinue = 22
|
||||
pkg text/template/parse, const NodeContinue NodeType
|
||||
pkg text/template/parse, method (*BreakNode) Copy() Node
|
||||
pkg text/template/parse, method (*BreakNode) String() string
|
||||
pkg text/template/parse, method (*ContinueNode) Copy() Node
|
||||
pkg text/template/parse, method (*ContinueNode) String() string
|
||||
pkg text/template/parse, method (BreakNode) Position() Pos
|
||||
pkg text/template/parse, method (BreakNode) Type() NodeType
|
||||
pkg text/template/parse, method (ContinueNode) Position() Pos
|
||||
pkg text/template/parse, method (ContinueNode) Type() NodeType
|
||||
pkg text/template/parse, type BreakNode struct
|
||||
pkg text/template/parse, type BreakNode struct, Line int
|
||||
pkg text/template/parse, type BreakNode struct, embedded NodeType
|
||||
pkg text/template/parse, type BreakNode struct, embedded Pos
|
||||
pkg text/template/parse, type ContinueNode struct
|
||||
pkg text/template/parse, type ContinueNode struct, Line int
|
||||
pkg text/template/parse, type ContinueNode struct, embedded NodeType
|
||||
pkg text/template/parse, type ContinueNode struct, embedded Pos
|
||||
pkg unicode/utf8, func AppendRune([]uint8, int32) []uint8
|
||||
309
api/go1.19.txt
309
api/go1.19.txt
@@ -1,309 +0,0 @@
|
||||
pkg crypto/x509, func ParseRevocationList([]uint8) (*RevocationList, error) #50674
|
||||
pkg crypto/x509, method (*CertPool) Clone() *CertPool #35044
|
||||
pkg crypto/x509, method (*CertPool) Equal(*CertPool) bool #46057
|
||||
pkg crypto/x509, method (*RevocationList) CheckSignatureFrom(*Certificate) error #50674
|
||||
pkg crypto/x509, type RevocationList struct, AuthorityKeyId []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, Extensions []pkix.Extension #50674
|
||||
pkg crypto/x509, type RevocationList struct, Issuer pkix.Name #50674
|
||||
pkg crypto/x509, type RevocationList struct, Raw []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, RawIssuer []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, RawTBSRevocationList []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, Signature []uint8 #50674
|
||||
pkg debug/elf, const EM_LOONGARCH = 258 #46229
|
||||
pkg debug/elf, const EM_LOONGARCH Machine #46229
|
||||
pkg debug/elf, const R_LARCH_32 = 1 #46229
|
||||
pkg debug/elf, const R_LARCH_32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_64 = 2 #46229
|
||||
pkg debug/elf, const R_LARCH_64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD16 = 48 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD16 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD24 = 49 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD24 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD32 = 50 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD64 = 51 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD8 = 47 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD8 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_COPY = 4 #46229
|
||||
pkg debug/elf, const R_LARCH_COPY R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_IRELATIVE = 12 #46229
|
||||
pkg debug/elf, const R_LARCH_IRELATIVE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_JUMP_SLOT = 5 #46229
|
||||
pkg debug/elf, const R_LARCH_JUMP_SLOT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_LA = 20 #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_LA R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_PCREL = 21 #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_PCREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_NONE = 0 #46229
|
||||
pkg debug/elf, const R_LARCH_NONE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_RELATIVE = 3 #46229
|
||||
pkg debug/elf, const R_LARCH_RELATIVE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ADD = 35 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ADD R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_AND = 36 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_AND R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ASSERT = 30 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ASSERT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_IF_ELSE = 37 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_IF_ELSE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_NOT = 31 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_NOT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_10_10_16_S2 = 45 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_10_10_16_S2 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_5_10_16_S2 = 44 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_5_10_16_S2 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_12 = 40 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_12 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16 = 41 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16_S2 = 42 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16_S2 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_5 = 38 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_5 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_5_20 = 43 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_5_20 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U = 46 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U_10_12 = 39 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U_10_12 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_ABSOLUTE = 23 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_ABSOLUTE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_DUP = 24 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_DUP R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_GPREL = 25 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_GPREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PCREL = 22 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PCREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PLT_PCREL = 29 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PLT_PCREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GD = 28 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GD R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GOT = 27 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GOT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_TPREL = 26 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_TPREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SL = 33 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SR = 34 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SR R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SUB = 32 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SUB R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB16 = 53 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB16 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB24 = 54 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB24 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB32 = 55 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB64 = 56 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB8 = 52 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB8 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD32 = 6 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD64 = 7 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL32 = 8 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL64 = 9 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL32 = 10 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL64 = 11 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL64 R_LARCH #46229
|
||||
pkg debug/elf, method (R_LARCH) GoString() string #46229
|
||||
pkg debug/elf, method (R_LARCH) String() string #46229
|
||||
pkg debug/elf, type R_LARCH int #46229
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ANY = 2 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ANY ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ASSOCIATIVE = 5 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ASSOCIATIVE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_EXACT_MATCH = 4 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_EXACT_MATCH ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_LARGEST = 6 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_LARGEST ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_NODUPLICATES = 1 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_NODUPLICATES ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_SAME_SIZE = 3 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_SAME_SIZE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_LOONGARCH32 = 25138 #46229
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_LOONGARCH32 ideal-int #46229
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_LOONGARCH64 = 25188 #46229
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_LOONGARCH64 ideal-int #46229
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_CODE = 32 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_CODE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_INITIALIZED_DATA = 64 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_INITIALIZED_DATA ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_UNINITIALIZED_DATA = 128 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_UNINITIALIZED_DATA ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_LNK_COMDAT = 4096 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_LNK_COMDAT ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_DISCARDABLE = 33554432 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_DISCARDABLE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_EXECUTE = 536870912 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_EXECUTE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_READ = 1073741824 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_READ ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_WRITE = 2147483648 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_WRITE ideal-int #51868
|
||||
pkg debug/pe, method (*File) COFFSymbolReadSectionDefAux(int) (*COFFSymbolAuxFormat5, error) #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, Checksum uint32 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, NumLineNumbers uint16 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, NumRelocs uint16 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, SecNum uint16 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, Selection uint8 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, Size uint32 #51868
|
||||
pkg encoding/binary, func AppendUvarint([]uint8, uint64) []uint8 #51644
|
||||
pkg encoding/binary, func AppendVarint([]uint8, int64) []uint8 #51644
|
||||
pkg encoding/binary, type AppendByteOrder interface { AppendUint16, AppendUint32, AppendUint64, String } #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, AppendUint16([]uint8, uint16) []uint8 #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, AppendUint32([]uint8, uint32) []uint8 #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, AppendUint64([]uint8, uint64) []uint8 #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, String() string #50601
|
||||
pkg encoding/csv, method (*Reader) InputOffset() int64 #43401
|
||||
pkg encoding/xml, method (*Decoder) InputPos() (int, int) #45628
|
||||
pkg flag, func TextVar(encoding.TextUnmarshaler, string, encoding.TextMarshaler, string) #45754
|
||||
pkg flag, method (*FlagSet) TextVar(encoding.TextUnmarshaler, string, encoding.TextMarshaler, string) #45754
|
||||
pkg fmt, func Append([]uint8, ...interface{}) []uint8 #47579
|
||||
pkg fmt, func Appendf([]uint8, string, ...interface{}) []uint8 #47579
|
||||
pkg fmt, func Appendln([]uint8, ...interface{}) []uint8 #47579
|
||||
pkg go/doc, method (*Package) HTML(string) []uint8 #51082
|
||||
pkg go/doc, method (*Package) Markdown(string) []uint8 #51082
|
||||
pkg go/doc, method (*Package) Parser() *comment.Parser #51082
|
||||
pkg go/doc, method (*Package) Printer() *comment.Printer #51082
|
||||
pkg go/doc, method (*Package) Synopsis(string) string #51082
|
||||
pkg go/doc, method (*Package) Text(string) []uint8 #51082
|
||||
pkg go/doc/comment, func DefaultLookupPackage(string) (string, bool) #51082
|
||||
pkg go/doc/comment, method (*DocLink) DefaultURL(string) string #51082
|
||||
pkg go/doc/comment, method (*Heading) DefaultID() string #51082
|
||||
pkg go/doc/comment, method (*List) BlankBefore() bool #51082
|
||||
pkg go/doc/comment, method (*List) BlankBetween() bool #51082
|
||||
pkg go/doc/comment, method (*Parser) Parse(string) *Doc #51082
|
||||
pkg go/doc/comment, method (*Printer) Comment(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, method (*Printer) HTML(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, method (*Printer) Markdown(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, method (*Printer) Text(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, type Block interface, unexported methods #51082
|
||||
pkg go/doc/comment, type Code struct #51082
|
||||
pkg go/doc/comment, type Code struct, Text string #51082
|
||||
pkg go/doc/comment, type Doc struct #51082
|
||||
pkg go/doc/comment, type Doc struct, Content []Block #51082
|
||||
pkg go/doc/comment, type Doc struct, Links []*LinkDef #51082
|
||||
pkg go/doc/comment, type DocLink struct #51082
|
||||
pkg go/doc/comment, type DocLink struct, ImportPath string #51082
|
||||
pkg go/doc/comment, type DocLink struct, Name string #51082
|
||||
pkg go/doc/comment, type DocLink struct, Recv string #51082
|
||||
pkg go/doc/comment, type DocLink struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Heading struct #51082
|
||||
pkg go/doc/comment, type Heading struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Italic string #51082
|
||||
pkg go/doc/comment, type Link struct #51082
|
||||
pkg go/doc/comment, type Link struct, Auto bool #51082
|
||||
pkg go/doc/comment, type Link struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Link struct, URL string #51082
|
||||
pkg go/doc/comment, type LinkDef struct #51082
|
||||
pkg go/doc/comment, type LinkDef struct, Text string #51082
|
||||
pkg go/doc/comment, type LinkDef struct, URL string #51082
|
||||
pkg go/doc/comment, type LinkDef struct, Used bool #51082
|
||||
pkg go/doc/comment, type List struct #51082
|
||||
pkg go/doc/comment, type List struct, ForceBlankBefore bool #51082
|
||||
pkg go/doc/comment, type List struct, ForceBlankBetween bool #51082
|
||||
pkg go/doc/comment, type List struct, Items []*ListItem #51082
|
||||
pkg go/doc/comment, type ListItem struct #51082
|
||||
pkg go/doc/comment, type ListItem struct, Content []Block #51082
|
||||
pkg go/doc/comment, type ListItem struct, Number string #51082
|
||||
pkg go/doc/comment, type Paragraph struct #51082
|
||||
pkg go/doc/comment, type Paragraph struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Parser struct #51082
|
||||
pkg go/doc/comment, type Parser struct, LookupPackage func(string) (string, bool) #51082
|
||||
pkg go/doc/comment, type Parser struct, LookupSym func(string, string) bool #51082
|
||||
pkg go/doc/comment, type Parser struct, Words map[string]string #51082
|
||||
pkg go/doc/comment, type Plain string #51082
|
||||
pkg go/doc/comment, type Printer struct #51082
|
||||
pkg go/doc/comment, type Printer struct, DocLinkBaseURL string #51082
|
||||
pkg go/doc/comment, type Printer struct, DocLinkURL func(*DocLink) string #51082
|
||||
pkg go/doc/comment, type Printer struct, HeadingID func(*Heading) string #51082
|
||||
pkg go/doc/comment, type Printer struct, HeadingLevel int #51082
|
||||
pkg go/doc/comment, type Printer struct, TextCodePrefix string #51082
|
||||
pkg go/doc/comment, type Printer struct, TextPrefix string #51082
|
||||
pkg go/doc/comment, type Printer struct, TextWidth int #51082
|
||||
pkg go/doc/comment, type Text interface, unexported methods #51082
|
||||
pkg go/types, method (*Func) Origin() *Func #51682
|
||||
pkg go/types, method (*Var) Origin() *Var #51682
|
||||
pkg hash/maphash, func Bytes(Seed, []uint8) uint64 #42710
|
||||
pkg hash/maphash, func String(Seed, string) uint64 #42710
|
||||
pkg html/template, method (*Template) Funcs(template.FuncMap) *Template #46121
|
||||
pkg html/template, type FuncMap = template.FuncMap #46121
|
||||
pkg net/http, method (*MaxBytesError) Error() string #30715
|
||||
pkg net/http, type MaxBytesError struct #30715
|
||||
pkg net/http, type MaxBytesError struct, Limit int64 #30715
|
||||
pkg net/url, func JoinPath(string, ...string) (string, error) #47005
|
||||
pkg net/url, method (*URL) JoinPath(...string) *URL #47005
|
||||
pkg net/url, type URL struct, OmitHost bool #46059
|
||||
pkg os/exec, method (*Cmd) Environ() []string #50599
|
||||
pkg os/exec, type Cmd struct, Err error #43724
|
||||
pkg os/exec, var ErrDot error #43724
|
||||
pkg regexp/syntax, const ErrNestingDepth = "expression nests too deeply" #51684
|
||||
pkg regexp/syntax, const ErrNestingDepth ErrorCode #51684
|
||||
pkg runtime/debug, func SetMemoryLimit(int64) int64 #48409
|
||||
pkg sort, func Find(int, func(int) int) (int, bool) #50340
|
||||
pkg sync/atomic, method (*Bool) CompareAndSwap(bool, bool) bool #50860
|
||||
pkg sync/atomic, method (*Bool) Load() bool #50860
|
||||
pkg sync/atomic, method (*Bool) Store(bool) #50860
|
||||
pkg sync/atomic, method (*Bool) Swap(bool) bool #50860
|
||||
pkg sync/atomic, method (*Int32) Add(int32) int32 #50860
|
||||
pkg sync/atomic, method (*Int32) CompareAndSwap(int32, int32) bool #50860
|
||||
pkg sync/atomic, method (*Int32) Load() int32 #50860
|
||||
pkg sync/atomic, method (*Int32) Store(int32) #50860
|
||||
pkg sync/atomic, method (*Int32) Swap(int32) int32 #50860
|
||||
pkg sync/atomic, method (*Int64) Add(int64) int64 #50860
|
||||
pkg sync/atomic, method (*Int64) CompareAndSwap(int64, int64) bool #50860
|
||||
pkg sync/atomic, method (*Int64) Load() int64 #50860
|
||||
pkg sync/atomic, method (*Int64) Store(int64) #50860
|
||||
pkg sync/atomic, method (*Int64) Swap(int64) int64 #50860
|
||||
pkg sync/atomic, method (*Pointer[$0]) CompareAndSwap(*$0, *$0) bool #50860
|
||||
pkg sync/atomic, method (*Pointer[$0]) Load() *$0 #50860
|
||||
pkg sync/atomic, method (*Pointer[$0]) Store(*$0) #50860
|
||||
pkg sync/atomic, method (*Pointer[$0]) Swap(*$0) *$0 #50860
|
||||
pkg sync/atomic, method (*Uint32) Add(uint32) uint32 #50860
|
||||
pkg sync/atomic, method (*Uint32) CompareAndSwap(uint32, uint32) bool #50860
|
||||
pkg sync/atomic, method (*Uint32) Load() uint32 #50860
|
||||
pkg sync/atomic, method (*Uint32) Store(uint32) #50860
|
||||
pkg sync/atomic, method (*Uint32) Swap(uint32) uint32 #50860
|
||||
pkg sync/atomic, method (*Uint64) Add(uint64) uint64 #50860
|
||||
pkg sync/atomic, method (*Uint64) CompareAndSwap(uint64, uint64) bool #50860
|
||||
pkg sync/atomic, method (*Uint64) Load() uint64 #50860
|
||||
pkg sync/atomic, method (*Uint64) Store(uint64) #50860
|
||||
pkg sync/atomic, method (*Uint64) Swap(uint64) uint64 #50860
|
||||
pkg sync/atomic, method (*Uintptr) Add(uintptr) uintptr #50860
|
||||
pkg sync/atomic, method (*Uintptr) CompareAndSwap(uintptr, uintptr) bool #50860
|
||||
pkg sync/atomic, method (*Uintptr) Load() uintptr #50860
|
||||
pkg sync/atomic, method (*Uintptr) Store(uintptr) #50860
|
||||
pkg sync/atomic, method (*Uintptr) Swap(uintptr) uintptr #50860
|
||||
pkg sync/atomic, type Bool struct #50860
|
||||
pkg sync/atomic, type Int32 struct #50860
|
||||
pkg sync/atomic, type Int64 struct #50860
|
||||
pkg sync/atomic, type Pointer[$0 interface{}] struct #50860
|
||||
pkg sync/atomic, type Uint32 struct #50860
|
||||
pkg sync/atomic, type Uint64 struct #50860
|
||||
pkg sync/atomic, type Uintptr struct #50860
|
||||
pkg time, method (Duration) Abs() Duration #51414
|
||||
pkg time, method (Time) ZoneBounds() (Time, Time) #50062
|
||||
pkg crypto/x509, func ParseCRL //deprecated #50674
|
||||
pkg crypto/x509, func ParseDERCRL //deprecated #50674
|
||||
pkg crypto/x509, method (*Certificate) CheckCRLSignature //deprecated #50674
|
||||
pkg crypto/x509, method (*Certificate) CreateCRL //deprecated #50674
|
||||
pkg crypto/x509/pkix, type CertificateList //deprecated #50674
|
||||
pkg crypto/x509/pkix, type TBSCertificateList //deprecated #50674
|
||||
pkg go/doc, func Synopsis //deprecated #51082
|
||||
pkg go/doc, func ToHTML //deprecated #51082
|
||||
pkg go/doc, func ToText //deprecated #51082
|
||||
pkg io/ioutil, func NopCloser //deprecated #42026
|
||||
pkg io/ioutil, func ReadAll //deprecated #42026
|
||||
pkg io/ioutil, func ReadDir //deprecated #42026
|
||||
pkg io/ioutil, func ReadFile //deprecated #42026
|
||||
pkg io/ioutil, func TempDir //deprecated #42026
|
||||
pkg io/ioutil, func TempFile //deprecated #42026
|
||||
pkg io/ioutil, func WriteFile //deprecated #42026
|
||||
pkg io/ioutil, var Discard //deprecated #42026
|
||||
9165
api/go1.20.txt
9165
api/go1.20.txt
File diff suppressed because it is too large
Load Diff
421
api/go1.21.txt
421
api/go1.21.txt
@@ -1,421 +0,0 @@
|
||||
pkg bytes, func ContainsFunc([]uint8, func(int32) bool) bool #54386
|
||||
pkg bytes, method (*Buffer) AvailableBuffer() []uint8 #53685
|
||||
pkg bytes, method (*Buffer) Available() int #53685
|
||||
pkg cmp, func Compare[$0 Ordered]($0, $0) int #59488
|
||||
pkg cmp, func Less[$0 Ordered]($0, $0) bool #59488
|
||||
pkg cmp, type Ordered interface {} #59488
|
||||
pkg context, func AfterFunc(Context, func()) func() bool #57928
|
||||
pkg context, func WithDeadlineCause(Context, time.Time, error) (Context, CancelFunc) #56661
|
||||
pkg context, func WithoutCancel(Context) Context #40221
|
||||
pkg context, func WithTimeoutCause(Context, time.Duration, error) (Context, CancelFunc) #56661
|
||||
pkg crypto/elliptic, func GenerateKey //deprecated #52221
|
||||
pkg crypto/elliptic, func Marshal //deprecated #52221
|
||||
pkg crypto/elliptic, func Unmarshal //deprecated #52221
|
||||
pkg crypto/elliptic, method (*CurveParams) Add //deprecated #34648
|
||||
pkg crypto/elliptic, method (*CurveParams) Double //deprecated #34648
|
||||
pkg crypto/elliptic, method (*CurveParams) IsOnCurve //deprecated #34648
|
||||
pkg crypto/elliptic, method (*CurveParams) ScalarBaseMult //deprecated #34648
|
||||
pkg crypto/elliptic, method (*CurveParams) ScalarMult //deprecated #34648
|
||||
pkg crypto/elliptic, type Curve interface, Add //deprecated #52221
|
||||
pkg crypto/elliptic, type Curve interface, Double //deprecated #52221
|
||||
pkg crypto/elliptic, type Curve interface, IsOnCurve //deprecated #52221
|
||||
pkg crypto/elliptic, type Curve interface, ScalarBaseMult //deprecated #52221
|
||||
pkg crypto/elliptic, type Curve interface, ScalarMult //deprecated #52221
|
||||
pkg crypto/rsa, func GenerateMultiPrimeKey //deprecated #56921
|
||||
pkg crypto/rsa, type PrecomputedValues struct, CRTValues //deprecated #56921
|
||||
pkg crypto/tls, const QUICEncryptionLevelApplication = 3 #44886
|
||||
pkg crypto/tls, const QUICEncryptionLevelApplication QUICEncryptionLevel #44886
|
||||
pkg crypto/tls, const QUICEncryptionLevelEarly = 1 #60107
|
||||
pkg crypto/tls, const QUICEncryptionLevelEarly QUICEncryptionLevel #60107
|
||||
pkg crypto/tls, const QUICEncryptionLevelHandshake = 2 #44886
|
||||
pkg crypto/tls, const QUICEncryptionLevelHandshake QUICEncryptionLevel #44886
|
||||
pkg crypto/tls, const QUICEncryptionLevelInitial = 0 #44886
|
||||
pkg crypto/tls, const QUICEncryptionLevelInitial QUICEncryptionLevel #44886
|
||||
pkg crypto/tls, const QUICHandshakeDone = 7 #44886
|
||||
pkg crypto/tls, const QUICHandshakeDone QUICEventKind #44886
|
||||
pkg crypto/tls, const QUICNoEvent = 0 #44886
|
||||
pkg crypto/tls, const QUICNoEvent QUICEventKind #44886
|
||||
pkg crypto/tls, const QUICRejectedEarlyData = 6 #60107
|
||||
pkg crypto/tls, const QUICRejectedEarlyData QUICEventKind #60107
|
||||
pkg crypto/tls, const QUICSetReadSecret = 1 #44886
|
||||
pkg crypto/tls, const QUICSetReadSecret QUICEventKind #44886
|
||||
pkg crypto/tls, const QUICSetWriteSecret = 2 #44886
|
||||
pkg crypto/tls, const QUICSetWriteSecret QUICEventKind #44886
|
||||
pkg crypto/tls, const QUICTransportParameters = 4 #44886
|
||||
pkg crypto/tls, const QUICTransportParameters QUICEventKind #44886
|
||||
pkg crypto/tls, const QUICTransportParametersRequired = 5 #44886
|
||||
pkg crypto/tls, const QUICTransportParametersRequired QUICEventKind #44886
|
||||
pkg crypto/tls, const QUICWriteData = 3 #44886
|
||||
pkg crypto/tls, const QUICWriteData QUICEventKind #44886
|
||||
pkg crypto/tls, func NewResumptionState([]uint8, *SessionState) (*ClientSessionState, error) #60105
|
||||
pkg crypto/tls, func ParseSessionState([]uint8) (*SessionState, error) #60105
|
||||
pkg crypto/tls, func QUICClient(*QUICConfig) *QUICConn #44886
|
||||
pkg crypto/tls, func QUICServer(*QUICConfig) *QUICConn #44886
|
||||
pkg crypto/tls, func VersionName(uint16) string #46308
|
||||
pkg crypto/tls, method (AlertError) Error() string #44886
|
||||
pkg crypto/tls, method (*ClientSessionState) ResumptionState() ([]uint8, *SessionState, error) #60105
|
||||
pkg crypto/tls, method (*Config) DecryptTicket([]uint8, ConnectionState) (*SessionState, error) #60105
|
||||
pkg crypto/tls, method (*Config) EncryptTicket(ConnectionState, *SessionState) ([]uint8, error) #60105
|
||||
pkg crypto/tls, method (*QUICConn) Close() error #44886
|
||||
pkg crypto/tls, method (*QUICConn) ConnectionState() ConnectionState #44886
|
||||
pkg crypto/tls, method (*QUICConn) HandleData(QUICEncryptionLevel, []uint8) error #44886
|
||||
pkg crypto/tls, method (*QUICConn) NextEvent() QUICEvent #44886
|
||||
pkg crypto/tls, method (*QUICConn) SendSessionTicket(bool) error #60107
|
||||
pkg crypto/tls, method (*QUICConn) SetTransportParameters([]uint8) #44886
|
||||
pkg crypto/tls, method (*QUICConn) Start(context.Context) error #44886
|
||||
pkg crypto/tls, method (QUICEncryptionLevel) String() string #44886
|
||||
pkg crypto/tls, method (*SessionState) Bytes() ([]uint8, error) #60105
|
||||
pkg crypto/tls, type AlertError uint8 #44886
|
||||
pkg crypto/tls, type Config struct, UnwrapSession func([]uint8, ConnectionState) (*SessionState, error) #60105
|
||||
pkg crypto/tls, type Config struct, WrapSession func(ConnectionState, *SessionState) ([]uint8, error) #60105
|
||||
pkg crypto/tls, type QUICConfig struct #44886
|
||||
pkg crypto/tls, type QUICConfig struct, TLSConfig *Config #44886
|
||||
pkg crypto/tls, type QUICConn struct #44886
|
||||
pkg crypto/tls, type QUICEncryptionLevel int #44886
|
||||
pkg crypto/tls, type QUICEventKind int #44886
|
||||
pkg crypto/tls, type QUICEvent struct #44886
|
||||
pkg crypto/tls, type QUICEvent struct, Data []uint8 #44886
|
||||
pkg crypto/tls, type QUICEvent struct, Kind QUICEventKind #44886
|
||||
pkg crypto/tls, type QUICEvent struct, Level QUICEncryptionLevel #44886
|
||||
pkg crypto/tls, type QUICEvent struct, Suite uint16 #44886
|
||||
pkg crypto/tls, type SessionState struct #60105
|
||||
pkg crypto/tls, type SessionState struct, EarlyData bool #60107
|
||||
pkg crypto/tls, type SessionState struct, Extra [][]uint8 #60539
|
||||
pkg crypto/x509, type RevocationListEntry struct #53573
|
||||
pkg crypto/x509, type RevocationListEntry struct, Extensions []pkix.Extension #53573
|
||||
pkg crypto/x509, type RevocationListEntry struct, ExtraExtensions []pkix.Extension #53573
|
||||
pkg crypto/x509, type RevocationListEntry struct, Raw []uint8 #53573
|
||||
pkg crypto/x509, type RevocationListEntry struct, ReasonCode int #53573
|
||||
pkg crypto/x509, type RevocationListEntry struct, RevocationTime time.Time #53573
|
||||
pkg crypto/x509, type RevocationListEntry struct, SerialNumber *big.Int #53573
|
||||
pkg crypto/x509, type RevocationList struct, RevokedCertificateEntries []RevocationListEntry #53573
|
||||
pkg crypto/x509, type RevocationList struct, RevokedCertificates //deprecated #53573
|
||||
pkg debug/elf, const COMPRESS_ZSTD = 2 #55107
|
||||
pkg debug/elf, const COMPRESS_ZSTD CompressionType #55107
|
||||
pkg debug/elf, const DF_1_CONFALT = 8192 #56887
|
||||
pkg debug/elf, const DF_1_CONFALT DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_DIRECT = 256 #56887
|
||||
pkg debug/elf, const DF_1_DIRECT DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_DISPRELDNE = 32768 #56887
|
||||
pkg debug/elf, const DF_1_DISPRELDNE DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_DISPRELPND = 65536 #56887
|
||||
pkg debug/elf, const DF_1_DISPRELPND DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_EDITED = 2097152 #56887
|
||||
pkg debug/elf, const DF_1_EDITED DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_ENDFILTEE = 16384 #56887
|
||||
pkg debug/elf, const DF_1_ENDFILTEE DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_GLOBAL = 2 #56887
|
||||
pkg debug/elf, const DF_1_GLOBAL DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_GLOBAUDIT = 16777216 #56887
|
||||
pkg debug/elf, const DF_1_GLOBAUDIT DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_GROUP = 4 #56887
|
||||
pkg debug/elf, const DF_1_GROUP DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_IGNMULDEF = 262144 #56887
|
||||
pkg debug/elf, const DF_1_IGNMULDEF DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_INITFIRST = 32 #56887
|
||||
pkg debug/elf, const DF_1_INITFIRST DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_INTERPOSE = 1024 #56887
|
||||
pkg debug/elf, const DF_1_INTERPOSE DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_KMOD = 268435456 #56887
|
||||
pkg debug/elf, const DF_1_KMOD DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_LOADFLTR = 16 #56887
|
||||
pkg debug/elf, const DF_1_LOADFLTR DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NOCOMMON = 1073741824 #56887
|
||||
pkg debug/elf, const DF_1_NOCOMMON DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NODEFLIB = 2048 #56887
|
||||
pkg debug/elf, const DF_1_NODEFLIB DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NODELETE = 8 #56887
|
||||
pkg debug/elf, const DF_1_NODELETE DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NODIRECT = 131072 #56887
|
||||
pkg debug/elf, const DF_1_NODIRECT DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NODUMP = 4096 #56887
|
||||
pkg debug/elf, const DF_1_NODUMP DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NOHDR = 1048576 #56887
|
||||
pkg debug/elf, const DF_1_NOHDR DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NOKSYMS = 524288 #56887
|
||||
pkg debug/elf, const DF_1_NOKSYMS DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NOOPEN = 64 #56887
|
||||
pkg debug/elf, const DF_1_NOOPEN DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NORELOC = 4194304 #56887
|
||||
pkg debug/elf, const DF_1_NORELOC DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_NOW = 1 #56887
|
||||
pkg debug/elf, const DF_1_NOW DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_ORIGIN = 128 #56887
|
||||
pkg debug/elf, const DF_1_ORIGIN DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_PIE = 134217728 #56887
|
||||
pkg debug/elf, const DF_1_PIE DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_SINGLETON = 33554432 #56887
|
||||
pkg debug/elf, const DF_1_SINGLETON DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_STUB = 67108864 #56887
|
||||
pkg debug/elf, const DF_1_STUB DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_SYMINTPOSE = 8388608 #56887
|
||||
pkg debug/elf, const DF_1_SYMINTPOSE DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_TRANS = 512 #56887
|
||||
pkg debug/elf, const DF_1_TRANS DynFlag1 #56887
|
||||
pkg debug/elf, const DF_1_WEAKFILTER = 536870912 #56887
|
||||
pkg debug/elf, const DF_1_WEAKFILTER DynFlag1 #56887
|
||||
pkg debug/elf, const R_PPC64_REL24_P9NOTOC = 124 #60348
|
||||
pkg debug/elf, const R_PPC64_REL24_P9NOTOC R_PPC64 #60348
|
||||
pkg debug/elf, method (DynFlag1) GoString() string #56887
|
||||
pkg debug/elf, method (DynFlag1) String() string #56887
|
||||
pkg debug/elf, method (*File) DynValue(DynTag) ([]uint64, error) #56892
|
||||
pkg debug/elf, type DynFlag1 uint32 #56887
|
||||
pkg encoding/binary, var NativeEndian nativeEndian #57237
|
||||
pkg errors, var ErrUnsupported error #41198
|
||||
pkg flag, func BoolFunc(string, string, func(string) error) #53747
|
||||
pkg flag, method (*FlagSet) BoolFunc(string, string, func(string) error) #53747
|
||||
pkg go/ast, func IsGenerated(*File) bool #28089
|
||||
pkg go/ast, type File struct, GoVersion string #59033
|
||||
pkg go/build/constraint, func GoVersion(Expr) string #59033
|
||||
pkg go/build, type Directive struct #56986
|
||||
pkg go/build, type Directive struct, Pos token.Position #56986
|
||||
pkg go/build, type Directive struct, Text string #56986
|
||||
pkg go/build, type Package struct, Directives []Directive #56986
|
||||
pkg go/build, type Package struct, TestDirectives []Directive #56986
|
||||
pkg go/build, type Package struct, XTestDirectives []Directive #56986
|
||||
pkg go/token, method (*File) Lines() []int #57708
|
||||
pkg go/types, method (*Package) GoVersion() string #61175
|
||||
pkg html/template, const ErrJSTemplate = 12 #59584
|
||||
pkg html/template, const ErrJSTemplate ErrorCode #59584
|
||||
pkg io/fs, func FormatDirEntry(DirEntry) string #54451
|
||||
pkg io/fs, func FormatFileInfo(FileInfo) string #54451
|
||||
pkg log/slog, const KindAny = 0 #56345
|
||||
pkg log/slog, const KindAny Kind #56345
|
||||
pkg log/slog, const KindBool = 1 #56345
|
||||
pkg log/slog, const KindBool Kind #56345
|
||||
pkg log/slog, const KindDuration = 2 #56345
|
||||
pkg log/slog, const KindDuration Kind #56345
|
||||
pkg log/slog, const KindFloat64 = 3 #56345
|
||||
pkg log/slog, const KindFloat64 Kind #56345
|
||||
pkg log/slog, const KindGroup = 8 #56345
|
||||
pkg log/slog, const KindGroup Kind #56345
|
||||
pkg log/slog, const KindInt64 = 4 #56345
|
||||
pkg log/slog, const KindInt64 Kind #56345
|
||||
pkg log/slog, const KindLogValuer = 9 #56345
|
||||
pkg log/slog, const KindLogValuer Kind #56345
|
||||
pkg log/slog, const KindString = 5 #56345
|
||||
pkg log/slog, const KindString Kind #56345
|
||||
pkg log/slog, const KindTime = 6 #56345
|
||||
pkg log/slog, const KindTime Kind #56345
|
||||
pkg log/slog, const KindUint64 = 7 #56345
|
||||
pkg log/slog, const KindUint64 Kind #56345
|
||||
pkg log/slog, const LevelDebug = -4 #56345
|
||||
pkg log/slog, const LevelDebug Level #56345
|
||||
pkg log/slog, const LevelError = 8 #56345
|
||||
pkg log/slog, const LevelError Level #56345
|
||||
pkg log/slog, const LevelInfo = 0 #56345
|
||||
pkg log/slog, const LevelInfo Level #56345
|
||||
pkg log/slog, const LevelKey ideal-string #56345
|
||||
pkg log/slog, const LevelKey = "level" #56345
|
||||
pkg log/slog, const LevelWarn = 4 #56345
|
||||
pkg log/slog, const LevelWarn Level #56345
|
||||
pkg log/slog, const MessageKey ideal-string #56345
|
||||
pkg log/slog, const MessageKey = "msg" #56345
|
||||
pkg log/slog, const SourceKey ideal-string #56345
|
||||
pkg log/slog, const SourceKey = "source" #56345
|
||||
pkg log/slog, const TimeKey ideal-string #56345
|
||||
pkg log/slog, const TimeKey = "time" #56345
|
||||
pkg log/slog, func Any(string, interface{}) Attr #56345
|
||||
pkg log/slog, func AnyValue(interface{}) Value #56345
|
||||
pkg log/slog, func Bool(string, bool) Attr #56345
|
||||
pkg log/slog, func BoolValue(bool) Value #56345
|
||||
pkg log/slog, func DebugCtx(context.Context, string, ...interface{}) #56345
|
||||
pkg log/slog, func Debug(string, ...interface{}) #56345
|
||||
pkg log/slog, func Default() *Logger #56345
|
||||
pkg log/slog, func Duration(string, time.Duration) Attr #56345
|
||||
pkg log/slog, func DurationValue(time.Duration) Value #56345
|
||||
pkg log/slog, func ErrorCtx(context.Context, string, ...interface{}) #56345
|
||||
pkg log/slog, func Error(string, ...interface{}) #56345
|
||||
pkg log/slog, func Float64(string, float64) Attr #56345
|
||||
pkg log/slog, func Float64Value(float64) Value #56345
|
||||
pkg log/slog, func Group(string, ...interface{}) Attr #59204
|
||||
pkg log/slog, func GroupValue(...Attr) Value #56345
|
||||
pkg log/slog, func InfoCtx(context.Context, string, ...interface{}) #56345
|
||||
pkg log/slog, func Info(string, ...interface{}) #56345
|
||||
pkg log/slog, func Int64(string, int64) Attr #56345
|
||||
pkg log/slog, func Int64Value(int64) Value #56345
|
||||
pkg log/slog, func Int(string, int) Attr #56345
|
||||
pkg log/slog, func IntValue(int) Value #56345
|
||||
pkg log/slog, func LogAttrs(context.Context, Level, string, ...Attr) #56345
|
||||
pkg log/slog, func Log(context.Context, Level, string, ...interface{}) #56345
|
||||
pkg log/slog, func New(Handler) *Logger #56345
|
||||
pkg log/slog, func NewJSONHandler(io.Writer, *HandlerOptions) *JSONHandler #59339
|
||||
pkg log/slog, func NewLogLogger(Handler, Level) *log.Logger #56345
|
||||
pkg log/slog, func NewRecord(time.Time, Level, string, uintptr) Record #56345
|
||||
pkg log/slog, func NewTextHandler(io.Writer, *HandlerOptions) *TextHandler #59339
|
||||
pkg log/slog, func SetDefault(*Logger) #56345
|
||||
pkg log/slog, func String(string, string) Attr #56345
|
||||
pkg log/slog, func StringValue(string) Value #56345
|
||||
pkg log/slog, func Time(string, time.Time) Attr #56345
|
||||
pkg log/slog, func TimeValue(time.Time) Value #56345
|
||||
pkg log/slog, func Uint64(string, uint64) Attr #56345
|
||||
pkg log/slog, func Uint64Value(uint64) Value #56345
|
||||
pkg log/slog, func WarnCtx(context.Context, string, ...interface{}) #56345
|
||||
pkg log/slog, func Warn(string, ...interface{}) #56345
|
||||
pkg log/slog, func With(...interface{}) *Logger #56345
|
||||
pkg log/slog, method (Attr) Equal(Attr) bool #56345
|
||||
pkg log/slog, method (Attr) String() string #56345
|
||||
pkg log/slog, method (*JSONHandler) Enabled(context.Context, Level) bool #56345
|
||||
pkg log/slog, method (*JSONHandler) Handle(context.Context, Record) error #56345
|
||||
pkg log/slog, method (*JSONHandler) WithAttrs([]Attr) Handler #56345
|
||||
pkg log/slog, method (*JSONHandler) WithGroup(string) Handler #56345
|
||||
pkg log/slog, method (Kind) String() string #56345
|
||||
pkg log/slog, method (Level) Level() Level #56345
|
||||
pkg log/slog, method (Level) MarshalJSON() ([]uint8, error) #56345
|
||||
pkg log/slog, method (Level) MarshalText() ([]uint8, error) #56345
|
||||
pkg log/slog, method (Level) String() string #56345
|
||||
pkg log/slog, method (*Level) UnmarshalJSON([]uint8) error #56345
|
||||
pkg log/slog, method (*Level) UnmarshalText([]uint8) error #56345
|
||||
pkg log/slog, method (*LevelVar) Level() Level #56345
|
||||
pkg log/slog, method (*LevelVar) MarshalText() ([]uint8, error) #56345
|
||||
pkg log/slog, method (*LevelVar) Set(Level) #56345
|
||||
pkg log/slog, method (*LevelVar) String() string #56345
|
||||
pkg log/slog, method (*LevelVar) UnmarshalText([]uint8) error #56345
|
||||
pkg log/slog, method (*Logger) DebugCtx(context.Context, string, ...interface{}) #56345
|
||||
pkg log/slog, method (*Logger) Debug(string, ...interface{}) #56345
|
||||
pkg log/slog, method (*Logger) Enabled(context.Context, Level) bool #56345
|
||||
pkg log/slog, method (*Logger) ErrorCtx(context.Context, string, ...interface{}) #56345
|
||||
pkg log/slog, method (*Logger) Error(string, ...interface{}) #56345
|
||||
pkg log/slog, method (*Logger) Handler() Handler #56345
|
||||
pkg log/slog, method (*Logger) InfoCtx(context.Context, string, ...interface{}) #56345
|
||||
pkg log/slog, method (*Logger) Info(string, ...interface{}) #56345
|
||||
pkg log/slog, method (*Logger) LogAttrs(context.Context, Level, string, ...Attr) #56345
|
||||
pkg log/slog, method (*Logger) Log(context.Context, Level, string, ...interface{}) #56345
|
||||
pkg log/slog, method (*Logger) WarnCtx(context.Context, string, ...interface{}) #56345
|
||||
pkg log/slog, method (*Logger) Warn(string, ...interface{}) #56345
|
||||
pkg log/slog, method (*Logger) WithGroup(string) *Logger #56345
|
||||
pkg log/slog, method (*Logger) With(...interface{}) *Logger #56345
|
||||
pkg log/slog, method (*Record) AddAttrs(...Attr) #56345
|
||||
pkg log/slog, method (*Record) Add(...interface{}) #56345
|
||||
pkg log/slog, method (Record) Attrs(func(Attr) bool) #59060
|
||||
pkg log/slog, method (Record) Clone() Record #56345
|
||||
pkg log/slog, method (Record) NumAttrs() int #56345
|
||||
pkg log/slog, method (*TextHandler) Enabled(context.Context, Level) bool #56345
|
||||
pkg log/slog, method (*TextHandler) Handle(context.Context, Record) error #56345
|
||||
pkg log/slog, method (*TextHandler) WithAttrs([]Attr) Handler #56345
|
||||
pkg log/slog, method (*TextHandler) WithGroup(string) Handler #56345
|
||||
pkg log/slog, method (Value) Any() interface{} #56345
|
||||
pkg log/slog, method (Value) Bool() bool #56345
|
||||
pkg log/slog, method (Value) Duration() time.Duration #56345
|
||||
pkg log/slog, method (Value) Equal(Value) bool #56345
|
||||
pkg log/slog, method (Value) Float64() float64 #56345
|
||||
pkg log/slog, method (Value) Group() []Attr #56345
|
||||
pkg log/slog, method (Value) Int64() int64 #56345
|
||||
pkg log/slog, method (Value) Kind() Kind #56345
|
||||
pkg log/slog, method (Value) LogValuer() LogValuer #56345
|
||||
pkg log/slog, method (Value) Resolve() Value #56345
|
||||
pkg log/slog, method (Value) String() string #56345
|
||||
pkg log/slog, method (Value) Time() time.Time #56345
|
||||
pkg log/slog, method (Value) Uint64() uint64 #56345
|
||||
pkg log/slog, type Attr struct #56345
|
||||
pkg log/slog, type Attr struct, Key string #56345
|
||||
pkg log/slog, type Attr struct, Value Value #56345
|
||||
pkg log/slog, type Handler interface, Enabled(context.Context, Level) bool #56345
|
||||
pkg log/slog, type Handler interface { Enabled, Handle, WithAttrs, WithGroup } #56345
|
||||
pkg log/slog, type Handler interface, Handle(context.Context, Record) error #56345
|
||||
pkg log/slog, type Handler interface, WithAttrs([]Attr) Handler #56345
|
||||
pkg log/slog, type Handler interface, WithGroup(string) Handler #56345
|
||||
pkg log/slog, type HandlerOptions struct #56345
|
||||
pkg log/slog, type HandlerOptions struct, AddSource bool #56345
|
||||
pkg log/slog, type HandlerOptions struct, Level Leveler #56345
|
||||
pkg log/slog, type HandlerOptions struct, ReplaceAttr func([]string, Attr) Attr #56345
|
||||
pkg log/slog, type JSONHandler struct #56345
|
||||
pkg log/slog, type Kind int #56345
|
||||
pkg log/slog, type Leveler interface { Level } #56345
|
||||
pkg log/slog, type Leveler interface, Level() Level #56345
|
||||
pkg log/slog, type Level int #56345
|
||||
pkg log/slog, type LevelVar struct #56345
|
||||
pkg log/slog, type Logger struct #56345
|
||||
pkg log/slog, type LogValuer interface { LogValue } #56345
|
||||
pkg log/slog, type LogValuer interface, LogValue() Value #56345
|
||||
pkg log/slog, type Record struct #56345
|
||||
pkg log/slog, type Record struct, Level Level #56345
|
||||
pkg log/slog, type Record struct, Message string #56345
|
||||
pkg log/slog, type Record struct, PC uintptr #56345
|
||||
pkg log/slog, type Record struct, Time time.Time #56345
|
||||
pkg log/slog, type Source struct #59280
|
||||
pkg log/slog, type Source struct, File string #59280
|
||||
pkg log/slog, type Source struct, Function string #59280
|
||||
pkg log/slog, type Source struct, Line int #59280
|
||||
pkg log/slog, type TextHandler struct #56345
|
||||
pkg log/slog, type Value struct #56345
|
||||
pkg maps, func Clone[$0 interface{ ~map[$1]$2 }, $1 comparable, $2 interface{}]($0) $0 #57436
|
||||
pkg maps, func Copy[$0 interface{ ~map[$2]$3 }, $1 interface{ ~map[$2]$3 }, $2 comparable, $3 interface{}]($0, $1) #57436
|
||||
pkg maps, func DeleteFunc[$0 interface{ ~map[$1]$2 }, $1 comparable, $2 interface{}]($0, func($1, $2) bool) #57436
|
||||
pkg maps, func Equal[$0 interface{ ~map[$2]$3 }, $1 interface{ ~map[$2]$3 }, $2 comparable, $3 comparable]($0, $1) bool #57436
|
||||
pkg maps, func EqualFunc[$0 interface{ ~map[$2]$3 }, $1 interface{ ~map[$2]$4 }, $2 comparable, $3 interface{}, $4 interface{}]($0, $1, func($3, $4) bool) bool #57436
|
||||
pkg maps, func Keys[$0 interface{ ~map[$1]$2 }, $1 comparable, $2 interface{}]($0) []$1 #57436
|
||||
pkg maps, func Values[$0 interface{ ~map[$1]$2 }, $1 comparable, $2 interface{}]($0) []$2 #57436
|
||||
pkg math/big, method (*Int) Float64() (float64, Accuracy) #56984
|
||||
pkg net/http, method (*ProtocolError) Is(error) bool #41198
|
||||
pkg net/http, method (*ResponseController) EnableFullDuplex() error #57786
|
||||
pkg net/http, var ErrSchemeMismatch error #44855
|
||||
pkg net, method (*Dialer) MultipathTCP() bool #56539
|
||||
pkg net, method (*Dialer) SetMultipathTCP(bool) #56539
|
||||
pkg net, method (*ListenConfig) MultipathTCP() bool #56539
|
||||
pkg net, method (*ListenConfig) SetMultipathTCP(bool) #56539
|
||||
pkg net, method (*TCPConn) MultipathTCP() (bool, error) #59166
|
||||
pkg reflect, method (Value) Clear() #55002
|
||||
pkg reflect, type SliceHeader //deprecated #56906
|
||||
pkg reflect, type StringHeader //deprecated #56906
|
||||
pkg regexp, method (*Regexp) MarshalText() ([]uint8, error) #46159
|
||||
pkg regexp, method (*Regexp) UnmarshalText([]uint8) error #46159
|
||||
pkg runtime, method (*PanicNilError) Error() string #25448
|
||||
pkg runtime, method (*PanicNilError) RuntimeError() #25448
|
||||
pkg runtime, method (*Pinner) Pin(interface{}) #46787
|
||||
pkg runtime, method (*Pinner) Unpin() #46787
|
||||
pkg runtime, type PanicNilError struct #25448
|
||||
pkg runtime, type Pinner struct #46787
|
||||
pkg slices, func BinarySearch[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0, $1) (int, bool) #60091
|
||||
pkg slices, func BinarySearchFunc[$0 interface{ ~[]$1 }, $1 interface{}, $2 interface{}]($0, $2, func($1, $2) int) (int, bool) #60091
|
||||
pkg slices, func Clip[$0 interface{ ~[]$1 }, $1 interface{}]($0) $0 #57433
|
||||
pkg slices, func Clone[$0 interface{ ~[]$1 }, $1 interface{}]($0) $0 #57433
|
||||
pkg slices, func Compact[$0 interface{ ~[]$1 }, $1 comparable]($0) $0 #57433
|
||||
pkg slices, func CompactFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) bool) $0 #57433
|
||||
pkg slices, func Compare[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0, $0) int #60091
|
||||
pkg slices, func CompareFunc[$0 interface{ ~[]$2 }, $1 interface{ ~[]$3 }, $2 interface{}, $3 interface{}]($0, $1, func($2, $3) int) int #60091
|
||||
pkg slices, func Contains[$0 interface{ ~[]$1 }, $1 comparable]($0, $1) bool #57433
|
||||
pkg slices, func ContainsFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1) bool) bool #57433
|
||||
pkg slices, func Delete[$0 interface{ ~[]$1 }, $1 interface{}]($0, int, int) $0 #57433
|
||||
pkg slices, func DeleteFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1) bool) $0 #54768
|
||||
pkg slices, func Equal[$0 interface{ ~[]$1 }, $1 comparable]($0, $0) bool #57433
|
||||
pkg slices, func EqualFunc[$0 interface{ ~[]$2 }, $1 interface{ ~[]$3 }, $2 interface{}, $3 interface{}]($0, $1, func($2, $3) bool) bool #57433
|
||||
pkg slices, func Grow[$0 interface{ ~[]$1 }, $1 interface{}]($0, int) $0 #57433
|
||||
pkg slices, func Index[$0 interface{ ~[]$1 }, $1 comparable]($0, $1) int #57433
|
||||
pkg slices, func IndexFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1) bool) int #57433
|
||||
pkg slices, func Insert[$0 interface{ ~[]$1 }, $1 interface{}]($0, int, ...$1) $0 #57433
|
||||
pkg slices, func IsSorted[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0) bool #60091
|
||||
pkg slices, func IsSortedFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) bool #60091
|
||||
pkg slices, func Max[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0) $1 #60091
|
||||
pkg slices, func MaxFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) $1 #60091
|
||||
pkg slices, func Min[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0) $1 #60091
|
||||
pkg slices, func MinFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) $1 #60091
|
||||
pkg slices, func Replace[$0 interface{ ~[]$1 }, $1 interface{}]($0, int, int, ...$1) $0 #57433
|
||||
pkg slices, func Reverse[$0 interface{ ~[]$1 }, $1 interface{}]($0) #58565
|
||||
pkg slices, func Sort[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0) #60091
|
||||
pkg slices, func SortFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) #60091
|
||||
pkg slices, func SortStableFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1, $1) int) #60091
|
||||
pkg strings, func ContainsFunc(string, func(int32) bool) bool #54386
|
||||
pkg sync, func OnceFunc(func()) func() #56102
|
||||
pkg sync, func OnceValue[$0 interface{}](func() $0) func() $0 #56102
|
||||
pkg sync, func OnceValues[$0 interface{}, $1 interface{}](func() ($0, $1)) func() ($0, $1) #56102
|
||||
pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Jail int #46259
|
||||
pkg syscall (freebsd-386), type SysProcAttr struct, Jail int #46259
|
||||
pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Jail int #46259
|
||||
pkg syscall (freebsd-amd64), type SysProcAttr struct, Jail int #46259
|
||||
pkg syscall (freebsd-arm64-cgo), type SysProcAttr struct, Jail int #46259
|
||||
pkg syscall (freebsd-arm64), type SysProcAttr struct, Jail int #46259
|
||||
pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Jail int #46259
|
||||
pkg syscall (freebsd-arm), type SysProcAttr struct, Jail int #46259
|
||||
pkg syscall (freebsd-riscv64-cgo), type SysProcAttr struct, Jail int #46259
|
||||
pkg syscall (freebsd-riscv64), type SysProcAttr struct, Jail int #46259
|
||||
pkg testing, func Testing() bool #52600
|
||||
pkg testing/slogtest, func TestHandler(slog.Handler, func() []map[string]interface{}) error #56345
|
||||
pkg unicode, const Version = "15.0.0" #55079
|
||||
pkg unicode, var Cypro_Minoan *RangeTable #55079
|
||||
pkg unicode, var Kawi *RangeTable #55079
|
||||
pkg unicode, var Nag_Mundari *RangeTable #55079
|
||||
pkg unicode, var Old_Uyghur *RangeTable #55079
|
||||
pkg unicode, var Tangsa *RangeTable #55079
|
||||
pkg unicode, var Toto *RangeTable #55079
|
||||
pkg unicode, var Vithkuqi *RangeTable #55079
|
||||
@@ -49,34 +49,7 @@ 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 (darwin-amd64), const UintSize = 64
|
||||
pkg math/bits (darwin-amd64-cgo), const UintSize = 64
|
||||
pkg math/bits (freebsd-386), const UintSize = 32
|
||||
pkg math/bits (freebsd-386-cgo), const UintSize = 32
|
||||
pkg math/bits (freebsd-amd64), const UintSize = 64
|
||||
pkg math/bits (freebsd-amd64-cgo), const UintSize = 64
|
||||
pkg math/bits (freebsd-arm), const UintSize = 32
|
||||
pkg math/bits (freebsd-arm-cgo), const UintSize = 32
|
||||
pkg math/bits (linux-386), const UintSize = 32
|
||||
pkg math/bits (linux-386-cgo), const UintSize = 32
|
||||
pkg math/bits (linux-amd64), const UintSize = 64
|
||||
pkg math/bits (linux-amd64-cgo), const UintSize = 64
|
||||
pkg math/bits (linux-arm), const UintSize = 32
|
||||
pkg math/bits (linux-arm-cgo), const UintSize = 32
|
||||
pkg math/bits (netbsd-386), const UintSize = 32
|
||||
pkg math/bits (netbsd-386-cgo), const UintSize = 32
|
||||
pkg math/bits (netbsd-amd64), const UintSize = 64
|
||||
pkg math/bits (netbsd-amd64-cgo), const UintSize = 64
|
||||
pkg math/bits (netbsd-arm), const UintSize = 32
|
||||
pkg math/bits (netbsd-arm-cgo), const UintSize = 32
|
||||
pkg math/bits (netbsd-arm64), const UintSize = 64
|
||||
pkg math/bits (netbsd-arm64-cgo), const UintSize = 64
|
||||
pkg math/bits (openbsd-386), const UintSize = 32
|
||||
pkg math/bits (openbsd-386-cgo), const UintSize = 32
|
||||
pkg math/bits (openbsd-amd64), const UintSize = 64
|
||||
pkg math/bits (openbsd-amd64-cgo), const UintSize = 64
|
||||
pkg math/bits (windows-386), const UintSize = 32
|
||||
pkg math/bits (windows-amd64), const UintSize = 64
|
||||
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
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
branch: dev.inline
|
||||
branch: release-branch.go1.17
|
||||
parent-branch: master
|
||||
|
||||
@@ -125,8 +125,8 @@ 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>.
|
||||
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.
|
||||
@@ -914,6 +914,8 @@ This assembler is used by GOARCH values ppc64 and ppc64le.
|
||||
Reference: <a href="/pkg/cmd/internal/obj/ppc64">Go PPC64 Assembly Instructions Reference Manual</a>
|
||||
</p>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3 id="s390x">IBM z/Architecture, a.k.a. s390x</h3>
|
||||
|
||||
<p>
|
||||
|
||||
1240
doc/go1.17.html
Normal file
1240
doc/go1.17.html
Normal file
File diff suppressed because it is too large
Load Diff
6858
doc/go1.17_spec.html
6858
doc/go1.17_spec.html
File diff suppressed because it is too large
Load Diff
1246
doc/go1.21.html
1246
doc/go1.21.html
File diff suppressed because it is too large
Load Diff
589
doc/go_mem.html
589
doc/go_mem.html
@@ -1,6 +1,6 @@
|
||||
<!--{
|
||||
"Title": "The Go Memory Model",
|
||||
"Subtitle": "Version of June 6, 2022",
|
||||
"Subtitle": "Version of May 31, 2014",
|
||||
"Path": "/ref/mem"
|
||||
}-->
|
||||
|
||||
@@ -8,9 +8,12 @@
|
||||
p.rule {
|
||||
font-style: italic;
|
||||
}
|
||||
span.event {
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
<h2>Introduction</h2>
|
||||
|
||||
<p>
|
||||
The Go memory model specifies the conditions under which
|
||||
@@ -19,7 +22,7 @@ observe values produced by writes to the same variable in a different goroutine.
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="advice">Advice</h3>
|
||||
<h2>Advice</h2>
|
||||
|
||||
<p>
|
||||
Programs that modify data being simultaneously accessed by multiple goroutines
|
||||
@@ -41,237 +44,90 @@ you are being too clever.
|
||||
Don't be clever.
|
||||
</p>
|
||||
|
||||
<h3 id="overview">Informal Overview</h3>
|
||||
<h2>Happens Before</h2>
|
||||
|
||||
<p>
|
||||
Go approaches its memory model in much the same way as the rest of the language,
|
||||
aiming to keep the semantics simple, understandable, and useful.
|
||||
This section gives a general overview of the approach and should suffice for most programmers.
|
||||
The memory model is specified more formally in the next section.
|
||||
Within a single goroutine, reads and writes must behave
|
||||
as if they executed in the order specified by the program.
|
||||
That is, compilers and processors may reorder the reads and writes
|
||||
executed within a single goroutine only when the reordering
|
||||
does not change the behavior within that goroutine
|
||||
as defined by the language specification.
|
||||
Because of this reordering, the execution order observed
|
||||
by one goroutine may differ from the order perceived
|
||||
by another. For example, if one goroutine
|
||||
executes <code>a = 1; b = 2;</code>, another might observe
|
||||
the updated value of <code>b</code> before the updated value of <code>a</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <em>data race</em> is defined as
|
||||
a write to a memory location happening concurrently with another read or write to that same location,
|
||||
unless all the accesses involved are atomic data accesses as provided by the <code>sync/atomic</code> package.
|
||||
As noted already, programmers are strongly encouraged to use appropriate synchronization
|
||||
to avoid data races.
|
||||
In the absence of data races, Go programs behave as if all the goroutines
|
||||
were multiplexed onto a single processor.
|
||||
This property is sometimes referred to as DRF-SC: data-race-free programs
|
||||
execute in a sequentially consistent manner.
|
||||
To specify the requirements of reads and writes, we define
|
||||
<i>happens before</i>, a partial order on the execution
|
||||
of memory operations in a Go program. If event <span class="event">e<sub>1</sub></span> happens
|
||||
before event <span class="event">e<sub>2</sub></span>, then we say that <span class="event">e<sub>2</sub></span> happens after <span class="event">e<sub>1</sub></span>.
|
||||
Also, if <span class="event">e<sub>1</sub></span> does not happen before <span class="event">e<sub>2</sub></span> and does not happen
|
||||
after <span class="event">e<sub>2</sub></span>, then we say that <span class="event">e<sub>1</sub></span> and <span class="event">e<sub>2</sub></span> happen concurrently.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
Within a single goroutine, the happens-before order is the
|
||||
order expressed by the program.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
While programmers should write Go programs without data races,
|
||||
there are limitations to what a Go implementation can do in response to a data race.
|
||||
An implementation may always react to a data race by reporting the race and terminating the program.
|
||||
Otherwise, each read of a single-word-sized or sub-word-sized memory location
|
||||
must observe a value actually written to that location (perhaps by a concurrent executing goroutine)
|
||||
and not yet overwritten.
|
||||
These implementation constraints make Go more like Java or JavaScript,
|
||||
in that most races have a limited number of outcomes,
|
||||
and less like C and C++, where the meaning of any program with a race
|
||||
is entirely undefined, and the compiler may do anything at all.
|
||||
Go's approach aims to make errant programs more reliable and easier to debug,
|
||||
while still insisting that races are errors and that tools can diagnose and report them.
|
||||
A read <span class="event">r</span> of a variable <code>v</code> is <i>allowed</i> to observe a write <span class="event">w</span> to <code>v</code>
|
||||
if both of the following hold:
|
||||
</p>
|
||||
|
||||
<h2 id="model">Memory Model</h2>
|
||||
|
||||
<p>
|
||||
The following formal definition of Go's memory model closely follows
|
||||
the approach presented by Hans-J. Boehm and Sarita V. Adve in
|
||||
“<a href="https://www.hpl.hp.com/techreports/2008/HPL-2008-56.pdf">Foundations of the C++ Concurrency Memory Model</a>”,
|
||||
published in PLDI 2008.
|
||||
The definition of data-race-free programs and the guarantee of sequential consistency
|
||||
for race-free programs are equivalent to the ones in that work.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The memory model describes the requirements on program executions,
|
||||
which are made up of goroutine executions,
|
||||
which in turn are made up of memory operations.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <i>memory operation</i> is modeled by four details:
|
||||
</p>
|
||||
<ul>
|
||||
<li>its kind, indicating whether it is an ordinary data read, an ordinary data write,
|
||||
or a <i>synchronizing operation</i> such as an atomic data access,
|
||||
a mutex operation, or a channel operation,
|
||||
<li>its location in the program,
|
||||
<li>the memory location or variable being accessed, and
|
||||
<li>the values read or written by the operation.
|
||||
</ul>
|
||||
<p>
|
||||
Some memory operations are <i>read-like</i>, including read, atomic read, mutex lock, and channel receive.
|
||||
Other memory operations are <i>write-like</i>, including write, atomic write, mutex unlock, channel send, and channel close.
|
||||
Some, such as atomic compare-and-swap, are both read-like and write-like.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <i>goroutine execution</i> is modeled as a set of memory operations executed by a single goroutine.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Requirement 1</b>:
|
||||
The memory operations in each goroutine must correspond to a correct sequential execution of that goroutine,
|
||||
given the values read from and written to memory.
|
||||
That execution must be consistent with the <i>sequenced before</i> relation,
|
||||
defined as the partial order requirements set out by the <a href="/ref/spec">Go language specification</a>
|
||||
for Go's control flow constructs as well as the <a href="/ref/spec#Order_of_evaluation">order of evaluation for expressions</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A Go <i>program execution</i> is modeled as a set of goroutine executions,
|
||||
together with a mapping <i>W</i> that specifies the write-like operation that each read-like operation reads from.
|
||||
(Multiple executions of the same program can have different program executions.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Requirement 2</b>:
|
||||
For a given program execution, the mapping <i>W</i>, when limited to synchronizing operations,
|
||||
must be explainable by some implicit total order of the synchronizing operations
|
||||
that is consistent with sequencing and the values read and written by those operations.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <i>synchronized before</i> relation is a partial order on synchronizing memory operations,
|
||||
derived from <i>W</i>.
|
||||
If a synchronizing read-like memory operation <i>r</i>
|
||||
observes a synchronizing write-like memory operation <i>w</i>
|
||||
(that is, if <i>W</i>(<i>r</i>) = <i>w</i>),
|
||||
then <i>w</i> is synchronized before <i>r</i>.
|
||||
Informally, the synchronized before relation is a subset of the implied total order
|
||||
mentioned in the previous paragraph,
|
||||
limited to the information that <i>W</i> directly observes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <i>happens before</i> relation is defined as the transitive closure of the
|
||||
union of the sequenced before and synchronized before relations.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Requirement 3</b>:
|
||||
For an ordinary (non-synchronizing) data read <i>r</i> on a memory location <i>x</i>,
|
||||
<i>W</i>(<i>r</i>) must be a write <i>w</i> that is <i>visible</i> to <i>r</i>,
|
||||
where visible means that both of the following hold:
|
||||
|
||||
<ol>
|
||||
<li><i>w</i> happens before <i>r</i>.
|
||||
<li><i>w</i> does not happen before any other write <i>w'</i> (to <i>x</i>) that happens before <i>r</i>.
|
||||
<li><span class="event">r</span> does not happen before <span class="event">w</span>.</li>
|
||||
<li>There is no other write <span class="event">w'</span> to <code>v</code> that happens
|
||||
after <span class="event">w</span> but before <span class="event">r</span>.</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
A <i>read-write data race</i> on memory location <i>x</i>
|
||||
consists of a read-like memory operation <i>r</i> on <i>x</i>
|
||||
and a write-like memory operation <i>w</i> on <i>x</i>,
|
||||
at least one of which is non-synchronizing,
|
||||
which are unordered by happens before
|
||||
(that is, neither <i>r</i> happens before <i>w</i>
|
||||
nor <i>w</i> happens before <i>r</i>).
|
||||
To guarantee that a read <span class="event">r</span> of a variable <code>v</code> observes a
|
||||
particular write <span class="event">w</span> to <code>v</code>, ensure that <span class="event">w</span> is the only
|
||||
write <span class="event">r</span> is allowed to observe.
|
||||
That is, <span class="event">r</span> is <i>guaranteed</i> to observe <span class="event">w</span> if both of the following hold:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li><span class="event">w</span> happens before <span class="event">r</span>.</li>
|
||||
<li>Any other write to the shared variable <code>v</code>
|
||||
either happens before <span class="event">w</span> or after <span class="event">r</span>.</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
This pair of conditions is stronger than the first pair;
|
||||
it requires that there are no other writes happening
|
||||
concurrently with <span class="event">w</span> or <span class="event">r</span>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <i>write-write data race</i> on memory location <i>x</i>
|
||||
consists of two write-like memory operations <i>w</i> and <i>w'</i> on <i>x</i>,
|
||||
at least one of which is non-synchronizing,
|
||||
which are unordered by happens before.
|
||||
Within a single goroutine,
|
||||
there is no concurrency, so the two definitions are equivalent:
|
||||
a read <span class="event">r</span> observes the value written by the most recent write <span class="event">w</span> to <code>v</code>.
|
||||
When multiple goroutines access a shared variable <code>v</code>,
|
||||
they must use synchronization events to establish
|
||||
happens-before conditions that ensure reads observe the
|
||||
desired writes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that if there are no read-write or write-write data races on memory location <i>x</i>,
|
||||
then any read <i>r</i> on <i>x</i> has only one possible <i>W</i>(<i>r</i>):
|
||||
the single <i>w</i> that immediately precedes it in the happens before order.
|
||||
The initialization of variable <code>v</code> with the zero value
|
||||
for <code>v</code>'s type behaves as a write in the memory model.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
More generally, it can be shown that any Go program that is data-race-free,
|
||||
meaning it has no program executions with read-write or write-write data races,
|
||||
can only have outcomes explained by some sequentially consistent interleaving
|
||||
of the goroutine executions.
|
||||
(The proof is the same as Section 7 of Boehm and Adve's paper cited above.)
|
||||
This property is called DRF-SC.
|
||||
Reads and writes of values larger than a single machine word
|
||||
behave as multiple machine-word-sized operations in an
|
||||
unspecified order.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The intent of the formal definition is to match
|
||||
the DRF-SC guarantee provided to race-free programs
|
||||
by other languages, including C, C++, Java, JavaScript, Rust, and Swift.
|
||||
</p>
|
||||
<h2>Synchronization</h2>
|
||||
|
||||
<p>
|
||||
Certain Go language operations such as goroutine creation and memory allocation
|
||||
act as synchronization operations.
|
||||
The effect of these operations on the synchronized-before partial order
|
||||
is documented in the “Synchronization” section below.
|
||||
Individual packages are responsible for providing similar documentation
|
||||
for their own operations.
|
||||
</p>
|
||||
|
||||
<h2 id="restrictions">Implementation Restrictions for Programs Containing Data Races</h2>
|
||||
|
||||
<p>
|
||||
The preceding section gave a formal definition of data-race-free program execution.
|
||||
This section informally describes the semantics that implementations must provide
|
||||
for programs that do contain races.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
First, any implementation can, upon detecting a data race,
|
||||
report the race and halt execution of the program.
|
||||
Implementations using ThreadSanitizer
|
||||
(accessed with “<code>go</code> <code>build</code> <code>-race</code>”)
|
||||
do exactly this.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Otherwise, a read <i>r</i> of a memory location <i>x</i>
|
||||
that is not larger than a machine word must observe
|
||||
some write <i>w</i> such that <i>r</i> does not happen before <i>w</i>
|
||||
and there is no write <i>w'</i> such that <i>w</i> happens before <i>w'</i>
|
||||
and <i>w'</i> happens before <i>r</i>.
|
||||
That is, each read must observe a value written by a preceding or concurrent write.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Additionally, observation of acausal and “out of thin air” writes is disallowed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Reads of memory locations larger than a single machine word
|
||||
are encouraged but not required to meet the same semantics
|
||||
as word-sized memory locations,
|
||||
observing a single allowed write <i>w</i>.
|
||||
For performance reasons,
|
||||
implementations may instead treat larger operations
|
||||
as a set of individual machine-word-sized operations
|
||||
in an unspecified order.
|
||||
This means that races on multiword data structures
|
||||
can lead to inconsistent values not corresponding to a single write.
|
||||
When the values depend on the consistency
|
||||
of internal (pointer, length) or (pointer, type) pairs,
|
||||
as can be the case for interface values, maps,
|
||||
slices, and strings in most Go implementations,
|
||||
such races can in turn lead to arbitrary memory corruption.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Examples of incorrect synchronization are given in the
|
||||
“Incorrect synchronization” section below.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Examples of the limitations on implementations are given in the
|
||||
“Incorrect compilation” section below.
|
||||
</p>
|
||||
|
||||
<h2 id="synchronization">Synchronization</h2>
|
||||
|
||||
<h3 id="init">Initialization</h3>
|
||||
<h3>Initialization</h3>
|
||||
|
||||
<p>
|
||||
Program initialization runs in a single goroutine,
|
||||
@@ -285,15 +141,15 @@ If a package <code>p</code> imports package <code>q</code>, the completion of
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
The completion of all <code>init</code> functions is synchronized before
|
||||
the start of the function <code>main.main</code>.
|
||||
The start of the function <code>main.main</code> happens after
|
||||
all <code>init</code> functions have finished.
|
||||
</p>
|
||||
|
||||
<h3 id="go">Goroutine creation</h3>
|
||||
<h3>Goroutine creation</h3>
|
||||
|
||||
<p class="rule">
|
||||
The <code>go</code> statement that starts a new goroutine
|
||||
is synchronized before the start of the goroutine's execution.
|
||||
happens before the goroutine's execution begins.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -318,12 +174,11 @@ calling <code>hello</code> will print <code>"hello, world"</code>
|
||||
at some point in the future (perhaps after <code>hello</code> has returned).
|
||||
</p>
|
||||
|
||||
<h3 id="goexit">Goroutine destruction</h3>
|
||||
<h3>Goroutine destruction</h3>
|
||||
|
||||
<p>
|
||||
The exit of a goroutine is not guaranteed to be synchronized before
|
||||
any event in the program.
|
||||
For example, in this program:
|
||||
The exit of a goroutine is not guaranteed to happen before
|
||||
any event in the program. For example, in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -348,7 +203,7 @@ use a synchronization mechanism such as a lock or channel
|
||||
communication to establish a relative ordering.
|
||||
</p>
|
||||
|
||||
<h3 id="chan">Channel communication</h3>
|
||||
<h3>Channel communication</h3>
|
||||
|
||||
<p>
|
||||
Channel communication is the main method of synchronization
|
||||
@@ -358,8 +213,8 @@ usually in a different goroutine.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
A send on a channel is synchronized before the completion of the
|
||||
corresponding receive from that channel.
|
||||
A send on a channel happens before the corresponding
|
||||
receive from that channel completes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -384,13 +239,13 @@ func main() {
|
||||
|
||||
<p>
|
||||
is guaranteed to print <code>"hello, world"</code>. The write to <code>a</code>
|
||||
is sequenced before the send on <code>c</code>, which is synchronized before
|
||||
the corresponding receive on <code>c</code> completes, which is sequenced before
|
||||
happens before the send on <code>c</code>, which happens before
|
||||
the corresponding receive on <code>c</code> completes, which happens before
|
||||
the <code>print</code>.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
The closing of a channel is synchronized before a receive that returns a zero value
|
||||
The closing of a channel happens before a receive that returns a zero value
|
||||
because the channel is closed.
|
||||
</p>
|
||||
|
||||
@@ -401,8 +256,8 @@ yields a program with the same guaranteed behavior.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
A receive from an unbuffered channel is synchronized before the completion of
|
||||
the corresponding send on that channel.
|
||||
A receive from an unbuffered channel happens before
|
||||
the send on that channel completes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -428,8 +283,8 @@ func main() {
|
||||
|
||||
<p>
|
||||
is also guaranteed to print <code>"hello, world"</code>. The write to <code>a</code>
|
||||
is sequenced before the receive on <code>c</code>, which is synchronized before
|
||||
the corresponding send on <code>c</code> completes, which is sequenced
|
||||
happens before the receive on <code>c</code>, which happens before
|
||||
the corresponding send on <code>c</code> completes, which happens
|
||||
before the <code>print</code>.
|
||||
</p>
|
||||
|
||||
@@ -441,7 +296,7 @@ crash, or do something else.)
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
The <i>k</i>th receive on a channel with capacity <i>C</i> is synchronized before the completion of the <i>k</i>+<i>C</i>th send from that channel completes.
|
||||
The <i>k</i>th receive on a channel with capacity <i>C</i> happens before the <i>k</i>+<i>C</i>th send from that channel completes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -475,7 +330,7 @@ func main() {
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3 id="locks">Locks</h3>
|
||||
<h3>Locks</h3>
|
||||
|
||||
<p>
|
||||
The <code>sync</code> package implements two lock data types,
|
||||
@@ -484,7 +339,7 @@ The <code>sync</code> package implements two lock data types,
|
||||
|
||||
<p class="rule">
|
||||
For any <code>sync.Mutex</code> or <code>sync.RWMutex</code> variable <code>l</code> and <i>n</i> < <i>m</i>,
|
||||
call <i>n</i> of <code>l.Unlock()</code> is synchronized before call <i>m</i> of <code>l.Lock()</code> returns.
|
||||
call <i>n</i> of <code>l.Unlock()</code> happens before call <i>m</i> of <code>l.Lock()</code> returns.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -510,29 +365,19 @@ func main() {
|
||||
|
||||
<p>
|
||||
is guaranteed to print <code>"hello, world"</code>.
|
||||
The first call to <code>l.Unlock()</code> (in <code>f</code>) is synchronized
|
||||
The first call to <code>l.Unlock()</code> (in <code>f</code>) happens
|
||||
before the second call to <code>l.Lock()</code> (in <code>main</code>) returns,
|
||||
which is sequenced before the <code>print</code>.
|
||||
which happens before the <code>print</code>.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
For any call to <code>l.RLock</code> on a <code>sync.RWMutex</code> variable <code>l</code>,
|
||||
there is an <i>n</i> such that the <i>n</i>th call to <code>l.Unlock</code>
|
||||
is synchronized before the return from <code>l.RLock</code>,
|
||||
and the matching call to <code>l.RUnlock</code> is synchronized before the return from call <i>n</i>+1 to <code>l.Lock</code>.
|
||||
there is an <i>n</i> such that the <code>l.RLock</code> happens (returns) after call <i>n</i> to
|
||||
<code>l.Unlock</code> and the matching <code>l.RUnlock</code> happens
|
||||
before call <i>n</i>+1 to <code>l.Lock</code>.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
A successful call to <code>l.TryLock</code> (or <code>l.TryRLock</code>)
|
||||
is equivalent to a call to <code>l.Lock</code> (or <code>l.RLock</code>).
|
||||
An unsuccessful call has no synchronizing effect at all.
|
||||
As far as the memory model is concerned,
|
||||
<code>l.TryLock</code> (or <code>l.TryRLock</code>)
|
||||
may be considered to be able to return false
|
||||
even when the mutex <i>l</i> is unlocked.
|
||||
</p>
|
||||
|
||||
<h3 id="once">Once</h3>
|
||||
<h3>Once</h3>
|
||||
|
||||
<p>
|
||||
The <code>sync</code> package provides a safe mechanism for
|
||||
@@ -544,8 +389,7 @@ until <code>f()</code> has returned.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
The completion of a single call of <code>f()</code> from <code>once.Do(f)</code>
|
||||
is synchronized before the return of any call of <code>once.Do(f)</code>.
|
||||
A single call of <code>f()</code> from <code>once.Do(f)</code> happens (returns) before any call of <code>once.Do(f)</code> returns.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -580,60 +424,13 @@ The result will be that <code>"hello, world"</code> will be printed
|
||||
twice.
|
||||
</p>
|
||||
|
||||
<h3 id="atomic">Atomic Values</h3>
|
||||
<h2>Incorrect synchronization</h2>
|
||||
|
||||
<p>
|
||||
The APIs in the <a href="/pkg/sync/atomic/"><code>sync/atomic</code></a>
|
||||
package are collectively “atomic operations”
|
||||
that can be used to synchronize the execution of different goroutines.
|
||||
If the effect of an atomic operation <i>A</i> is observed by atomic operation <i>B</i>,
|
||||
then <i>A</i> is synchronized before <i>B</i>.
|
||||
All the atomic operations executed in a program behave as though executed
|
||||
in some sequentially consistent order.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The preceding definition has the same semantics as C++’s sequentially consistent atomics
|
||||
and Java’s <code>volatile</code> variables.
|
||||
</p>
|
||||
|
||||
<h3 id="finalizer">Finalizers</h3>
|
||||
|
||||
<p>
|
||||
The <a href="/pkg/runtime/"><code>runtime</code></a> package provides
|
||||
a <code>SetFinalizer</code> function that adds a finalizer to be called when
|
||||
a particular object is no longer reachable by the program.
|
||||
A call to <code>SetFinalizer(x, f)</code> is synchronized before the finalization call <code>f(x)</code>.
|
||||
</p>
|
||||
|
||||
<h3 id="more">Additional Mechanisms</h3>
|
||||
|
||||
<p>
|
||||
The <code>sync</code> package provides additional synchronization abstractions,
|
||||
including <a href="/pkg/sync/#Cond">condition variables</a>,
|
||||
<a href="/pkg/sync/#Map">lock-free maps</a>,
|
||||
<a href="/pkg/sync/#Pool">allocation pools</a>,
|
||||
and
|
||||
<a href="/pkg/sync/#WaitGroup">wait groups</a>.
|
||||
The documentation for each of these specifies the guarantees it
|
||||
makes concerning synchronization.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Other packages that provide synchronization abstractions
|
||||
should document the guarantees they make too.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="badsync">Incorrect synchronization</h2>
|
||||
|
||||
<p>
|
||||
Programs with races are incorrect and
|
||||
can exhibit non-sequentially consistent executions.
|
||||
In particular, note that a read <i>r</i> may observe the value written by any write <i>w</i>
|
||||
that executes concurrently with <i>r</i>.
|
||||
Even if this occurs, it does not imply that reads happening after <i>r</i>
|
||||
will observe writes that happened before <i>w</i>.
|
||||
Note that a read <span class="event">r</span> may observe the value written by a write <span class="event">w</span>
|
||||
that happens concurrently with <span class="event">r</span>.
|
||||
Even if this occurs, it does not imply that reads happening after <span class="event">r</span>
|
||||
will observe writes that happened before <span class="event">w</span>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -769,197 +566,3 @@ value for <code>g.msg</code>.
|
||||
In all these examples, the solution is the same:
|
||||
use explicit synchronization.
|
||||
</p>
|
||||
|
||||
<h2 id="badcompiler">Incorrect compilation</h2>
|
||||
|
||||
<p>
|
||||
The Go memory model restricts compiler optimizations as much as it does Go programs.
|
||||
Some compiler optimizations that would be valid in single-threaded programs are not valid in all Go programs.
|
||||
In particular, a compiler must not introduce writes that do not exist in the original program,
|
||||
it must not allow a single read to observe multiple values,
|
||||
and it must not allow a single write to write multiple values.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
All the following examples assume that `*p` and `*q` refer to
|
||||
memory locations accessible to multiple goroutines.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not introducing data races into race-free programs means not moving
|
||||
writes out of conditional statements in which they appear.
|
||||
For example, a compiler must not invert the conditional in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
*p = 1
|
||||
if cond {
|
||||
*p = 2
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
That is, the compiler must not rewrite the program into this one:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
*p = 2
|
||||
if !cond {
|
||||
*p = 1
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If <code>cond</code> is false and another goroutine is reading <code>*p</code>,
|
||||
then in the original program, the other goroutine can only observe any prior value of <code>*p</code> and <code>1</code>.
|
||||
In the rewritten program, the other goroutine can observe <code>2</code>, which was previously impossible.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not introducing data races also means not assuming that loops terminate.
|
||||
For example, a compiler must in general not move the accesses to <code>*p</code> or <code>*q</code>
|
||||
ahead of the loop in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
n := 0
|
||||
for e := list; e != nil; e = e.next {
|
||||
n++
|
||||
}
|
||||
i := *p
|
||||
*q = 1
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If <code>list</code> pointed to a cyclic list,
|
||||
then the original program would never access <code>*p</code> or <code>*q</code>,
|
||||
but the rewritten program would.
|
||||
(Moving `*p` ahead would be safe if the compiler can prove `*p` will not panic;
|
||||
moving `*q` ahead would also require the compiler proving that no other
|
||||
goroutine can access `*q`.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not introducing data races also means not assuming that called functions
|
||||
always return or are free of synchronization operations.
|
||||
For example, a compiler must not move the accesses to <code>*p</code> or <code>*q</code>
|
||||
ahead of the function call in this program
|
||||
(at least not without direct knowledge of the precise behavior of <code>f</code>):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
f()
|
||||
i := *p
|
||||
*q = 1
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If the call never returned, then once again the original program
|
||||
would never access <code>*p</code> or <code>*q</code>, but the rewritten program would.
|
||||
And if the call contained synchronizing operations, then the original program
|
||||
could establish happens before edges preceding the accesses
|
||||
to <code>*p</code> and <code>*q</code>, but the rewritten program would not.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not allowing a single read to observe multiple values means
|
||||
not reloading local variables from shared memory.
|
||||
For example, a compiler must not discard <code>i</code> and reload it
|
||||
a second time from <code>*p</code> in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
i := *p
|
||||
if i < 0 || i >= len(funcs) {
|
||||
panic("invalid function index")
|
||||
}
|
||||
... complex code ...
|
||||
// compiler must NOT reload i = *p here
|
||||
funcs[i]()
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If the complex code needs many registers, a compiler for single-threaded programs
|
||||
could discard <code>i</code> without saving a copy and then reload
|
||||
<code>i = *p</code> just before
|
||||
<code>funcs[i]()</code>.
|
||||
A Go compiler must not, because the value of <code>*p</code> may have changed.
|
||||
(Instead, the compiler could spill <code>i</code> to the stack.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not allowing a single write to write multiple values also means not using
|
||||
the memory where a local variable will be written as temporary storage before the write.
|
||||
For example, a compiler must not use <code>*p</code> as temporary storage in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
*p = i + *p/2
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
That is, it must not rewrite the program into this one:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
*p /= 2
|
||||
*p += i
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If <code>i</code> and <code>*p</code> start equal to 2,
|
||||
the original code does <code>*p = 3</code>,
|
||||
so a racing thread can read only 2 or 3 from <code>*p</code>.
|
||||
The rewritten code does <code>*p = 1</code> and then <code>*p = 3</code>,
|
||||
allowing a racing thread to read 1 as well.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that all these optimizations are permitted in C/C++ compilers:
|
||||
a Go compiler sharing a back end with a C/C++ compiler must take care
|
||||
to disable optimizations that are invalid for Go.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that the prohibition on introducing data races
|
||||
does not apply if the compiler can prove that the races
|
||||
do not affect correct execution on the target platform.
|
||||
For example, on essentially all CPUs, it is valid to rewrite
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
n := 0
|
||||
for i := 0; i < m; i++ {
|
||||
n += *shared
|
||||
}
|
||||
</pre>
|
||||
|
||||
into:
|
||||
|
||||
<pre>
|
||||
n := 0
|
||||
local := *shared
|
||||
for i := 0; i < m; i++ {
|
||||
n += local
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
provided it can be proved that <code>*shared</code> will not fault on access,
|
||||
because the potential added read will not affect any existing concurrent reads or writes.
|
||||
On the other hand, the rewrite would not be valid in a source-to-source translator.
|
||||
</p>
|
||||
|
||||
<h2 id="conclusion">Conclusion</h2>
|
||||
|
||||
<p>
|
||||
Go programmers writing data-race-free programs can rely on
|
||||
sequentially consistent execution of those programs,
|
||||
just as in essentially all other modern programming languages.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When it comes to programs with races,
|
||||
both programmers and compilers should remember the advice:
|
||||
don't be clever.
|
||||
</p>
|
||||
|
||||
2632
doc/go_spec.html
2632
doc/go_spec.html
File diff suppressed because it is too large
Load Diff
201
doc/godebug.md
201
doc/godebug.md
@@ -1,201 +0,0 @@
|
||||
---
|
||||
title: "Go, Backwards Compatibility, and GODEBUG"
|
||||
layout: article
|
||||
---
|
||||
|
||||
<!--
|
||||
This document is kept in the Go repo, not x/website,
|
||||
because it documents the full list of known GODEBUG settings,
|
||||
which are tied to a specific release.
|
||||
-->
|
||||
|
||||
## Introduction {#intro}
|
||||
|
||||
Go's emphasis on backwards compatibility is one of its key strengths.
|
||||
There are, however, times when we cannot maintain complete compatibility.
|
||||
If code depends on buggy (including insecure) behavior,
|
||||
then fixing the bug will break that code.
|
||||
New features can also have similar impacts:
|
||||
enabling the HTTP/2 use by the HTTP client broke programs
|
||||
connecting to servers with buggy HTTP/2 implementations.
|
||||
These kinds of changes are unavoidable and
|
||||
[permitted by the Go 1 compatibility rules](/doc/go1compat).
|
||||
Even so, Go provides a mechanism called GODEBUG to
|
||||
reduce the impact such changes have on Go developers
|
||||
using newer toolchains to compile old code.
|
||||
|
||||
A GODEBUG setting is a `key=value` pair
|
||||
that controls the execution of certain parts of a Go program.
|
||||
The environment variable `GODEBUG`
|
||||
can hold a comma-separated list of these settings.
|
||||
For example, if a Go program is running in an environment that contains
|
||||
|
||||
GODEBUG=http2client=0,http2server=0
|
||||
|
||||
then that Go program will disable the use of HTTP/2 by default in both
|
||||
the HTTP client and the HTTP server.
|
||||
It is also possible to set the default `GODEBUG` for a given program
|
||||
(discussed below).
|
||||
|
||||
When preparing any change that is permitted by Go 1 compatibility
|
||||
but may nonetheless break some existing programs,
|
||||
we first engineer the change to keep as many existing programs working as possible.
|
||||
For the remaining programs,
|
||||
we define a new GODEBUG setting that
|
||||
allows individual programs to opt back in to the old behavior.
|
||||
A GODEBUG setting may not be added if doing so is infeasible,
|
||||
but that should be extremely rare.
|
||||
|
||||
GODEBUG settings added for compatibility will be maintained
|
||||
for a minimum of two years (four Go releases).
|
||||
Some, such as `http2client` and `http2server`,
|
||||
will be maintained much longer, even indefinitely.
|
||||
|
||||
When possible, each GODEBUG setting has an associated
|
||||
[runtime/metrics](/pkg/runtime/metrics/) counter
|
||||
named `/godebug/non-default-behavior/<name>:events`
|
||||
that counts the number of times a particular program's
|
||||
behavior has changed based on a non-default value
|
||||
for that setting.
|
||||
For example, when `GODEBUG=http2client=0` is set,
|
||||
`/godebug/non-default-behavior/http2client:events`
|
||||
counts the number of HTTP transports that the program
|
||||
has configured without HTTP/2 support.
|
||||
|
||||
## Default GODEBUG Values {#default}
|
||||
|
||||
When a GODEBUG setting is not listed in the environment variable,
|
||||
its value is derived from three sources:
|
||||
the defaults for the Go toolchain used to build the program,
|
||||
amended to match the Go version listed in `go.mod`,
|
||||
and then overridden by explicit `//go:debug` lines in the program.
|
||||
|
||||
The [GODEBUG History](#history) gives the exact defaults for each Go toolchain version.
|
||||
For example, Go 1.21 introduces the `panicnil` setting,
|
||||
controlling whether `panic(nil)` is allowed;
|
||||
it defaults to `panicnil=0`, making `panic(nil)` a run-time error.
|
||||
Using `panicnil=1` restores the behavior of Go 1.20 and earlier.
|
||||
|
||||
When compiling a work module or workspace that declares
|
||||
an older Go version, the Go toolchain amends its defaults
|
||||
to match that older Go version as closely as possible.
|
||||
For example, when a Go 1.21 toolchain compiles a program,
|
||||
if the work module's `go.mod` or the workspace's `go.work`
|
||||
says `go` `1.20`, then the program defaults to `panicnil=1`,
|
||||
matching Go 1.20 instead of Go 1.21.
|
||||
|
||||
Because this method of setting GODEBUG defaults was introduced only in Go 1.21,
|
||||
programs listing versions of Go earlier than Go 1.20 are configured to match Go 1.20,
|
||||
not the older version.
|
||||
|
||||
To override these defaults, a main package's source files
|
||||
can include one or more `//go:debug` directives at the top of the file
|
||||
(preceding the `package` statement).
|
||||
Continuing the `panicnil` example, if the module or workspace is updated
|
||||
to say `go` `1.21`, the program can opt back into the old `panic(nil)`
|
||||
behavior by including this directive:
|
||||
|
||||
//go:debug panicnil=1
|
||||
|
||||
Starting in Go 1.21, the Go toolchain treats a `//go:debug` directive
|
||||
with an unrecognized GODEBUG setting as an invalid program.
|
||||
Programs with more than one `//go:debug` line for a given setting
|
||||
are also treated as invalid.
|
||||
(Older toolchains ignore `//go:debug` directives entirely.)
|
||||
|
||||
The defaults that will be compiled into a main package
|
||||
are reported by the command:
|
||||
|
||||
{{raw `
|
||||
go list -f '{{.DefaultGODEBUG}}' my/main/package
|
||||
`}}
|
||||
|
||||
Only differences from the base Go toolchain defaults are reported.
|
||||
|
||||
When testing a package, `//go:debug` lines in the `*_test.go`
|
||||
files are treated as directives for the test's main package.
|
||||
In any other context, `//go:debug` lines are ignored by the toolchain;
|
||||
`go` `vet` reports such lines as misplaced.
|
||||
|
||||
## GODEBUG History {#history}
|
||||
|
||||
This section documents the GODEBUG settings introduced and removed in each major Go release
|
||||
for compatibility reasons.
|
||||
Packages or programs may define additional settings for internal debugging purposes;
|
||||
for example,
|
||||
see the [runtime documentation](/pkg/runtime#hdr-Environment_Variables)
|
||||
and the [go command documentation](/cmd/go#hdr-Build_and_test_caching).
|
||||
|
||||
### Go 1.21
|
||||
|
||||
Go 1.21 made it a run-time error to call `panic` with a nil interface value,
|
||||
controlled by the [`panicnil` setting](/pkg/builtin/#panic).
|
||||
|
||||
Go 1.21 made it an error for html/template actions to appear inside of an ECMAScript 6
|
||||
template literal, controlled by the
|
||||
[`jstmpllitinterp` setting](/pkg/html/template#hdr-Security_Model).
|
||||
This behavior was backported to Go 1.19.8+ and Go 1.20.3+.
|
||||
|
||||
Go 1.21 introduced a limit on the maximum number of MIME headers and multipart
|
||||
forms, controlled by the
|
||||
[`multipartmaxheaders` and `multipartmaxparts` settings](/pkg/mime/multipart#hdr-Limits)
|
||||
respectively.
|
||||
This behavior was backported to Go 1.19.8+ and Go 1.20.3+.
|
||||
|
||||
There is no plan to remove any of these settings.
|
||||
|
||||
### Go 1.20
|
||||
|
||||
Go 1.20 introduced support for rejecting insecure paths in tar and zip archives,
|
||||
controlled by the [`tarinsecurepath` setting](/pkg/archive/tar/#Reader.Next)
|
||||
and the [`zipinsecurepath` setting](/pkg/archive/zip/#NewReader).
|
||||
These default to `tarinsecurepath=1` and `zipinsecurepath=1`,
|
||||
preserving the behavior of earlier versions of Go.
|
||||
A future version of Go may change the defaults to
|
||||
`tarinsecurepath=0` and `zipinsecurepath=0`.
|
||||
|
||||
Go 1.20 introduced automatic seeding of the
|
||||
[`math/rand`](/pkg/math/rand) global random number generator,
|
||||
controlled by the [`randautoseed` setting](/pkg/math/rand/#Seed).
|
||||
|
||||
Go 1.20 introduced the concept of fallback roots for use during certificate verification,
|
||||
controlled by the [`x509usefallbackroots` setting](/pkg/crypto/x509/#SetFallbackRoots).
|
||||
|
||||
Go 1.20 removed the preinstalled `.a` files for the standard library
|
||||
from the Go distribution.
|
||||
Installations now build and cache the standard library like
|
||||
packages in other modules.
|
||||
The [`installgoroot` setting](/cmd/go#hdr-Compile_and_install_packages_and_dependencies)
|
||||
restores the installation and use of preinstalled `.a` files.
|
||||
|
||||
There is no plan to remove any of these settings.
|
||||
|
||||
### Go 1.19
|
||||
|
||||
Go 1.19 made it an error for path lookups to resolve to binaries in the current directory,
|
||||
controlled by the [`execerrdot` setting](/pkg/os/exec#hdr-Executables_in_the_current_directory).
|
||||
There is no plan to remove this setting.
|
||||
|
||||
### Go 1.18
|
||||
|
||||
Go 1.18 removed support for SHA1 in most X.509 certificates,
|
||||
controlled by the [`x509sha1` setting](/crypto/x509#InsecureAlgorithmError).
|
||||
This setting will be removed in a future release, Go 1.22 at the earliest.
|
||||
|
||||
### Go 1.10
|
||||
|
||||
Go 1.10 changed how build caching worked and added test caching, along
|
||||
with the [`gocacheverify`, `gocachehash`, and `gocachetest` settings](/cmd/go/#hdr-Build_and_test_caching).
|
||||
There is no plan to remove these settings.
|
||||
|
||||
### Go 1.6
|
||||
|
||||
Go 1.6 introduced transparent support for HTTP/2,
|
||||
controlled by the [`http2client`, `http2server`, and `http2debug` settings](/pkg/net/http/#hdr-HTTP_2).
|
||||
There is no plan to remove these settings.
|
||||
|
||||
### Go 1.5
|
||||
|
||||
Go 1.5 introduced a pure Go DNS resolver,
|
||||
controlled by the [`netdns` setting](/pkg/net/#hdr-Name_Resolution).
|
||||
There is no plan to remove this setting.
|
||||
12
go.env
12
go.env
@@ -1,12 +0,0 @@
|
||||
# This file contains the initial defaults for go command configuration.
|
||||
# Values set by 'go env -w' and written to the user's go/env file override these.
|
||||
# The environment overrides everything else.
|
||||
|
||||
# Use the Go module mirror and checksum database by default.
|
||||
# See https://proxy.golang.org for details.
|
||||
GOPROXY=https://proxy.golang.org,direct
|
||||
GOSUMDB=sum.golang.org
|
||||
|
||||
# Automatically download newer toolchains as directed by go.mod files.
|
||||
# See https://go.dev/doc/toolchain for details.
|
||||
GOTOOLCHAIN=auto
|
||||
@@ -4,7 +4,7 @@ The IANA asserts that the database is in the public domain.
|
||||
|
||||
For more information, see
|
||||
https://www.iana.org/time-zones
|
||||
ftp://ftp.iana.org/tz/code/tz-link.html
|
||||
https://datatracker.ietf.org/doc/html/rfc6557
|
||||
ftp://ftp.iana.org/tz/code/tz-link.htm
|
||||
http://tools.ietf.org/html/rfc6557
|
||||
|
||||
To rebuild the archive, read and run update.bash.
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
//go:build ignore
|
||||
|
||||
// Mkzip writes a zoneinfo.zip with the content of the current directory
|
||||
// and its subdirectories, with no compression, suitable for package time.
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// go run ../../mkzip.go ../../zoneinfo.zip
|
||||
//
|
||||
// We use this program instead of 'zip -0 -r ../../zoneinfo.zip *' to get
|
||||
// a reproducible generator that does not depend on which version of the
|
||||
// external zip tool is used or the ordering of file names in a directory
|
||||
// or the current time.
|
||||
package main
|
||||
|
||||
import (
|
||||
"archive/zip"
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"hash/crc32"
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func usage() {
|
||||
fmt.Fprintf(os.Stderr, "usage: go run mkzip.go ../../zoneinfo.zip\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
func main() {
|
||||
log.SetPrefix("mkzip: ")
|
||||
log.SetFlags(0)
|
||||
flag.Usage = usage
|
||||
flag.Parse()
|
||||
args := flag.Args()
|
||||
if len(args) != 1 || !strings.HasSuffix(args[0], ".zip") {
|
||||
usage()
|
||||
}
|
||||
|
||||
var zb bytes.Buffer
|
||||
zw := zip.NewWriter(&zb)
|
||||
seen := make(map[string]bool)
|
||||
err := filepath.WalkDir(".", func(path string, d fs.DirEntry, err error) error {
|
||||
if d.IsDir() {
|
||||
return nil
|
||||
}
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if strings.HasSuffix(path, ".zip") {
|
||||
log.Fatalf("unexpected file during walk: %s", path)
|
||||
}
|
||||
name := filepath.ToSlash(path)
|
||||
w, err := zw.CreateRaw(&zip.FileHeader{
|
||||
Name: name,
|
||||
Method: zip.Store,
|
||||
CompressedSize64: uint64(len(data)),
|
||||
UncompressedSize64: uint64(len(data)),
|
||||
CRC32: crc32.ChecksumIEEE(data),
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if _, err := w.Write(data); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
seen[name] = true
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := zw.Close(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if len(seen) == 0 {
|
||||
log.Fatalf("did not find any files to add")
|
||||
}
|
||||
if !seen["US/Eastern"] {
|
||||
log.Fatalf("did not find US/Eastern to add")
|
||||
}
|
||||
if err := os.WriteFile(args[0], zb.Bytes(), 0666); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
@@ -5,82 +5,35 @@
|
||||
|
||||
# This script rebuilds the time zone files using files
|
||||
# downloaded from the ICANN/IANA distribution.
|
||||
#
|
||||
# To prepare an update for a new Go release,
|
||||
# consult https://www.iana.org/time-zones for the latest versions,
|
||||
# update CODE and DATA below, and then run
|
||||
#
|
||||
# ./update.bash -commit
|
||||
#
|
||||
# That will prepare the files and create the commit.
|
||||
#
|
||||
# To review such a commit (as the reviewer), use:
|
||||
#
|
||||
# git codereview change NNNNNN # CL number
|
||||
# cd lib/time
|
||||
# ./update.bash
|
||||
#
|
||||
# If it prints "No updates needed.", then the generated files
|
||||
# in the CL match the update.bash in the CL.
|
||||
# Consult https://www.iana.org/time-zones for the latest versions.
|
||||
|
||||
# Versions to use.
|
||||
CODE=2023c
|
||||
DATA=2023c
|
||||
CODE=2021a
|
||||
DATA=2021a
|
||||
|
||||
set -e
|
||||
|
||||
cd $(dirname $0)
|
||||
rm -rf work
|
||||
mkdir work
|
||||
go build -o work/mkzip mkzip.go # build now for correct paths in build errors
|
||||
cd work
|
||||
mkdir zoneinfo
|
||||
curl -sS -L -O https://www.iana.org/time-zones/repository/releases/tzcode$CODE.tar.gz
|
||||
curl -sS -L -O https://www.iana.org/time-zones/repository/releases/tzdata$DATA.tar.gz
|
||||
curl -L -O https://www.iana.org/time-zones/repository/releases/tzcode$CODE.tar.gz
|
||||
curl -L -O https://www.iana.org/time-zones/repository/releases/tzdata$DATA.tar.gz
|
||||
tar xzf tzcode$CODE.tar.gz
|
||||
tar xzf tzdata$DATA.tar.gz
|
||||
|
||||
if ! make CFLAGS=-DSTD_INSPIRED AWK=awk TZDIR=zoneinfo posix_only >make.out 2>&1; then
|
||||
cat make.out
|
||||
exit 2
|
||||
fi
|
||||
make CFLAGS=-DSTD_INSPIRED AWK=awk TZDIR=zoneinfo posix_only
|
||||
|
||||
cd zoneinfo
|
||||
../mkzip ../../zoneinfo.zip
|
||||
rm -f ../../zoneinfo.zip
|
||||
zip -0 -r ../../zoneinfo.zip *
|
||||
cd ../..
|
||||
|
||||
files="update.bash zoneinfo.zip"
|
||||
modified=true
|
||||
if git diff --quiet $files; then
|
||||
modified=false
|
||||
fi
|
||||
go generate time/tzdata
|
||||
|
||||
echo
|
||||
if [ "$1" = "-work" ]; then
|
||||
echo Left workspace behind in work/.
|
||||
shift
|
||||
else
|
||||
rm -rf work
|
||||
fi
|
||||
|
||||
if ! $modified; then
|
||||
echo No updates needed.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo Updated for $CODE/$DATA: $files
|
||||
|
||||
commitmsg="lib/time: update to $CODE/$DATA
|
||||
|
||||
Commit generated by update.bash.
|
||||
|
||||
For #22487.
|
||||
"
|
||||
|
||||
if [ "$1" = "-commit" ]; then
|
||||
echo "Creating commit. Run 'git reset HEAD^' to undo commit."
|
||||
echo
|
||||
git commit -m "$commitmsg" $files
|
||||
echo
|
||||
git log -n1 --stat
|
||||
echo
|
||||
fi
|
||||
echo New time zone files in zoneinfo.zip.
|
||||
|
||||
Binary file not shown.
340
misc/android/go_android_exec.go
Normal file
340
misc/android/go_android_exec.go
Normal file
@@ -0,0 +1,340 @@
|
||||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
// This program can be used as go_android_GOARCH_exec by the Go tool.
|
||||
// It executes binaries on an android device using adb.
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func run(args ...string) (string, error) {
|
||||
cmd := adbCmd(args...)
|
||||
buf := new(bytes.Buffer)
|
||||
cmd.Stdout = io.MultiWriter(os.Stdout, buf)
|
||||
// If the adb subprocess somehow hangs, go test will kill this wrapper
|
||||
// and wait for our os.Stderr (and os.Stdout) to close as a result.
|
||||
// However, if the os.Stderr (or os.Stdout) file descriptors are
|
||||
// passed on, the hanging adb subprocess will hold them open and
|
||||
// go test will hang forever.
|
||||
//
|
||||
// Avoid that by wrapping stderr, breaking the short circuit and
|
||||
// forcing cmd.Run to use another pipe and goroutine to pass
|
||||
// along stderr from adb.
|
||||
cmd.Stderr = struct{ io.Writer }{os.Stderr}
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("adb %s: %v", strings.Join(args, " "), err)
|
||||
}
|
||||
return buf.String(), nil
|
||||
}
|
||||
|
||||
func adb(args ...string) error {
|
||||
if out, err := adbCmd(args...).CombinedOutput(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "adb %s\n%s", strings.Join(args, " "), out)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func adbCmd(args ...string) *exec.Cmd {
|
||||
if flags := os.Getenv("GOANDROID_ADB_FLAGS"); flags != "" {
|
||||
args = append(strings.Split(flags, " "), args...)
|
||||
}
|
||||
return exec.Command("adb", args...)
|
||||
}
|
||||
|
||||
const (
|
||||
deviceRoot = "/data/local/tmp/go_android_exec"
|
||||
deviceGoroot = deviceRoot + "/goroot"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.SetFlags(0)
|
||||
log.SetPrefix("go_android_exec: ")
|
||||
exitCode, err := runMain()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
os.Exit(exitCode)
|
||||
}
|
||||
|
||||
func runMain() (int, error) {
|
||||
// Concurrent use of adb is flaky, so serialize adb commands.
|
||||
// See https://github.com/golang/go/issues/23795 or
|
||||
// https://issuetracker.google.com/issues/73230216.
|
||||
lockPath := filepath.Join(os.TempDir(), "go_android_exec-adb-lock")
|
||||
lock, err := os.OpenFile(lockPath, os.O_CREATE|os.O_RDWR, 0666)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
defer lock.Close()
|
||||
if err := syscall.Flock(int(lock.Fd()), syscall.LOCK_EX); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// In case we're booting a device or emulator alongside all.bash, wait for
|
||||
// it to be ready. adb wait-for-device is not enough, we have to
|
||||
// wait for sys.boot_completed.
|
||||
if err := adb("wait-for-device", "exec-out", "while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;"); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// Done once per make.bash.
|
||||
if err := adbCopyGoroot(); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// Prepare a temporary directory that will be cleaned up at the end.
|
||||
// Binary names can conflict.
|
||||
// E.g. template.test from the {html,text}/template packages.
|
||||
binName := filepath.Base(os.Args[1])
|
||||
deviceGotmp := fmt.Sprintf(deviceRoot+"/%s-%d", binName, os.Getpid())
|
||||
deviceGopath := deviceGotmp + "/gopath"
|
||||
defer adb("exec-out", "rm", "-rf", deviceGotmp) // Clean up.
|
||||
|
||||
// Determine the package by examining the current working
|
||||
// directory, which will look something like
|
||||
// "$GOROOT/src/mime/multipart" or "$GOPATH/src/golang.org/x/mobile".
|
||||
// We extract everything after the $GOROOT or $GOPATH to run on the
|
||||
// same relative directory on the target device.
|
||||
subdir, inGoRoot, err := subdir()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
deviceCwd := filepath.Join(deviceGopath, subdir)
|
||||
if inGoRoot {
|
||||
deviceCwd = filepath.Join(deviceGoroot, subdir)
|
||||
} else {
|
||||
if err := adb("exec-out", "mkdir", "-p", deviceCwd); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if err := adbCopyTree(deviceCwd, subdir); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// Copy .go files from the package.
|
||||
goFiles, err := filepath.Glob("*.go")
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if len(goFiles) > 0 {
|
||||
args := append(append([]string{"push"}, goFiles...), deviceCwd)
|
||||
if err := adb(args...); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deviceBin := fmt.Sprintf("%s/%s", deviceGotmp, binName)
|
||||
if err := adb("push", os.Args[1], deviceBin); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// Forward SIGQUIT from the go command to show backtraces from
|
||||
// the binary instead of from this wrapper.
|
||||
quit := make(chan os.Signal, 1)
|
||||
signal.Notify(quit, syscall.SIGQUIT)
|
||||
go func() {
|
||||
for range quit {
|
||||
// We don't have the PID of the running process; use the
|
||||
// binary name instead.
|
||||
adb("exec-out", "killall -QUIT "+binName)
|
||||
}
|
||||
}()
|
||||
// In light of
|
||||
// https://code.google.com/p/android/issues/detail?id=3254
|
||||
// dont trust the exitcode of adb. Instead, append the exitcode to
|
||||
// the output and parse it from there.
|
||||
const exitstr = "exitcode="
|
||||
cmd := `export TMPDIR="` + deviceGotmp + `"` +
|
||||
`; export GOROOT="` + deviceGoroot + `"` +
|
||||
`; export GOPATH="` + deviceGopath + `"` +
|
||||
`; export CGO_ENABLED=0` +
|
||||
`; export GOPROXY=` + os.Getenv("GOPROXY") +
|
||||
`; export GOCACHE="` + deviceRoot + `/gocache"` +
|
||||
`; export PATH=$PATH:"` + deviceGoroot + `/bin"` +
|
||||
`; cd "` + deviceCwd + `"` +
|
||||
"; '" + deviceBin + "' " + strings.Join(os.Args[2:], " ") +
|
||||
"; echo -n " + exitstr + "$?"
|
||||
output, err := run("exec-out", cmd)
|
||||
signal.Reset(syscall.SIGQUIT)
|
||||
close(quit)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
exitIdx := strings.LastIndex(output, exitstr)
|
||||
if exitIdx == -1 {
|
||||
return 0, fmt.Errorf("no exit code: %q", output)
|
||||
}
|
||||
code, err := strconv.Atoi(output[exitIdx+len(exitstr):])
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("bad exit code: %v", err)
|
||||
}
|
||||
return code, nil
|
||||
}
|
||||
|
||||
// subdir determines the package based on the current working directory,
|
||||
// and returns the path to the package source relative to $GOROOT (or $GOPATH).
|
||||
func subdir() (pkgpath string, underGoRoot bool, err error) {
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return "", false, err
|
||||
}
|
||||
cwd, err = filepath.EvalSymlinks(cwd)
|
||||
if err != nil {
|
||||
return "", false, err
|
||||
}
|
||||
goroot, err := filepath.EvalSymlinks(runtime.GOROOT())
|
||||
if err != nil {
|
||||
return "", false, err
|
||||
}
|
||||
if subdir, err := filepath.Rel(goroot, cwd); err == nil {
|
||||
if !strings.Contains(subdir, "..") {
|
||||
return subdir, true, nil
|
||||
}
|
||||
}
|
||||
|
||||
for _, p := range filepath.SplitList(build.Default.GOPATH) {
|
||||
pabs, err := filepath.EvalSymlinks(p)
|
||||
if err != nil {
|
||||
return "", false, err
|
||||
}
|
||||
if subdir, err := filepath.Rel(pabs, cwd); err == nil {
|
||||
if !strings.Contains(subdir, "..") {
|
||||
return subdir, false, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return "", false, fmt.Errorf("the current path %q is not in either GOROOT(%q) or GOPATH(%q)",
|
||||
cwd, runtime.GOROOT(), build.Default.GOPATH)
|
||||
}
|
||||
|
||||
// adbCopyTree copies testdata, go.mod, go.sum files from subdir
|
||||
// and from parent directories all the way up to the root of subdir.
|
||||
// go.mod and go.sum files are needed for the go tool modules queries,
|
||||
// and the testdata directories for tests. It is common for tests to
|
||||
// reach out into testdata from parent packages.
|
||||
func adbCopyTree(deviceCwd, subdir string) error {
|
||||
dir := ""
|
||||
for {
|
||||
for _, path := range []string{"testdata", "go.mod", "go.sum"} {
|
||||
path := filepath.Join(dir, path)
|
||||
if _, err := os.Stat(path); err != nil {
|
||||
continue
|
||||
}
|
||||
devicePath := filepath.Join(deviceCwd, dir)
|
||||
if err := adb("exec-out", "mkdir", "-p", devicePath); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := adb("push", path, devicePath); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if subdir == "." {
|
||||
break
|
||||
}
|
||||
subdir = filepath.Dir(subdir)
|
||||
dir = filepath.Join(dir, "..")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// adbCopyGoroot clears deviceRoot for previous versions of GOROOT, GOPATH
|
||||
// and temporary data. Then, it copies relevant parts of GOROOT to the device,
|
||||
// including the go tool built for android.
|
||||
// A lock file ensures this only happens once, even with concurrent exec
|
||||
// wrappers.
|
||||
func adbCopyGoroot() error {
|
||||
// Also known by cmd/dist. The bootstrap command deletes the file.
|
||||
statPath := filepath.Join(os.TempDir(), "go_android_exec-adb-sync-status")
|
||||
stat, err := os.OpenFile(statPath, os.O_CREATE|os.O_RDWR, 0666)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer stat.Close()
|
||||
// Serialize check and copying.
|
||||
if err := syscall.Flock(int(stat.Fd()), syscall.LOCK_EX); err != nil {
|
||||
return err
|
||||
}
|
||||
s, err := io.ReadAll(stat)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if string(s) == "done" {
|
||||
return nil
|
||||
}
|
||||
// Delete GOROOT, GOPATH and any leftover test data.
|
||||
if err := adb("exec-out", "rm", "-rf", deviceRoot); err != nil {
|
||||
return err
|
||||
}
|
||||
deviceBin := filepath.Join(deviceGoroot, "bin")
|
||||
if err := adb("exec-out", "mkdir", "-p", deviceBin); err != nil {
|
||||
return err
|
||||
}
|
||||
goroot := runtime.GOROOT()
|
||||
// Build go for android.
|
||||
goCmd := filepath.Join(goroot, "bin", "go")
|
||||
tmpGo, err := os.CreateTemp("", "go_android_exec-cmd-go-*")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tmpGo.Close()
|
||||
defer os.Remove(tmpGo.Name())
|
||||
|
||||
if out, err := exec.Command(goCmd, "build", "-o", tmpGo.Name(), "cmd/go").CombinedOutput(); err != nil {
|
||||
return fmt.Errorf("failed to build go tool for device: %s\n%v", out, err)
|
||||
}
|
||||
deviceGo := filepath.Join(deviceBin, "go")
|
||||
if err := adb("push", tmpGo.Name(), deviceGo); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, dir := range []string{"src", "test", "lib", "api"} {
|
||||
if err := adb("push", filepath.Join(goroot, dir), filepath.Join(deviceGoroot)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Copy only the relevant from pkg.
|
||||
if err := adb("exec-out", "mkdir", "-p", filepath.Join(deviceGoroot, "pkg", "tool")); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := adb("push", filepath.Join(goroot, "pkg", "include"), filepath.Join(deviceGoroot, "pkg")); err != nil {
|
||||
return err
|
||||
}
|
||||
runtimea, err := exec.Command(goCmd, "list", "-f", "{{.Target}}", "runtime").Output()
|
||||
pkgdir := filepath.Dir(string(runtimea))
|
||||
if pkgdir == "" {
|
||||
return errors.New("could not find android pkg dir")
|
||||
}
|
||||
if err := adb("push", pkgdir, filepath.Join(deviceGoroot, "pkg")); err != nil {
|
||||
return err
|
||||
}
|
||||
tooldir := filepath.Join(goroot, "pkg", "tool", filepath.Base(pkgdir))
|
||||
if err := adb("push", tooldir, filepath.Join(deviceGoroot, "pkg", "tool")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := stat.Write([]byte("done")); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
58
misc/arm/a
Executable file
58
misc/arm/a
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2010 The Go Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
# This is a small script for executing go binaries on the android platform.
|
||||
#
|
||||
# example:
|
||||
# ./a 5.out foo bar baz
|
||||
#
|
||||
# The script exports the local values of GOARCH, GOTRACEBACK and GOGC
|
||||
# to the android environment.
|
||||
#
|
||||
# Known issues:
|
||||
# The script fails unless the last character output by the program is "\n"
|
||||
#
|
||||
# TODO(kaib): add gdb bridge support
|
||||
|
||||
exp ()
|
||||
{
|
||||
if [ ${!1} ]; then
|
||||
echo "export $1=\"${!1}\"; "
|
||||
fi
|
||||
}
|
||||
|
||||
# adb does not correctly return the exit value of the executed program. use this
|
||||
# wrapper to manually extract the exit value
|
||||
rloc=/data/local/tmp/retval
|
||||
rsize=$(adb shell "ls -l $rloc"|tr -s ' '|cut -d' ' -f4)
|
||||
rcheck=38
|
||||
if [ "$rsize" != "$rcheck" ]; then
|
||||
# echo "debug: retval size incorrect want $rcheck, got $rsize. uploading"
|
||||
echo >/tmp/adb.retval '#!/system/bin/sh
|
||||
"$@"
|
||||
echo RETVAL: $?'
|
||||
adb push /tmp/adb.retval $rloc >/dev/null 2>&1
|
||||
adb shell chmod 755 $rloc
|
||||
fi
|
||||
|
||||
# run the main binary
|
||||
if [ "-g" == "$1" ]; then
|
||||
adb forward tcp:$2 tcp:$2
|
||||
args=$(echo $*| cut -d' ' -f4-)
|
||||
adb push $3 /data/local/tmp/$3 >/dev/null 2>&1
|
||||
adb shell "$(exp GOARCH) $(exp GOTRACEBACK) $(exp GOGC) \
|
||||
gdbserver :$2 /data/local/tmp/retval /data/local/tmp/$3 $args" \
|
||||
2>&1|tr -d '\r' |tee /tmp/adb.out|grep -v RETVAL
|
||||
else
|
||||
if [ "$*" != "$1" ]; then
|
||||
args=$(echo $*| cut -d' ' -f2-)
|
||||
fi
|
||||
adb push $1 /data/local/tmp/$1 >/dev/null 2>&1
|
||||
adb shell "$(exp GOARCH) $(exp GOTRACEBACK) $(exp GOGC) \
|
||||
/data/local/tmp/retval /data/local/tmp/$1 $args" \
|
||||
2>&1|tr -d '\r' |tee /tmp/adb.out|grep -v RETVAL
|
||||
fi
|
||||
exit $(grep RETVAL /tmp/adb.out|tr -d '\n\r'| cut -d' ' -f2)
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"go/ast"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"internal/testenv"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -66,9 +66,6 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor {
|
||||
}
|
||||
|
||||
func TestArgumentsPositions(t *testing.T) {
|
||||
testenv.MustHaveCGO(t)
|
||||
testenv.MustHaveExec(t)
|
||||
|
||||
testdata, err := filepath.Abs("testdata")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -91,7 +88,7 @@ func TestArgumentsPositions(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v\n%s", cmd, err, cmd.Stderr)
|
||||
}
|
||||
mainProcessed, err := os.ReadFile(filepath.Join(dir, "issue42580.cgo1.go"))
|
||||
mainProcessed, err := ioutil.ReadFile(filepath.Join(dir, "issue42580.cgo1.go"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -6,8 +6,6 @@ package errorstest
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"cmd/internal/quoted"
|
||||
"internal/testenv"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -41,9 +39,6 @@ func main() {
|
||||
`
|
||||
|
||||
func TestBadSymbol(t *testing.T) {
|
||||
testenv.MustHaveGoBuild(t)
|
||||
testenv.MustHaveCGO(t)
|
||||
|
||||
dir := t.TempDir()
|
||||
|
||||
mkdir := func(base string) string {
|
||||
@@ -172,14 +167,7 @@ func TestBadSymbol(t *testing.T) {
|
||||
}
|
||||
|
||||
func cCompilerCmd(t *testing.T) []string {
|
||||
cc, err := quoted.Split(goEnv(t, "CC"))
|
||||
if err != nil {
|
||||
t.Skipf("parsing go env CC: %s", err)
|
||||
}
|
||||
if len(cc) == 0 {
|
||||
t.Skipf("no C compiler")
|
||||
}
|
||||
testenv.MustHaveExecPath(t, cc[0])
|
||||
cc := []string{goEnv(t, "CC")}
|
||||
|
||||
out := goEnv(t, "GOGCCFLAGS")
|
||||
quote := '\000'
|
||||
@@ -213,10 +201,6 @@ func cCompilerCmd(t *testing.T) []string {
|
||||
if !lastSpace {
|
||||
cc = append(cc, s[start:])
|
||||
}
|
||||
|
||||
// Force reallocation (and avoid aliasing bugs) for tests that append to cc.
|
||||
cc = cc[:len(cc):len(cc)]
|
||||
|
||||
return cc
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ package errorstest
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"internal/testenv"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -23,8 +22,6 @@ func path(file string) string {
|
||||
|
||||
func check(t *testing.T, file string) {
|
||||
t.Run(file, func(t *testing.T) {
|
||||
testenv.MustHaveGoBuild(t)
|
||||
testenv.MustHaveCGO(t)
|
||||
t.Parallel()
|
||||
|
||||
contents, err := os.ReadFile(path(file))
|
||||
@@ -39,13 +36,14 @@ func check(t *testing.T, file string) {
|
||||
continue
|
||||
}
|
||||
|
||||
_, frag, ok := bytes.Cut(line, []byte("ERROR HERE: "))
|
||||
if !ok {
|
||||
frags := bytes.SplitAfterN(line, []byte("ERROR HERE: "), 2)
|
||||
if len(frags) == 1 {
|
||||
continue
|
||||
}
|
||||
re, err := regexp.Compile(fmt.Sprintf(":%d:.*%s", i+1, frag))
|
||||
frag := fmt.Sprintf(":%d:.*%s", i+1, frags[1])
|
||||
re, err := regexp.Compile(frag)
|
||||
if err != nil {
|
||||
t.Errorf("Invalid regexp after `ERROR HERE: `: %#q", frag)
|
||||
t.Errorf("Invalid regexp after `ERROR HERE: `: %#q", frags[1])
|
||||
continue
|
||||
}
|
||||
errors = append(errors, re)
|
||||
@@ -92,8 +90,6 @@ func expect(t *testing.T, file string, errors []*regexp.Regexp) {
|
||||
}
|
||||
|
||||
func sizeofLongDouble(t *testing.T) int {
|
||||
testenv.MustHaveGoRun(t)
|
||||
testenv.MustHaveCGO(t)
|
||||
cmd := exec.Command("go", "run", path("long_double_size.go"))
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
@@ -117,7 +113,6 @@ func TestReportsTypeErrors(t *testing.T) {
|
||||
"issue18889.go",
|
||||
"issue28721.go",
|
||||
"issue33061.go",
|
||||
"issue50710.go",
|
||||
} {
|
||||
check(t, file)
|
||||
}
|
||||
@@ -139,8 +134,6 @@ func TestToleratesOptimizationFlag(t *testing.T) {
|
||||
} {
|
||||
cflags := cflags
|
||||
t.Run(cflags, func(t *testing.T) {
|
||||
testenv.MustHaveGoBuild(t)
|
||||
testenv.MustHaveCGO(t)
|
||||
t.Parallel()
|
||||
|
||||
cmd := exec.Command("go", "build", path("issue14669.go"))
|
||||
@@ -154,8 +147,6 @@ func TestToleratesOptimizationFlag(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMallocCrashesOnNil(t *testing.T) {
|
||||
testenv.MustHaveCGO(t)
|
||||
testenv.MustHaveGoRun(t)
|
||||
t.Parallel()
|
||||
|
||||
cmd := exec.Command("go", "run", path("malloc.go"))
|
||||
@@ -10,12 +10,9 @@ import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"internal/testenv"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
@@ -164,17 +161,6 @@ var ptrTests = []ptrTest{
|
||||
fail: true,
|
||||
expensive: true,
|
||||
},
|
||||
{
|
||||
// Storing a pinned Go pointer into C memory should succeed.
|
||||
name: "barrierpinnedok",
|
||||
c: `#include <stdlib.h>
|
||||
char **f14a2() { return malloc(sizeof(char*)); }
|
||||
void f14b2(char **p) {}`,
|
||||
imports: []string{"runtime"},
|
||||
body: `var pinr runtime.Pinner; p := C.f14a2(); x := new(C.char); pinr.Pin(x); *p = x; C.f14b2(p); pinr.Unpin()`,
|
||||
fail: false,
|
||||
expensive: true,
|
||||
},
|
||||
{
|
||||
// Storing a Go pointer into C memory by assigning a
|
||||
// large value should fail.
|
||||
@@ -445,54 +431,10 @@ var ptrTests = []ptrTest{
|
||||
body: `s := &S40{p: new(int)}; C.f40((*C.struct_S40i)(&s.a))`,
|
||||
fail: false,
|
||||
},
|
||||
{
|
||||
// Test that we handle unsafe.StringData.
|
||||
name: "stringdata",
|
||||
c: `void f41(void* p) {}`,
|
||||
imports: []string{"unsafe"},
|
||||
body: `s := struct { a [4]byte; p *int }{p: new(int)}; str := unsafe.String(&s.a[0], 4); C.f41(unsafe.Pointer(unsafe.StringData(str)))`,
|
||||
fail: false,
|
||||
},
|
||||
{
|
||||
name: "slicedata",
|
||||
c: `void f42(void* p) {}`,
|
||||
imports: []string{"unsafe"},
|
||||
body: `s := []*byte{nil, new(byte)}; C.f42(unsafe.Pointer(unsafe.SliceData(s)))`,
|
||||
fail: true,
|
||||
},
|
||||
{
|
||||
name: "slicedata2",
|
||||
c: `void f43(void* p) {}`,
|
||||
imports: []string{"unsafe"},
|
||||
body: `s := struct { a [4]byte; p *int }{p: new(int)}; C.f43(unsafe.Pointer(unsafe.SliceData(s.a[:])))`,
|
||||
fail: false,
|
||||
},
|
||||
}
|
||||
|
||||
func TestPointerChecks(t *testing.T) {
|
||||
testenv.MustHaveGoBuild(t)
|
||||
testenv.MustHaveCGO(t)
|
||||
if runtime.GOOS == "windows" {
|
||||
// TODO: Skip just the cases that fail?
|
||||
t.Skipf("some tests fail to build on %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
var gopath string
|
||||
var dir string
|
||||
if *tmp != "" {
|
||||
gopath = *tmp
|
||||
dir = ""
|
||||
} else {
|
||||
d, err := os.MkdirTemp("", filepath.Base(t.Name()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
dir = d
|
||||
gopath = d
|
||||
}
|
||||
|
||||
exe := buildPtrTests(t, gopath, false)
|
||||
exe2 := buildPtrTests(t, gopath, true)
|
||||
dir, exe := buildPtrTests(t)
|
||||
|
||||
// We (TestPointerChecks) return before the parallel subtest functions do,
|
||||
// so we can't just defer os.RemoveAll(dir). Instead we have to wait for
|
||||
@@ -509,18 +451,30 @@ func TestPointerChecks(t *testing.T) {
|
||||
os.RemoveAll(dir)
|
||||
}
|
||||
}()
|
||||
testOne(t, pt, exe, exe2)
|
||||
testOne(t, pt, exe)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func buildPtrTests(t *testing.T, gopath string, cgocheck2 bool) (exe string) {
|
||||
func buildPtrTests(t *testing.T) (dir, exe string) {
|
||||
var gopath string
|
||||
if *tmp != "" {
|
||||
gopath = *tmp
|
||||
dir = ""
|
||||
} else {
|
||||
d, err := os.MkdirTemp("", filepath.Base(t.Name()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
dir = d
|
||||
gopath = d
|
||||
}
|
||||
|
||||
src := filepath.Join(gopath, "src", "ptrtest")
|
||||
if err := os.MkdirAll(src, 0777); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest\ngo 1.20"), 0666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest"), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -587,38 +541,15 @@ func buildPtrTests(t *testing.T, gopath string, cgocheck2 bool) (exe string) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
exeName := "ptrtest.exe"
|
||||
if cgocheck2 {
|
||||
exeName = "ptrtest2.exe"
|
||||
}
|
||||
cmd := exec.Command("go", "build", "-o", exeName)
|
||||
cmd := exec.Command("go", "build", "-o", "ptrtest.exe")
|
||||
cmd.Dir = src
|
||||
cmd.Env = append(os.Environ(), "GOPATH="+gopath)
|
||||
|
||||
// Set or remove cgocheck2 from the environment.
|
||||
goexperiment := strings.Split(os.Getenv("GOEXPERIMENT"), ",")
|
||||
if len(goexperiment) == 1 && goexperiment[0] == "" {
|
||||
goexperiment = nil
|
||||
}
|
||||
i := slices.Index(goexperiment, "cgocheck2")
|
||||
changed := false
|
||||
if cgocheck2 && i < 0 {
|
||||
goexperiment = append(goexperiment, "cgocheck2")
|
||||
changed = true
|
||||
} else if !cgocheck2 && i >= 0 {
|
||||
goexperiment = append(goexperiment[:i], goexperiment[i+1:]...)
|
||||
changed = true
|
||||
}
|
||||
if changed {
|
||||
cmd.Env = append(cmd.Env, "GOEXPERIMENT="+strings.Join(goexperiment, ","))
|
||||
}
|
||||
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("go build: %v\n%s", err, out)
|
||||
}
|
||||
|
||||
return filepath.Join(src, exeName)
|
||||
return dir, filepath.Join(src, "ptrtest.exe")
|
||||
}
|
||||
|
||||
const ptrTestMain = `
|
||||
@@ -635,7 +566,7 @@ func main() {
|
||||
|
||||
var csem = make(chan bool, 16)
|
||||
|
||||
func testOne(t *testing.T, pt ptrTest, exe, exe2 string) {
|
||||
func testOne(t *testing.T, pt ptrTest, exe string) {
|
||||
t.Parallel()
|
||||
|
||||
// Run the tests in parallel, but don't run too many
|
||||
@@ -643,12 +574,7 @@ func testOne(t *testing.T, pt ptrTest, exe, exe2 string) {
|
||||
runcmd := func(cgocheck string) ([]byte, error) {
|
||||
csem <- true
|
||||
defer func() { <-csem }()
|
||||
x := exe
|
||||
if cgocheck == "2" {
|
||||
x = exe2
|
||||
cgocheck = "1"
|
||||
}
|
||||
cmd := exec.Command(x, pt.name)
|
||||
cmd := exec.Command(exe, pt.name)
|
||||
cmd.Env = append(os.Environ(), "GODEBUG=cgocheck="+cgocheck)
|
||||
return cmd.CombinedOutput()
|
||||
}
|
||||
@@ -91,18 +91,10 @@ func main() {
|
||||
|
||||
// issue 26745
|
||||
_ = func(i int) int {
|
||||
// typecheck reports at column 14 ('+'), but types2 reports at
|
||||
// column 10 ('C').
|
||||
// TODO(mdempsky): Investigate why, and see if types2 can be
|
||||
// updated to match typecheck behavior.
|
||||
return C.i + 1 // ERROR HERE: \b(10|14)\b
|
||||
return C.i + 1 // ERROR HERE: 14
|
||||
}
|
||||
_ = func(i int) {
|
||||
// typecheck reports at column 7 ('('), but types2 reports at
|
||||
// column 8 ('i'). The types2 position is more correct, but
|
||||
// updating typecheck here is fundamentally challenging because of
|
||||
// IR limitations.
|
||||
C.fi(i) // ERROR HERE: \b(7|8)\b
|
||||
C.fi(i) // ERROR HERE: 7
|
||||
}
|
||||
|
||||
C.fi = C.fi // ERROR HERE
|
||||
12
misc/cgo/fortran/fortran.go
Normal file
12
misc/cgo/fortran/fortran.go
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package fortran
|
||||
|
||||
// int the_answer();
|
||||
import "C"
|
||||
|
||||
func TheAnswer() int {
|
||||
return int(C.the_answer())
|
||||
}
|
||||
13
misc/cgo/fortran/fortran_test.go
Normal file
13
misc/cgo/fortran/fortran_test.go
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package fortran
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFortran(t *testing.T) {
|
||||
if a := TheAnswer(); a != 42 {
|
||||
t.Errorf("Unexpected result for The Answer. Got: %d Want: 42", a)
|
||||
}
|
||||
}
|
||||
44
misc/cgo/fortran/test.bash
Executable file
44
misc/cgo/fortran/test.bash
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2016 The Go Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
# This directory is intended to test the use of Fortran with cgo.
|
||||
|
||||
set -e
|
||||
|
||||
FC=$1
|
||||
|
||||
goos=$(go env GOOS)
|
||||
|
||||
libext="so"
|
||||
if [ "$goos" = "darwin" ]; then
|
||||
libext="dylib"
|
||||
elif [ "$goos" = "aix" ]; then
|
||||
libtext="a"
|
||||
fi
|
||||
|
||||
case "$FC" in
|
||||
*gfortran*)
|
||||
libpath=$(dirname $($FC -print-file-name=libgfortran.$libext))
|
||||
if [ "$goos" != "aix" ]; then
|
||||
RPATH_FLAG="-Wl,-rpath,$libpath"
|
||||
fi
|
||||
export CGO_LDFLAGS="$CGO_LDFLAGS $RPATH_FLAG -L $libpath"
|
||||
;;
|
||||
esac
|
||||
|
||||
if ! $FC helloworld/helloworld.f90 -o /dev/null >& /dev/null; then
|
||||
echo "skipping Fortran test: could not build helloworld.f90 with $FC"
|
||||
exit 0
|
||||
fi
|
||||
rm -f main.exe
|
||||
|
||||
status=0
|
||||
|
||||
if ! go test; then
|
||||
echo "FAIL: go test"
|
||||
status=1
|
||||
fi
|
||||
|
||||
exit $status
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// Compute Fibonacci numbers with two goroutines
|
||||
// that pass integers back and forth. No actual
|
||||
|
||||
@@ -333,9 +333,10 @@ func (z *Int) Abs(x *Int) *Int {
|
||||
|
||||
// CmpInt compares x and y. The result is
|
||||
//
|
||||
// -1 if x < y
|
||||
// 0 if x == y
|
||||
// +1 if x > y
|
||||
// -1 if x < y
|
||||
// 0 if x == y
|
||||
// +1 if x > y
|
||||
//
|
||||
func CmpInt(x, y *Int) int {
|
||||
x.doinit()
|
||||
y.doinit()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
|
||||
63
misc/cgo/life/life_test.go
Normal file
63
misc/cgo/life/life_test.go
Normal file
@@ -0,0 +1,63 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package life_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
log.SetFlags(log.Lshortfile)
|
||||
os.Exit(testMain(m))
|
||||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
GOPATH, err := os.MkdirTemp("", "cgolife")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
defer os.RemoveAll(GOPATH)
|
||||
os.Setenv("GOPATH", GOPATH)
|
||||
|
||||
// Copy testdata into GOPATH/src/cgolife, along with a go.mod file
|
||||
// declaring the same path.
|
||||
modRoot := filepath.Join(GOPATH, "src", "cgolife")
|
||||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if err := os.Chdir(modRoot); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := os.WriteFile("go.mod", []byte("module cgolife\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
return m.Run()
|
||||
}
|
||||
|
||||
func TestTestRun(t *testing.T) {
|
||||
if os.Getenv("GOOS") == "android" {
|
||||
t.Skip("the go tool runs with CGO_ENABLED=0 on the android device")
|
||||
}
|
||||
out, err := exec.Command("go", "env", "GOROOT").Output()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
GOROOT := string(bytes.TrimSpace(out))
|
||||
|
||||
cmd := exec.Command("go", "run", filepath.Join(GOROOT, "test", "run.go"), "-", ".")
|
||||
out, err = cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %s\n%s", strings.Join(cmd.Args, " "), err, out)
|
||||
}
|
||||
t.Logf("%s:\n%s", strings.Join(cmd.Args, " "), out)
|
||||
}
|
||||
78
misc/cgo/life/overlaydir_test.go
Normal file
78
misc/cgo/life/overlaydir_test.go
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package life_test
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// overlayDir makes a minimal-overhead copy of srcRoot in which new files may be added.
|
||||
//
|
||||
// TODO: Once we no longer need to support the misc module in GOPATH mode,
|
||||
// factor this function out into a package to reduce duplication.
|
||||
func overlayDir(dstRoot, srcRoot string) error {
|
||||
dstRoot = filepath.Clean(dstRoot)
|
||||
if err := os.MkdirAll(dstRoot, 0777); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
srcRoot, err := filepath.Abs(srcRoot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return filepath.Walk(srcRoot, func(srcPath string, info os.FileInfo, err error) error {
|
||||
if err != nil || srcPath == srcRoot {
|
||||
return err
|
||||
}
|
||||
|
||||
suffix := strings.TrimPrefix(srcPath, srcRoot)
|
||||
for len(suffix) > 0 && suffix[0] == filepath.Separator {
|
||||
suffix = suffix[1:]
|
||||
}
|
||||
dstPath := filepath.Join(dstRoot, suffix)
|
||||
|
||||
perm := info.Mode() & os.ModePerm
|
||||
if info.Mode()&os.ModeSymlink != 0 {
|
||||
info, err = os.Stat(srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
perm = info.Mode() & os.ModePerm
|
||||
}
|
||||
|
||||
// Always copy directories (don't symlink them).
|
||||
// If we add a file in the overlay, we don't want to add it in the original.
|
||||
if info.IsDir() {
|
||||
return os.MkdirAll(dstPath, perm|0200)
|
||||
}
|
||||
|
||||
// If the OS supports symlinks, use them instead of copying bytes.
|
||||
if err := os.Symlink(srcPath, dstPath); err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Otherwise, copy the bytes.
|
||||
src, err := os.Open(srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer src.Close()
|
||||
|
||||
dst, err := os.OpenFile(dstPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, perm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = io.Copy(dst, src)
|
||||
if closeErr := dst.Close(); err == nil {
|
||||
err = closeErr
|
||||
}
|
||||
return err
|
||||
})
|
||||
}
|
||||
41
misc/cgo/life/testdata/life.go
vendored
Normal file
41
misc/cgo/life/testdata/life.go
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// skip
|
||||
|
||||
// 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 cgolife
|
||||
|
||||
// #include "life.h"
|
||||
import "C"
|
||||
|
||||
import "unsafe"
|
||||
|
||||
func Run(gen, x, y int, a []int32) {
|
||||
n := make([]int32, x*y)
|
||||
for i := 0; i < gen; i++ {
|
||||
C.Step(C.int(x), C.int(y), (*C.int)(unsafe.Pointer(&a[0])), (*C.int)(unsafe.Pointer(&n[0])))
|
||||
copy(a, n)
|
||||
}
|
||||
}
|
||||
|
||||
// Keep the channels visible from Go.
|
||||
var chans [4]chan bool
|
||||
|
||||
//export GoStart
|
||||
// Double return value is just for testing.
|
||||
func GoStart(i, xdim, ydim, xstart, xend, ystart, yend C.int, a *C.int, n *C.int) (int, int) {
|
||||
c := make(chan bool, int(C.MYCONST))
|
||||
go func() {
|
||||
C.DoStep(xdim, ydim, xstart, xend, ystart, yend, a, n)
|
||||
c <- true
|
||||
}()
|
||||
chans[i] = c
|
||||
return int(i), int(i + 100)
|
||||
}
|
||||
|
||||
//export GoWait
|
||||
func GoWait(i C.int) {
|
||||
<-chans[i]
|
||||
chans[i] = nil
|
||||
}
|
||||
49
misc/cgo/life/testdata/main.go
vendored
Normal file
49
misc/cgo/life/testdata/main.go
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
// run -tags=use_go_run
|
||||
|
||||
// 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.
|
||||
|
||||
// +build test_run
|
||||
|
||||
// Run the game of life in C using Go for parallelization.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"cgolife"
|
||||
)
|
||||
|
||||
const MAXDIM = 100
|
||||
|
||||
var dim = flag.Int("dim", 16, "board dimensions")
|
||||
var gen = flag.Int("gen", 10, "generations")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
var a [MAXDIM * MAXDIM]int32
|
||||
for i := 2; i < *dim; i += 8 {
|
||||
for j := 2; j < *dim-3; j += 8 {
|
||||
for y := 0; y < 3; y++ {
|
||||
a[i**dim+j+y] = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cgolife.Run(*gen, *dim, *dim, a[:])
|
||||
|
||||
for i := 0; i < *dim; i++ {
|
||||
for j := 0; j < *dim; j++ {
|
||||
if a[i**dim+j] == 0 {
|
||||
fmt.Print(" ")
|
||||
} else {
|
||||
fmt.Print("X")
|
||||
}
|
||||
}
|
||||
fmt.Print("\n")
|
||||
}
|
||||
}
|
||||
78
misc/cgo/stdio/overlaydir_test.go
Normal file
78
misc/cgo/stdio/overlaydir_test.go
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package stdio_test
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// overlayDir makes a minimal-overhead copy of srcRoot in which new files may be added.
|
||||
//
|
||||
// TODO: Once we no longer need to support the misc module in GOPATH mode,
|
||||
// factor this function out into a package to reduce duplication.
|
||||
func overlayDir(dstRoot, srcRoot string) error {
|
||||
dstRoot = filepath.Clean(dstRoot)
|
||||
if err := os.MkdirAll(dstRoot, 0777); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
srcRoot, err := filepath.Abs(srcRoot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return filepath.Walk(srcRoot, func(srcPath string, info os.FileInfo, err error) error {
|
||||
if err != nil || srcPath == srcRoot {
|
||||
return err
|
||||
}
|
||||
|
||||
suffix := strings.TrimPrefix(srcPath, srcRoot)
|
||||
for len(suffix) > 0 && suffix[0] == filepath.Separator {
|
||||
suffix = suffix[1:]
|
||||
}
|
||||
dstPath := filepath.Join(dstRoot, suffix)
|
||||
|
||||
perm := info.Mode() & os.ModePerm
|
||||
if info.Mode()&os.ModeSymlink != 0 {
|
||||
info, err = os.Stat(srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
perm = info.Mode() & os.ModePerm
|
||||
}
|
||||
|
||||
// Always copy directories (don't symlink them).
|
||||
// If we add a file in the overlay, we don't want to add it in the original.
|
||||
if info.IsDir() {
|
||||
return os.MkdirAll(dstPath, perm|0200)
|
||||
}
|
||||
|
||||
// If the OS supports symlinks, use them instead of copying bytes.
|
||||
if err := os.Symlink(srcPath, dstPath); err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Otherwise, copy the bytes.
|
||||
src, err := os.Open(srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer src.Close()
|
||||
|
||||
dst, err := os.OpenFile(dstPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, perm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = io.Copy(dst, src)
|
||||
if closeErr := dst.Close(); err == nil {
|
||||
err = closeErr
|
||||
}
|
||||
return err
|
||||
})
|
||||
}
|
||||
63
misc/cgo/stdio/stdio_test.go
Normal file
63
misc/cgo/stdio/stdio_test.go
Normal file
@@ -0,0 +1,63 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package stdio_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
log.SetFlags(log.Lshortfile)
|
||||
os.Exit(testMain(m))
|
||||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
GOPATH, err := os.MkdirTemp("", "cgostdio")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
defer os.RemoveAll(GOPATH)
|
||||
os.Setenv("GOPATH", GOPATH)
|
||||
|
||||
// Copy testdata into GOPATH/src/cgostdio, along with a go.mod file
|
||||
// declaring the same path.
|
||||
modRoot := filepath.Join(GOPATH, "src", "cgostdio")
|
||||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if err := os.Chdir(modRoot); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := os.WriteFile("go.mod", []byte("module cgostdio\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
return m.Run()
|
||||
}
|
||||
|
||||
func TestTestRun(t *testing.T) {
|
||||
if os.Getenv("GOOS") == "android" {
|
||||
t.Skip("subpackage stdio is not available on android")
|
||||
}
|
||||
out, err := exec.Command("go", "env", "GOROOT").Output()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
GOROOT := string(bytes.TrimSpace(out))
|
||||
|
||||
cmd := exec.Command("go", "run", filepath.Join(GOROOT, "test", "run.go"), "-", ".")
|
||||
out, err = cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %s\n%s", strings.Join(cmd.Args, " "), err, out)
|
||||
}
|
||||
t.Logf("%s:\n%s", strings.Join(cmd.Args, " "), out)
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
// run -tags=use_go_run
|
||||
|
||||
// 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.
|
||||
|
||||
//go:build test_run
|
||||
// +build test_run
|
||||
|
||||
// Pass numbers along a chain of threads.
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// run -tags=use_go_run
|
||||
|
||||
// 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.
|
||||
|
||||
//go:build test_run
|
||||
// +build test_run
|
||||
|
||||
// Compute Fibonacci numbers with two goroutines
|
||||
// that pass integers back and forth. No actual
|
||||
@@ -1,8 +1,10 @@
|
||||
// run -tags=use_go_run
|
||||
|
||||
// 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.
|
||||
|
||||
//go:build test_run
|
||||
// +build test_run
|
||||
|
||||
package main
|
||||
|
||||
150
misc/cgo/stdio/testdata/run.out
vendored
Normal file
150
misc/cgo/stdio/testdata/run.out
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
* hello
|
||||
hello, world
|
||||
* fib
|
||||
0
|
||||
1
|
||||
1
|
||||
2
|
||||
3
|
||||
5
|
||||
8
|
||||
13
|
||||
21
|
||||
34
|
||||
55
|
||||
89
|
||||
144
|
||||
233
|
||||
377
|
||||
610
|
||||
987
|
||||
1597
|
||||
2584
|
||||
4181
|
||||
6765
|
||||
10946
|
||||
17711
|
||||
28657
|
||||
46368
|
||||
75025
|
||||
121393
|
||||
196418
|
||||
317811
|
||||
514229
|
||||
832040
|
||||
1346269
|
||||
2178309
|
||||
3524578
|
||||
5702887
|
||||
9227465
|
||||
14930352
|
||||
24157817
|
||||
39088169
|
||||
63245986
|
||||
102334155
|
||||
165580141
|
||||
267914296
|
||||
433494437
|
||||
701408733
|
||||
1134903170
|
||||
1836311903
|
||||
2971215073
|
||||
4807526976
|
||||
7778742049
|
||||
12586269025
|
||||
20365011074
|
||||
32951280099
|
||||
53316291173
|
||||
86267571272
|
||||
139583862445
|
||||
225851433717
|
||||
365435296162
|
||||
591286729879
|
||||
956722026041
|
||||
1548008755920
|
||||
2504730781961
|
||||
4052739537881
|
||||
6557470319842
|
||||
10610209857723
|
||||
17167680177565
|
||||
27777890035288
|
||||
44945570212853
|
||||
72723460248141
|
||||
117669030460994
|
||||
190392490709135
|
||||
308061521170129
|
||||
498454011879264
|
||||
806515533049393
|
||||
1304969544928657
|
||||
2111485077978050
|
||||
3416454622906707
|
||||
5527939700884757
|
||||
8944394323791464
|
||||
14472334024676221
|
||||
23416728348467685
|
||||
37889062373143906
|
||||
61305790721611591
|
||||
99194853094755497
|
||||
160500643816367088
|
||||
259695496911122585
|
||||
420196140727489673
|
||||
679891637638612258
|
||||
1100087778366101931
|
||||
1779979416004714189
|
||||
2880067194370816120
|
||||
* chain
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
44
misc/cgo/stdio/testdata/stdio/file.go
vendored
Normal file
44
misc/cgo/stdio/testdata/stdio/file.go
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
// skip
|
||||
|
||||
// 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.
|
||||
|
||||
/*
|
||||
A trivial example of wrapping a C library in Go.
|
||||
For a more complex example and explanation,
|
||||
see ../gmp/gmp.go.
|
||||
*/
|
||||
|
||||
package stdio
|
||||
|
||||
/*
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
char* greeting = "hello, world";
|
||||
*/
|
||||
import "C"
|
||||
import "unsafe"
|
||||
|
||||
type File C.FILE
|
||||
|
||||
// Test reference to library symbol.
|
||||
// Stdout and stderr are too special to be a reliable test.
|
||||
//var = C.environ
|
||||
|
||||
func (f *File) WriteString(s string) {
|
||||
p := C.CString(s)
|
||||
C.fputs(p, (*C.FILE)(f))
|
||||
C.free(unsafe.Pointer(p))
|
||||
f.Flush()
|
||||
}
|
||||
|
||||
func (f *File) Flush() {
|
||||
C.fflush((*C.FILE)(f))
|
||||
}
|
||||
|
||||
var Greeting = C.GoString(C.greeting)
|
||||
var Gbytes = C.GoBytes(unsafe.Pointer(C.greeting), C.int(len(Greeting)))
|
||||
@@ -1,3 +1,5 @@
|
||||
// skip
|
||||
|
||||
// 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.
|
||||
1782
misc/cgo/test/callback.go
Normal file
1782
misc/cgo/test/callback.go
Normal file
File diff suppressed because it is too large
Load Diff
90
misc/cgo/test/callback_c.c
Normal file
90
misc/cgo/test/callback_c.c
Normal file
@@ -0,0 +1,90 @@
|
||||
// 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.
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include "_cgo_export.h"
|
||||
|
||||
void
|
||||
callback(void *f)
|
||||
{
|
||||
// use some stack space
|
||||
volatile char data[64*1024];
|
||||
|
||||
data[0] = 0;
|
||||
goCallback(f);
|
||||
data[sizeof(data)-1] = 0;
|
||||
}
|
||||
|
||||
void
|
||||
callGoFoo(void)
|
||||
{
|
||||
extern void goFoo(void);
|
||||
goFoo();
|
||||
}
|
||||
|
||||
void
|
||||
IntoC(void)
|
||||
{
|
||||
BackIntoGo();
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
long long
|
||||
mysleep(int seconds) {
|
||||
long long st = GetTickCount();
|
||||
Sleep(1000 * seconds);
|
||||
return st;
|
||||
}
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
long long
|
||||
mysleep(int seconds) {
|
||||
long long st;
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
st = tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
||||
sleep(seconds);
|
||||
return st;
|
||||
}
|
||||
#endif
|
||||
|
||||
long long
|
||||
twoSleep(int n)
|
||||
{
|
||||
BackgroundSleep(n);
|
||||
return mysleep(n);
|
||||
}
|
||||
|
||||
void
|
||||
callGoStackCheck(void)
|
||||
{
|
||||
extern void goStackCheck(void);
|
||||
goStackCheck();
|
||||
}
|
||||
|
||||
int
|
||||
returnAfterGrow(void)
|
||||
{
|
||||
extern int goReturnVal(void);
|
||||
goReturnVal();
|
||||
return 123456;
|
||||
}
|
||||
|
||||
int
|
||||
returnAfterGrowFromGo(void)
|
||||
{
|
||||
extern int goReturnVal(void);
|
||||
return goReturnVal();
|
||||
}
|
||||
|
||||
void
|
||||
callGoWithString(void)
|
||||
{
|
||||
extern void goWithString(GoString);
|
||||
const char *str = "string passed from C to Go";
|
||||
goWithString((GoString){str, strlen(str)});
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build gc
|
||||
// +build gc
|
||||
|
||||
#include "_cgo_export.h"
|
||||
#include <stdint.h>
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build gccgo
|
||||
// +build gccgo
|
||||
|
||||
#include "_cgo_export.h"
|
||||
#include <stdint.h>
|
||||
20
misc/cgo/test/cgo_linux_test.go
Normal file
20
misc/cgo/test/cgo_linux_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2012 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cgotest
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSetgid(t *testing.T) {
|
||||
if runtime.GOOS == "android" {
|
||||
t.Skip("unsupported on Android")
|
||||
}
|
||||
testSetgid(t)
|
||||
}
|
||||
func Test1435(t *testing.T) { test1435(t) }
|
||||
func Test6997(t *testing.T) { test6997(t) }
|
||||
func TestBuildID(t *testing.T) { testBuildID(t) }
|
||||
101
misc/cgo/test/cgo_test.go
Normal file
101
misc/cgo/test/cgo_test.go
Normal file
@@ -0,0 +1,101 @@
|
||||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cgotest
|
||||
|
||||
import "testing"
|
||||
|
||||
// The actual test functions are in non-_test.go files
|
||||
// so that they can use cgo (import "C").
|
||||
// These wrappers are here for gotest to find.
|
||||
|
||||
func Test1328(t *testing.T) { test1328(t) }
|
||||
func Test1635(t *testing.T) { test1635(t) }
|
||||
func Test3250(t *testing.T) { test3250(t) }
|
||||
func Test3729(t *testing.T) { test3729(t) }
|
||||
func Test3775(t *testing.T) { test3775(t) }
|
||||
func Test4029(t *testing.T) { test4029(t) }
|
||||
func Test4339(t *testing.T) { test4339(t) }
|
||||
func Test5227(t *testing.T) { test5227(t) }
|
||||
func Test5242(t *testing.T) { test5242(t) }
|
||||
func Test5337(t *testing.T) { test5337(t) }
|
||||
func Test5548(t *testing.T) { test5548(t) }
|
||||
func Test5603(t *testing.T) { test5603(t) }
|
||||
func Test5986(t *testing.T) { test5986(t) }
|
||||
func Test6390(t *testing.T) { test6390(t) }
|
||||
func Test6833(t *testing.T) { test6833(t) }
|
||||
func Test6907(t *testing.T) { test6907(t) }
|
||||
func Test6907Go(t *testing.T) { test6907Go(t) }
|
||||
func Test7560(t *testing.T) { test7560(t) }
|
||||
func Test7665(t *testing.T) { test7665(t) }
|
||||
func Test7978(t *testing.T) { test7978(t) }
|
||||
func Test8092(t *testing.T) { test8092(t) }
|
||||
func Test8517(t *testing.T) { test8517(t) }
|
||||
func Test8694(t *testing.T) { test8694(t) }
|
||||
func Test8811(t *testing.T) { test8811(t) }
|
||||
func Test9557(t *testing.T) { test9557(t) }
|
||||
func Test10303(t *testing.T) { test10303(t, 10) }
|
||||
func Test11925(t *testing.T) { test11925(t) }
|
||||
func Test12030(t *testing.T) { test12030(t) }
|
||||
func Test14838(t *testing.T) { test14838(t) }
|
||||
func Test17065(t *testing.T) { test17065(t) }
|
||||
func Test17537(t *testing.T) { test17537(t) }
|
||||
func Test18126(t *testing.T) { test18126(t) }
|
||||
func Test18720(t *testing.T) { test18720(t) }
|
||||
func Test20129(t *testing.T) { test20129(t) }
|
||||
func Test20369(t *testing.T) { test20369(t) }
|
||||
func Test20910(t *testing.T) { test20910(t) }
|
||||
func Test21708(t *testing.T) { test21708(t) }
|
||||
func Test21809(t *testing.T) { test21809(t) }
|
||||
func Test21897(t *testing.T) { test21897(t) }
|
||||
func Test22906(t *testing.T) { test22906(t) }
|
||||
func Test23356(t *testing.T) { test23356(t) }
|
||||
func Test24206(t *testing.T) { test24206(t) }
|
||||
func Test25143(t *testing.T) { test25143(t) }
|
||||
func Test26066(t *testing.T) { test26066(t) }
|
||||
func Test27660(t *testing.T) { test27660(t) }
|
||||
func Test28896(t *testing.T) { test28896(t) }
|
||||
func Test30065(t *testing.T) { test30065(t) }
|
||||
func Test32579(t *testing.T) { test32579(t) }
|
||||
func Test31891(t *testing.T) { test31891(t) }
|
||||
func Test45451(t *testing.T) { test45451(t) }
|
||||
func TestAlign(t *testing.T) { testAlign(t) }
|
||||
func TestAtol(t *testing.T) { testAtol(t) }
|
||||
func TestBlocking(t *testing.T) { testBlocking(t) }
|
||||
func TestBoolAlign(t *testing.T) { testBoolAlign(t) }
|
||||
func TestCallGoWithString(t *testing.T) { testCallGoWithString(t) }
|
||||
func TestCallback(t *testing.T) { testCallback(t) }
|
||||
func TestCallbackCallers(t *testing.T) { testCallbackCallers(t) }
|
||||
func TestCallbackGC(t *testing.T) { testCallbackGC(t) }
|
||||
func TestCallbackPanic(t *testing.T) { testCallbackPanic(t) }
|
||||
func TestCallbackPanicLocked(t *testing.T) { testCallbackPanicLocked(t) }
|
||||
func TestCallbackPanicLoop(t *testing.T) { testCallbackPanicLoop(t) }
|
||||
func TestCallbackStack(t *testing.T) { testCallbackStack(t) }
|
||||
func TestCflags(t *testing.T) { testCflags(t) }
|
||||
func TestCheckConst(t *testing.T) { testCheckConst(t) }
|
||||
func TestConst(t *testing.T) { testConst(t) }
|
||||
func TestCthread(t *testing.T) { testCthread(t) }
|
||||
func TestEnum(t *testing.T) { testEnum(t) }
|
||||
func TestNamedEnum(t *testing.T) { testNamedEnum(t) }
|
||||
func TestCastToEnum(t *testing.T) { testCastToEnum(t) }
|
||||
func TestErrno(t *testing.T) { testErrno(t) }
|
||||
func TestFpVar(t *testing.T) { testFpVar(t) }
|
||||
func TestHandle(t *testing.T) { testHandle(t) }
|
||||
func TestHelpers(t *testing.T) { testHelpers(t) }
|
||||
func TestLibgcc(t *testing.T) { testLibgcc(t) }
|
||||
func TestMultipleAssign(t *testing.T) { testMultipleAssign(t) }
|
||||
func TestNaming(t *testing.T) { testNaming(t) }
|
||||
func TestPanicFromC(t *testing.T) { testPanicFromC(t) }
|
||||
func TestParallelSleep(t *testing.T) { testParallelSleep(t) }
|
||||
func TestPrintf(t *testing.T) { testPrintf(t) }
|
||||
func TestReturnAfterGrow(t *testing.T) { testReturnAfterGrow(t) }
|
||||
func TestReturnAfterGrowFromGo(t *testing.T) { testReturnAfterGrowFromGo(t) }
|
||||
func TestSetEnv(t *testing.T) { testSetEnv(t) }
|
||||
func TestThreadLock(t *testing.T) { testThreadLockFunc(t) }
|
||||
func TestUnsignedInt(t *testing.T) { testUnsignedInt(t) }
|
||||
func TestZeroArgCallback(t *testing.T) { testZeroArgCallback(t) }
|
||||
|
||||
func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) }
|
||||
func BenchmarkGoString(b *testing.B) { benchGoString(b) }
|
||||
func BenchmarkCGoCallback(b *testing.B) { benchCallback(b) }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user