aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-02-05testing/fstest: avoid symlink-induced failures in testerRuss Cox
Do not require directory entry and Stat result to match for symlinks, because they won't (Stat dereferences the symlink). Fixes #44113. Change-Id: Ifc6dbce5719906e2f42254a7172f1ef787464a9e Reviewed-on: https://go-review.googlesource.com/c/go/+/290009 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-02-04runtime: fix typo in histogram.goIkko Ashimine
indicies -> indices Change-Id: Ia50ae5918fc7a53c23590a94a18087a99bfd9bb7 GitHub-Last-Rev: 98eb724275fd61d5f5ce5dad6b1010c10f76906d GitHub-Pull-Request: golang/go#44095 Reviewed-on: https://go-review.googlesource.com/c/go/+/289529 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Keith Randall <khr@golang.org>
2021-02-03math/big: fix comment in divRecursiveStepKatie Hockman
There appears to be a typo in the description of the recursive division algorithm. Two things seem suspicious with the original comment: 1. It is talking about choosing s, but s doesn't appear anywhere in the equation. 2. The math in the equation is incorrect. Where B = len(v)/2 s = B - 1 Proof that it is incorrect: len(v) - B >= B + 1 len(v) - len(v)/2 >= len(v)/2 + 1 This doesn't hold if len(v) is even, e.g. 10: 10 - 10/2 >= 10/2 + 1 10 - 5 >= 5 + 1 5 >= 6 // this is false The new equation will be the following, which will be mathematically correct: len(v) - s >= B + 1 len(v) - (len(v)/2 - 1) >= len(v)/2 + 1 len(v) - len(v)/2 + 1 >= len(v)/2 + 1 len(v) - len(v)/2 >= len(v)/2 This holds if len(v) is even or odd. e.g. 10 10 - 10/2 >= 10/2 10 - 5 >= 5 5 >= 5 e.g. 11 11 - 11/2 >= 11/2 11 - 5 >= 5 6 >= 5 Change-Id: If77ce09286cf7038637b5dfd0fb7d4f828023f56 Reviewed-on: https://go-review.googlesource.com/c/go/+/287372 Run-TryBot: Katie Hockman <katie@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Trust: Katie Hockman <katie@golang.org>
2021-02-02spec: improve the example in Type assertions sectiontask4233
The example, var v, ok T1 = x.(T), can be interpreted as type T1 interface{} or type T = bool; type T1 = T. Separating the example would help understanding for readers. Change-Id: I179f4564e67f4d503815d29307df2cebb50c82f9 GitHub-Last-Rev: b34fffb6bb07cb2883bc313ef3bc9980b3dd4abe GitHub-Pull-Request: golang/go#44040 Reviewed-on: https://go-review.googlesource.com/c/go/+/288472 Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Robert Griesemer <gri@golang.org>
2021-02-02cmd/link: don't decode type symbol in shared library in deadcodeCherry Zhang
In the linker's deadcode pass we decode type symbols for interface satisfaction analysis. When linking against Go shared libraries, the type symbol may come from a shared library, so it doesn't have data in the current module being linked, so we cannot decode it. We already have code to skip DYNIMPORT symbols. However, this doesn't actually work, because at that point the type symbols' names haven't been mangled, whereas they may be mangled in the shared library. So the symbol definition (in shared library) and reference (in current module) haven't been connected. Skip decoding type symbols of type Sxxx (along with DYNIMPORT) when linkShared. Note: we cannot skip all type symbols, as we still need to mark unexported methods defined in the current module. Fixes #44031. Change-Id: I833d19a060c94edbd6fc448172358f9a7d760657 Reviewed-on: https://go-review.googlesource.com/c/go/+/288496 Trust: Cherry Zhang <cherryyz@google.com> Trust: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2021-02-02cmd/link: fix off-by-1 error in findShlibSectionCherry Zhang
We want to find a section that contains addr. sect.Addr+sect.Size is the exclusive upper bound. Change-Id: If2cd6bdd6e03174680e066189b0f4bf9e2ba6630 Reviewed-on: https://go-review.googlesource.com/c/go/+/288592 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2021-02-01test: fix incorrectly laid out instructions in issue11656.goTom Thorogood
CL 279423 introduced a regression in this test as it incorrectly laid out various instructions. In the case of arm, the second instruction was overwriting the first. In the case of 386, amd64 and s390x, the instructions were being appended to the end of the slice after 64 zero bytes. This was causing test failures on "linux/s390x on z13". Fixes #44028 Change-Id: Id136212dabdae27db7e91904b0df6a3a9d2f4af4 Reviewed-on: https://go-review.googlesource.com/c/go/+/288278 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-02-01doc/go1.16: document that on OpenBSD syscalls are now made through libcCherry Zhang
Updates #36435, #40700. Change-Id: I1e2ded111ad58066cc9f2c9d00e719497b0f34d8 Reviewed-on: https://go-review.googlesource.com/c/go/+/287634 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Joel Sing <joel@sing.id.au>
2021-02-01cmd/link: disable TestPIESize if CGO isn't enabledNehal J Wani
With CGO disabled, the test throws the following error: elf_test.go:291: # command-line-arguments loadinternal: cannot find runtime/cgo Change-Id: Iaeb183562ab637c714240b49e73078bdb791b35b GitHub-Last-Rev: f8fe9afad5611411966413d17cb5874f7b0018a0 GitHub-Pull-Request: golang/go#43911 Reviewed-on: https://go-review.googlesource.com/c/go/+/286632 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Trust: Matthew Dempsky <mdempsky@google.com>
2021-02-01doc/go1.16: minor markup fixesToshihiro Shiino
Add missing <code> tags. Remove unnecessary <br> tag. For #40700 Change-Id: I03d3ce1c89a9ae3d3195dcd2bb8b1a61f011e1ed Reviewed-on: https://go-review.googlesource.com/c/go/+/288275 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
2021-01-29embed: update docs for proposal tweaksIan Lance Taylor
//go:embed variables can be type aliases. //go:embed variables can't be local to a function. For #43216 For #43602 Fixes #43978 Change-Id: Ib1d104dfa32b97c91d8bfc5ed5d461ca14da188f Reviewed-on: https://go-review.googlesource.com/c/go/+/288072 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2021-01-29runtime: document pointer write atomicity for memclrNoHeapPointersCherry Zhang
memclrNoHeapPointers is the underlying implementation of typedmemclr and memclrHasPointers, so it still needs to write pointer-aligned words atomically. Document this requirement. Updates #41428. Change-Id: Ice00dee5de7a96a50e51ff019fcef069e8a8406a Reviewed-on: https://go-review.googlesource.com/c/go/+/287692 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2021-01-28syscall: generate readlen/writelen for openbsd libcJoel Sing
Rather than hand rolling readlen and writelen, move it to being generated via mksyscall.pl, as is done for most other functions. Updates #36435 Change-Id: I649aed7b182b41c8639686feae25ce19dab812c3 Reviewed-on: https://go-review.googlesource.com/c/go/+/287532 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-28cmd/go: revert TestScript/build_trimpath to use ioutil.ReadFileBryan C. Mills
This call was changed to os.ReadFile in CL 266365, but the test also builds that source file using gccgo if present, and released versions of gccgo do not yet support ioutil.ReadFile. Manually tested with gccgo gccgo 10.2.1 (see #35786). Fixes #43974. Updates #42026. Change-Id: Ic4ca0848d3ca324e2ab10fd14ad867f21e0898e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/287613 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-28runtime: correct syscall10/syscall10X on openbsd/amd64Joel Sing
The syscall10/syscall10X implementation uses an incorrect stack offset for arguments a7 to a10. Correct this so that the syscall arguments work as intended. Updates #36435 Fixes #43927 Change-Id: Ia7ae6cc8c89f50acfd951c0f271f3b3309934499 Reviewed-on: https://go-review.googlesource.com/c/go/+/287252 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-01-28doc/go1.16: document go/build/constraint packageIan Lance Taylor
For #40700 For #41184 Fixes #43957 Change-Id: Ia346f4cf160431b721efeba7dc5f1fb8814efd95 Reviewed-on: https://go-review.googlesource.com/c/go/+/287472 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-28runtime,syscall: convert syscall on openbsd/arm64 to libcJoel Sing
Convert the syscall package on openbsd/arm64 to use libc rather than performing direct system calls. Updates #36435 Change-Id: I7e1da8537cea9ed9bf2676f181e56ae99383333f Reviewed-on: https://go-review.googlesource.com/c/go/+/286815 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-27[release-branch.go1.16] go1.16rc1go1.16rc1Alexander Rakoczy
Change-Id: I978f6df491a19a9c45ab906dbc5194b8665bf4a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/287352 Run-TryBot: Alexander Rakoczy <alex@golang.org> Trust: Alexander Rakoczy <alex@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-27api/go1.16: add go/build/constraint APIsAlexander Rakoczy
These APIs were added in CL 240604 as part of an approved proposal. It was submitted after the initial api/go1.16.txt creation. For #41184 For #43407 Change-Id: Ifb54df2b61c554c32bd9d17afbb74f4e42e0b228 Reviewed-on: https://go-review.googlesource.com/c/go/+/287412 Trust: Alexander Rakoczy <alex@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-27crypto/x509: remove leftover CertificateRequest fieldRoland Shoemaker
Removes the KeyUsage field that was missed in the rollback in CL 281235. Also updates CreateCertificateRequest to reflect that these fields were removed. For #43407. Updates #43477. Updates #37172. Change-Id: I6244aed4a3ef3c2460c38af5511e5c2e82546179 Reviewed-on: https://go-review.googlesource.com/c/go/+/287392 Trust: Alexander Rakoczy <alex@golang.org> Trust: Roland Shoemaker <roland@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-27runtime: make sure to remove open-coded defer entries in all cases after a ↵Dan Scales
recover We add entries to the defer list at panic/goexit time on-the-fly for frames with open-coded defers. We do this so that we can correctly process open-coded defers and non-open-coded defers in the correct order during panics/goexits. But we need to remove entries for open-coded defers from the defer list when there is a recover, since those entries may never get removed otherwise and will get stale, since their corresponding defers may now be processed normally (inline). This bug here is that we were only removing higher-up stale entries during a recover if all defers in the current frame were done. But we could have more defers in the current frame (as the new test case shows). In this case, we need to leave the current defer entry around for use by deferreturn, but still remove any stale entries further along the chain. For bug 43921, simple change that we should abort the removal loop for any defer entry that is started (i.e. in process by a still not-recovered outer panic), even if it is not an open-coded defer. This change does not fix bug 43920, which looks to be a more complex fix. Fixes #43882 Fixes #43921 Change-Id: Ie05b2fa26973aa26b25c8899a2abc916090ee4f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/286712 Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> Trust: Dan Scales <danscales@google.com>
2021-01-27runtime: block console ctrlhandler when the signal is handledNuno Cruces
Fixes #41884 I can confirm this change fixes my issue. I can't confirm that this doesn't break any and everything else. I see that this code has been tweaked repeatedly, so I would really welcome guidance into further testing. Change-Id: I1986dd0c2f30cfe10257f0d8c658988d6986f7a6 GitHub-Last-Rev: 92f02c96973e12f1472511bcf3c5ebb36c6b0440 GitHub-Pull-Request: golang/go#41886 Reviewed-on: https://go-review.googlesource.com/c/go/+/261057 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Trust: Jason A. Donenfeld <Jason@zx2c4.com> Trust: Alex Brainman <alex.brainman@gmail.com>
2021-01-27cmd/go: skip issue33139 when the 'cc' script command is unavailableNehal J Wani
With CGO disabled, the test suite tries to run the following and fail: CGO_ENABLED=0 go test -run=TestScript/link_syso_issue33139 cmd/go go test proxy running at GOPROXY=http://127.0.0.1:38829/mod --- FAIL: TestScript (0.01s) --- FAIL: TestScript/link_syso_issue33139 (0.01s) script_test.go:215: # Test that we can use the external linker with a host syso file that is # embedded in a package, that is referenced by a Go assembly function. # See issue 33139. (0.000s) # External linking is not supported on linux/ppc64. # See: https://github.com/golang/go/issues/8912 (0.000s) # External linking is not supported on linux/riscv64. # See: https://github.com/golang/go/issues/36739 (0.001s) > [linux] [riscv64] skip > cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c FAIL: testdata/script/link_syso_issue33139.txt:15: unexpected error starting command: fork/exec /dev/null: permission denied CC was set to /dev/null (during build) in the scenario mentioned above This patch replaces [!exec:cc] with [!cgo] because we care about the availability of the 'cc' builtin and not the 'cc' executable in $PATH Change-Id: Ifbd2441f5f8e903ca3da213aba76f44c2e2eebab GitHub-Last-Rev: 3b743787d08502f7a936e800ee7b6909fcf56068 GitHub-Pull-Request: golang/go#43912 Reviewed-on: https://go-review.googlesource.com/c/go/+/286633 Trust: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-01-27runtime: switch runtime to libc for openbsd/arm64Joel Sing
Use libc rather than performing direct system calls for the runtime on openbsd/arm64. Updates #36435 Change-Id: I8bd41dfec16209f2b9a83dda24b9a1e4b06757c6 Reviewed-on: https://go-review.googlesource.com/c/go/+/286814 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-01-27runtime: convert openbsd/arm64 locking to libcJoel Sing
Switch openbsd/arm64 to locking via libc, rather than performing direct system calls. Update #36435 Change-Id: I2f30432c4bc232224cf87dca750665b8c40c7b72 Reviewed-on: https://go-review.googlesource.com/c/go/+/286813 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-27syscall: clean up mkasm related changesJoel Sing
The mkasm_darwin.go file was renamed to mkasm.go in CL 270380, with OpenBSD support being added. The mkasm_openbsd.go file should not have been merged, so remove it. Fix up references to mkasm_$GOOS.go and provide $GOOS as an argument on invocation. Updates #36435 Change-Id: I868d3f2146973d026e6a663d437749dbb6b312ec Reviewed-on: https://go-review.googlesource.com/c/go/+/286812 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-01-27doc/go1.16: fix closing brace in .Export formatRyuji Iwata
A parenthesis of go list "-f" flag format is double curly braces. Change-Id: Ifd38e0b0ae3c46272a4acd65584818228168b7c6 GitHub-Last-Rev: b46030492b5caf18fe127621fdf92cbec4c03ad5 GitHub-Pull-Request: golang/go#43924 Reviewed-on: https://go-review.googlesource.com/c/go/+/286752 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Tobias Klauser <tobias.klauser@gmail.com>
2021-01-27math: fix typo in sqrt.go code commentPaul Davis
"it does not necessary" -> "it is not necessary" Change-Id: I66f9cf2670d76b3686badb4a537b3ec084447d62 GitHub-Last-Rev: 52a0f9993abf25369cdb6b31eaf476df1626cf87 GitHub-Pull-Request: golang/go#43935 Reviewed-on: https://go-review.googlesource.com/c/go/+/287052 Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Robert Griesemer <gri@golang.org>
2021-01-26runtime,syscall: convert syscall on openbsd/amd64 to libcJoel Sing
Convert the syscall package on openbsd/amd64 to use libc rather than performing direct system calls. Updates #36435 Change-Id: Ieb5926a91ed34f7c722e3667004ec484c86804ef Reviewed-on: https://go-review.googlesource.com/c/go/+/270380 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-26os: further document limitations around naked file descriptorsVictor Michel
NewFile requires the file descriptor to be either closed through the returned File instance, or to stay valid at least until the finalizer runs during garbage collection. These requirements are easily violated when file descriptors are closed via unix.Close, or when the *File returned by NewFile is garbage collected while the underlying file descriptor is still in use. This commit adds further documentation for NewFile and Fd, making it explicit that using naked file descriptors is subject to constraints due to garbage collection of File objects. Fixes #43863 Change-Id: I49ea1f0054eb2d2a72b616450c8e83476f4d07fb GitHub-Last-Rev: 180d0130ae9009456914fb265b4bafa0e599de0e GitHub-Pull-Request: golang/go#43867 Reviewed-on: https://go-review.googlesource.com/c/go/+/286032 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
2021-01-26os: correct names in CreateTemp and MkdirTemp doc commentsIan Lance Taylor
For #42026 Change-Id: I51e3ce9d3a4729cfac44bd3ff3f3ec80dcd5abb5 Reviewed-on: https://go-review.googlesource.com/c/go/+/285376 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-26net/http/fcgi: remove locking added to prevent a test-only raceHilko Bengen
The race reported in issue #41167 was detected only because the ReadWriter used in test code happened to be a bytes.Buffer whose Read and Write operate (unsafely) on shared state. This is not the case in any realistic scenario where the FastCGI protocol is spoken over sockets or pairs of pipes. Since tests that use nopWriteCloser don't care about any output generate by child.Serve(), we change nopWriteCloser to provide a dummy Write method. Remove the locking added in CL 252417, since it causes a deadlock during write as reported in #43901. The race in tests no longer happens thanks to the aforementioned change to nopWriteCloser. Fixes #43901. Updates #41167. Change-Id: I8cf31088a71253c34056698f8e2ad0bee9fcf6c6 GitHub-Last-Rev: b06d8377fdada075775d79a20577d38a7c471b45 GitHub-Pull-Request: golang/go#43027 Reviewed-on: https://go-review.googlesource.com/c/go/+/275692 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-25doc/go1.16: mention os.DirFS in os sectionIan Lance Taylor
For #40700 For #41190 Change-Id: I8ade6efd5be09003fc3e5db5a9b91ba6e0f023f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/285593 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-25cmd/compile: fix order-of-assignment issue w/ defersMatthew Dempsky
CL 261677 fixed a logic issue in walk's alias detection, where it was checking the RHS expression instead of the LHS expression when trying to determine the kind of assignment. However, correcting this exposed a latent issue with assigning to result parameters in functions with defers, where an assignment could become visible earlier than intended if a later expression could panic. Fixes #43835. Change-Id: I061ced125e3896e26d65f45b28c99db2c8a74a8c Reviewed-on: https://go-review.googlesource.com/c/go/+/285633 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Trust: Matthew Dempsky <mdempsky@google.com>
2021-01-25doc/go1.16: mention os.DirEntry and types moved from os to io/fsIan Lance Taylor
For #40700 For #41467 For #41190 Change-Id: Id94e7511c98c38a22b1f9a55af6e200c9df07fd3 Reviewed-on: https://go-review.googlesource.com/c/go/+/285592 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-25doc/go1.16: mention new testing/iotest functionsIan Lance Taylor
For #38781 For #40700 For #41190 Change-Id: I72f1055e51edb517041d3861640734ba6ef5f342 Reviewed-on: https://go-review.googlesource.com/c/go/+/285673 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-25doc/go1.16: mention deprecation of io/ioutilIan Lance Taylor
For #40025 For #40700 For #42026 Change-Id: Ib51b5e1398c4eb811506df21e3bd56dd84bd1f7e Reviewed-on: https://go-review.googlesource.com/c/go/+/285377 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-25doc/go1.16: mention go/build changesIan Lance Taylor
For #40070 For #41191 For #43469 For #43632 Change-Id: I6dc6b6ea0f35876a4c252e4e287a0280aca9d502 Reviewed-on: https://go-review.googlesource.com/c/go/+/285213 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-25html/template: revert "avoid race when escaping updates template"Ian Lance Taylor
This reverts CLs 274450 and 279492, except for the new tests. The new race test is changed to skip, as it now fails. We can try again for 1.17. Original CL descriptions: html/template: attach functions to namespace The text/template functions are stored in a data structure shared by all related templates, so do the same with the original, unwrapped, functions on the html/template side. html/template: avoid race when escaping updates template For #39807 Fixes #43855 Change-Id: I2ce91321ada06ea496a982aefe170eb5af9ba847 Reviewed-on: https://go-review.googlesource.com/c/go/+/285957 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-01-25cmd/go: fix TestScript/cgo_path, cgo_path_space when CC setJay Conrod
These tests failed if CC was set to a path containing a separator during make.bash. They now set CC explicitly. Fixes #43897 Change-Id: Ic6e7f192fcb363f0ac9f45b329113255453bf76f Reviewed-on: https://go-review.googlesource.com/c/go/+/286292 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-01-25doc/asm: add a section on go_asm.h, clean up go_tls.h sectionAustin Clements
Currently the only mention of go_asm.h is buried in a confusing section about the runtime-specific go_tls.h header. We actually want people to use go_asm.h, so this CL adds a section with a proper discussion of this header. As part of this, we remove the discussion of go_asm.h from the go_tls.h section and clean up what remains. I stumbled on this when working on the internal ABI specification. I wanted to refer to stable documentation on how to access struct fields from assembly and found there was none. Change-Id: I0d53741e7685e65794611939e76285f7c82e1d65 Reviewed-on: https://go-review.googlesource.com/c/go/+/286052 Trust: Austin Clements <austin@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2021-01-25lib/time, time/tzdata: update tzdata to 2021aTobias Klauser
Changelog: South Sudan changes from +03 to +02 on 2021-02-01 at 00:00. Release announcement: http://mm.icann.org/pipermail/tz-announce/2021-January/000065.html Updates #22487 Change-Id: Ia0a1a7a8f5d47adac9782bc2a445f69e02440f77 Reviewed-on: https://go-review.googlesource.com/c/go/+/285719 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
2021-01-25os: force consistent mtime before running fstest on directory on WindowsJason A. Donenfeld
FindFileNext sometimes returns a different mtime than looking at the file directly, because the MFT on NTFS is written to lazily. In order to keep these in sync, we use GetFileInformationByHandle to get the actual mtime, and then write it back to the file explicitly. Fixes #42637. Change-Id: I774016d3ac55d0dc9b0f9c1b681516c33ba0d28a Reviewed-on: https://go-review.googlesource.com/c/go/+/285720 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Trust: Jason A. Donenfeld <Jason@zx2c4.com>
2021-01-25doc/go1.16: fix WalkDir and Walk linksTobias Klauser
Reported by Ben on golang-dev: https://groups.google.com/g/golang-dev/c/gsoj5Vv15j0/m/XR9CYSRkAgAJ For #40700. Change-Id: If4702cf0e9858aaef99c231251dc646a67d1026e Reviewed-on: https://go-review.googlesource.com/c/go/+/285718 Trust: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
2021-01-23doc/go1.16: add crypto/x509 memory optimizationBrad Fitzpatrick
Change-Id: I0c61b0e0d1430f66e3f7dbf07817264258a1c15a Reviewed-on: https://go-review.googlesource.com/c/go/+/285682 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Brad Fitzpatrick <bradfitz@golang.org>
2021-01-23doc/go1.16: reword ambiguously parsable sentenceBrad Fitzpatrick
Change-Id: Idc54967e962352a598c9d4c563d1d9f51ec5c889 Reviewed-on: https://go-review.googlesource.com/c/go/+/285680 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Brad Fitzpatrick <bradfitz@golang.org>
2021-01-23cmd/internal/obj/arm64: fix VMOVQ instruction encoding erroreric fang
The VMOVQ instruction moves a 128-bit constant into a V register, as 128-bit constant can't be loaded into a register directly, we split it into two 64-bit constants and load it from constant pool. Currently we add the 128-bit constant to literal pool by calling the 'addpool' function twice, this is not the right way because it doesn't guarantee the two DWORD instructions are consecutive, and the second call of addpool will overwrite the p.Pool field,resulting in a wrong PC-relative offset value of the Prog. This CL renames the flag LFROM3 to LFROM128, and adds a new function addpool128 to add a 128-bit constant to the literal pool. Change-Id: I616f043c99a9a18a663f8768842cc980de2e6f79 Reviewed-on: https://go-review.googlesource.com/c/go/+/282334 Reviewed-by: eric fang <eric.fang@arm.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: eric fang <eric.fang@arm.com> Trust: eric fang <eric.fang@arm.com>
2021-01-23runtime: restore cgo_import_dynamic for libc.so on openbsdJoel Sing
This was removed in change 285692, however we need to explicitly pull libc.so in when libpthread.so is being used. The current code works on openbsd/amd64 since we pull libc.so in via runtime/sys_openbsd2.go, however openbsd/arm64 does not do this currently. Change-Id: Ibe93d936a22e69e2fe12620f6d27ccca7a91dba5 Reviewed-on: https://go-review.googlesource.com/c/go/+/285912 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-01-22io/ioutil: fix example test for WriteFile to allow it to run in the playgroundPantonshire
The example for WriteFile assumed the existence of a testdata/ directory, which is not present on the playground. The example now writes the file to the current working directory, rather than to testdata/. Fixes #32916 Change-Id: I577caac7e67ba9d9941b2dd19346ad5ff61e78d9 GitHub-Last-Rev: 40f14e0adc4ebc00fb2946fe0cbaf8e0cb99f62c GitHub-Pull-Request: golang/go#43757 Reviewed-on: https://go-review.googlesource.com/c/go/+/284452 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Bryan C. Mills <bcmills@google.com>
2021-01-22runtime: define dummy msanmoveCherry Zhang
In msan mode we instrument code with msan* functions, including msanmove. In some configurations the code is instrumented by the compiler but msan is not actually linked in, so we need dummy definitions for those functions so the program links. msanmove is newly added in CL 270859 but a dummy definition in msan0.go was not added, causing link failures. Add it. Change-Id: I91f8e749919f57f1182e90b43412b0282cf4767c Reviewed-on: https://go-review.googlesource.com/c/go/+/285955 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>