aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-06-16[release-branch.go1.21] go1.21rc1go1.21rc1Gopher Robot
time 2023-06-15T19:02:18Z Change-Id: If39aa20f4858a5a794f30e3564b0165e6d096b70 Reviewed-on: https://go-review.googlesource.com/c/go/+/504015 Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Bypass: Michael Pratt <mpratt@google.com> Run-TryBot: Gopher Robot <gobot@golang.org> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: David Chase <drchase@google.com>
2023-06-15[release-branch.go1.21] all: merge master (b7e7467) into release-branch.go1.21Michael Pratt
Merge List: + 2023-06-15 b7e7467865 test/codegen: add fsqrt test for riscv64 + 2023-06-15 befec5ddbb text/template: set variables correctly in range assignment + 2023-06-15 c5463218a2 cmd/api: skip TestIssue29837 when -short is set + 2023-06-15 9fc84363d1 cmd/asm: fix encoding errors for FMOVD and FMOVS instructions on arm64 + 2023-06-14 da94586aa3 cmd/go: check for errors reading gccgo package list + 2023-06-14 b01cd41b46 cmd/go: use gover.Local for $goversion in TestScript + 2023-06-14 3aea422e2c crypto/x509: use synthetic root for platform testing Change-Id: Icec55130749c52eef75c0e0325d889ff18b067f6
2023-06-15test/codegen: add fsqrt test for riscv64Meng Zhuo
Add FSQRTD FSQRTS codegen tests for riscv64 Change-Id: I16ca3753ad1ba37afbd9d0f887b078e33f98fda0 Reviewed-on: https://go-review.googlesource.com/c/go/+/503275 Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Run-TryBot: M Zhuo <mzh@golangcn.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-15text/template: set variables correctly in range assignmentIan Lance Taylor
I unintentionally flipped them in CL 446795. For #56490 Fixes #60801 Change-Id: I57586bec052e1b2cc61513870ce24dd6ce17e56b Reviewed-on: https://go-review.googlesource.com/c/go/+/503575 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2023-06-15cmd/api: skip TestIssue29837 when -short is setqmuntal
TestIssue29837 takes a long time to run, ~150s on my laptop and ~40s on CI builders. While here, warm up the go list cache in parallel, which reduces the test time by ~10%. Change-Id: Ib8d45b086453ee03e6c9f3f070d6f6b0d324bfd4 Reviewed-on: https://go-review.googlesource.com/c/go/+/502095 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2023-06-15cmd/asm: fix encoding errors for FMOVD and FMOVS instructions on arm64eric fang
The encoding of instructions "FMOVD F1, ZR" and "FMOVS F1, ZR" is wrong, the assembler encodes them as "FMOVD F1, F31" and "FMOVS F1, F31". This CL fixes the bug. Change-Id: I2d31520b58f9950ce2534a04f4a3275bf103a673 Reviewed-on: https://go-review.googlesource.com/c/go/+/503135 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-06-14cmd/go: check for errors reading gccgo package listIan Lance Taylor
Previously if there was something invalid about the package list cmd/go would crash rather than reporting a useful error. For #60798 Change-Id: I502facf41442ab49217405b5b1874fff52a6d416 Reviewed-on: https://go-review.googlesource.com/c/go/+/503496 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-06-14cmd/go: use gover.Local for $goversion in TestScriptBryan C. Mills
Previously we used the highest Go build tag found in the build configuration, which matches gover.Local for development toolchains (it is always a bare language version), but is too low for releases. Updates #57001. Change-Id: I74c2f7ab06231858eee99ecd11ed3759853e01ed Reviewed-on: https://go-review.googlesource.com/c/go/+/503537 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-14[release-branch.go1.21] update codereview.cfg for release-branch.go1.21Michael Pratt
Change-Id: Ib853d63f300b75ae399529dadd9baa03693b6f60 Reviewed-on: https://go-review.googlesource.com/c/go/+/503435 Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-14crypto/x509: use synthetic root for platform testingRoland Shoemaker
Rather than using the external network and real-world chains for testing the integrations with platform verifiers, use a synthetic test root. This changes adds a constrained root and key pair to the tree, and adds a test suite that verifies certificates issued from that root. These tests are only executed if the root is detected in the trust store. For reference, the script used to generate the root and key is attached to the bottom of this commit message. This change leaves the existing windows/darwin TestPlatformVerifier tests in place, since the trybots do not currently have the test root in place, and as such cannot run the suite. Once the builder images have the root integrated, we can remove the old flaky tests, and the trybots will begin running the new suite automatically. Updates #52108 -- gen.go -- package main import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "flag" "log" "math/big" "net" "os" "time" ) func writePEM(pemType string, der []byte, path string) error { enc := pem.EncodeToMemory(&pem.Block{ Type: pemType, Bytes: der, }) return os.WriteFile(path, enc, 0666) } func main() { certPath := flag.String("cert-path", "platform_root_cert.pem", "Path to write certificate PEM") keyPath := flag.String("key-path", "platform_root_key.pem", "Path to write key PEM") flag.Parse() key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) if err != nil { log.Fatalf("ecdsa.GenerateKey failed: %s", err) } now := time.Now() tmpl := &x509.Certificate{ SerialNumber: big.NewInt(9009), Subject: pkix.Name{ CommonName: "Go platform verifier testing root", }, NotBefore: now.Add(-time.Hour), NotAfter: now.Add(time.Hour * 24 * 365 * 5), IsCA: true, BasicConstraintsValid: true, PermittedDNSDomainsCritical: true, // PermittedDNSDomains restricts the names in certificates issued from this root to *.testing.golang.invalid. // The .invalid TLD is, per RFC 2606, reserved for testing, and as such anything issued for this certificate // should never be valid in the real world. PermittedDNSDomains: []string{"testing.golang.invalid"}, // ExcludedIPRanges prevents any certificate issued from this root that contains an IP address in both the full // IPv4 and IPv6 ranges from being considered valid. ExcludedIPRanges: []*net.IPNet{{IP: make([]byte, 4), Mask: make([]byte, 4)}, {IP: make([]byte, 16), Mask: make([]byte, 16)}}, KeyUsage: x509.KeyUsageCertSign, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, } certDER, err := x509.CreateCertificate(rand.Reader, tmpl, tmpl, key.Public(), key) if err != nil { log.Fatalf("x509.CreateCertificate failed: %s", err) } keyDER, err := x509.MarshalECPrivateKey(key) if err != nil { log.Fatalf("x509.MarshalECPrivateKey failed: %s", err) } if err := writePEM("CERTIFICATE", certDER, *certPath); err != nil { log.Fatalf("failed to write certificate PEM: %s", err) } if err := writePEM("EC PRIVATE KEY", keyDER, *keyPath); err != nil { log.Fatalf("failed to write key PEM: %s", err) } } Change-Id: If7c4a9f18466662a60fea5443e603232a9260026 Reviewed-on: https://go-review.googlesource.com/c/go/+/488855 Reviewed-by: Filippo Valsorda <filippo@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-14slices: consistently use S ~[]EIan Lance Taylor
Make all functions use a constraint S ~[]E even if they don't return the slice type. This makes explicitly instantiating the functions more consistent: you don't have to remember which take ~[]E and which do not. It also permits inferring the type when passing one of these functions to some other function that is using a named slice type. Fixes #60546 Change-Id: Ib3435255d0177fdbf03455ae527d08599b1ce012 Reviewed-on: https://go-review.googlesource.com/c/go/+/502955 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Axel Wagner <axel.wagner.hh@googlemail.com> Reviewed-by: Eli Bendersky <eliben@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-06-14spec: explain in which situations function type arguments can be omittedRobert Griesemer
Change-Id: I9f008dba7ba6e30f0e62647482a3ed0b51bc1ad0 Reviewed-on: https://go-review.googlesource.com/c/go/+/502997 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Bypass: Robert Griesemer <gri@google.com>
2023-06-14syscall: Fix Getwd on Windows to correctly handle long paths.Qi Xiao
Fixes #60051. Change-Id: Ia68ca0493912cb09d8c1d36a144bf0725842af1d Reviewed-on: https://go-review.googlesource.com/c/go/+/502415 Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Quim Muntal <quimmuntal@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2023-06-14net: fix panic when calling net.Listen or net.Dial on wasip1Achille Roussel
Address a panic that was caused by net.Dial/net.Listen entering the fake network stack and assuming that the addresses would be of type *TCPAddr, where in fact they could have been *UDPAddr or *UnixAddr as well. The fix consist in implementing the fake network facility for udp and unix addresses, preventing the assumed type assertion to TCPAddr from triggering a panic. New tests are added to verify that using the fake network from the exported functions of the net package satisfies the minimal requirement of being able to create a listener and establish a connection for all the supported network types. Fixes #60012 Fixes #60739 Change-Id: I2688f1a0a7c6c9894ad3d137a5d311192c77a9b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/502315 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2023-06-14internal/xcoff: remove blank lines after final return statementsJes Cok
Change-Id: I869ebcd9a134d0010e419dc51b6f91eddeaa0bbd GitHub-Last-Rev: 0fc44edaeafcc2042e0fe57c8c41b4f60d4c478c GitHub-Pull-Request: golang/go#60764 Reviewed-on: https://go-review.googlesource.com/c/go/+/502835 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-14all: fix spelling errorsAlexander Yastrebov
Fix spelling errors discovered using https://github.com/codespell-project/codespell. Errors in data files and vendored packages are ignored. Change-Id: I83c7818222f2eea69afbd270c15b7897678131dc GitHub-Last-Rev: 3491615b1b82832cc0064f535786546e89aa6184 GitHub-Pull-Request: golang/go#60758 Reviewed-on: https://go-review.googlesource.com/c/go/+/502576 Auto-Submit: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
2023-06-13all: update vendored dependenciesMichael Pratt
Generated with x/build/cmd/updatestd. For #36905. For #55079. Change-Id: I5ba28993359cb5bbfb1bc7cfcea9576b07fcfb14 Reviewed-on: https://go-review.googlesource.com/c/go/+/502878 Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-13net: ensure net.Addr values match the connection type on wasip1Achille Roussel
net.FileListener returns values of type *net.TCPListener, which can be asserted by the application. The (*net.TCPListener).Addr method documents that the underlying type of its return value is *net.TCPAddr, which is fixed by this change. Change-Id: Ife9906716d1b512092024ba50797bf7831536b75 Reviewed-on: https://go-review.googlesource.com/c/go/+/502335 Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
2023-06-13go/types, types2: fix Hilbert test for stand-alone runRobert Griesemer
When run as a stand-alone test (without other tests running before), the builtin function 'assert' (only available for testing) is missing. Make sure it's declared. This change only affects this test, when run stand-alone, as in: go test -run Hilbert Fixes #60774. Change-Id: Ib07d97ba2670b839e8ad11ef50d0e6581bb3d79d Reviewed-on: https://go-review.googlesource.com/c/go/+/502996 Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
2023-06-13cmd/dist: more robust cleanupRuss Cox
Identify generated files by name prefix (z*) and content (^// Code generated by go tool dist) instead of having a fixed list. This will be more robust against doing make.bash and then rewinding git and then doing make.bash again. Change-Id: If9b4d02f5ad65345623866176d96e9894a957dc8 Reviewed-on: https://go-review.googlesource.com/c/go/+/501036 Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2023-06-13doc/go1.21: document GOPPC64=power10 changesPaul E. Murphy
For #44549 Change-Id: I1af1d4bbd01a4571a32815bfea16bc395524551a Reviewed-on: https://go-review.googlesource.com/c/go/+/501358 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Eli Bendersky <eliben@google.com>
2023-06-13all: fix mismatched symbolscui fliter
There are some symbol mismatches in the comments, this commit attempts to fix them Change-Id: I5c9075e5218defe9233c075744d243b26ff68496 Reviewed-on: https://go-review.googlesource.com/c/go/+/492996 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: shuang cui <imcusg@gmail.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
2023-06-13database/sql: fix flake in TestContextCancelDuringRawBytesScanRuss Cox
If the cancellation takes effect between Next and Scan, then Scan returns context.Canceled, but the test wasn't allowing this case. The old flake reproduced easily with: go test -c stress ./sql.test -test.count=100 -test.run=TestContextCancelDuringRawBytesScan The new test modes exercise that path directly instead of needing stress. The new check for context.Canceled fixes the new test mode "top". Fixes #60445. Change-Id: I3870039a0fbe0a43c3e261b43b175ef83f818765 Reviewed-on: https://go-review.googlesource.com/c/go/+/502876 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2023-06-13cmd/internal/obj: make aix/ppc64 builds reproducibleRuss Cox
sort.Slice was being used to sort some newly added entries by name to make the ctxt.Data slice reproducible, but some existing entries have the same name, and the effect was to take the non-determinism of the tail entries and scatter it into the earlier, deterministic section when multiple entries had the same name. The specific entries with the same name are type SDWARFVAR, which all have an empty name but different relocations. If they are shuffled, then the relocation symbols are visited in a different order, which enters them into the string table in a different order, which results in different object files, different object file hashes, and different build IDs for the final executables. Use sort.SliceStable to avoid reordering entries we don't mean to reorder. Also add a simple test for scheduling-related non-determinism. I debugged this originally using 'go install -race cmd/compile', but that was slow and turned out not to be terribly reliable. Using a few different GOMAXPROCS settings turns out to be a much more effective (and faster) way to scramble scheduling decisions. Fixes #60759. Change-Id: Ia966b02b9fdaefa971f998a09319ca375bdf8604 Reviewed-on: https://go-review.googlesource.com/c/go/+/502755 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> Auto-Submit: Russ Cox <rsc@golang.org> TryBot-Bypass: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-06-13runtime: Use doas -n in TestSUID on OpenBSDJosh Rickmar
This prevents a hang at a su password prompt when running this test on OpenBSD. Fixes #60690. Change-Id: I62d27aa63f225f8247c324b87b5e688319061f4f GitHub-Last-Rev: 217813a4d57a97954449d13c24a465aa0af41da3 GitHub-Pull-Request: golang/go#60742 Reviewed-on: https://go-review.googlesource.com/c/go/+/502575 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2023-06-13sort: comments directing new code to use the slices package when applicableEli Bendersky
Change-Id: I0d4e902736fb3a75d128a088901055bece6c1a71 Reviewed-on: https://go-review.googlesource.com/c/go/+/502555 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Eli Bendersky <eliben@google.com> Auto-Submit: Eli Bendersky <eliben@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Eli Bendersky <eliben@google.com>
2023-06-13spec: de-emphasize string(int) conversionsRobert Griesemer
Fixes #60731. Change-Id: I71fad1c8385b13d036bb0ce7ae6bd21e0f596e51 Reviewed-on: https://go-review.googlesource.com/c/go/+/502657 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Bypass: Robert Griesemer <gri@google.com>
2023-06-13spec: document new program initialization processRobert Griesemer
For #57411. Change-Id: I94982d939d16ad17174f801cc167cc10ddc8da30 Reviewed-on: https://go-review.googlesource.com/c/go/+/501696 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Bypass: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2023-06-13crypto/ecdsa: properly truncate P-521 hashesFilippo Valsorda
Before, if a hash was exactly 66 bytes long, we weren't truncating it for use with P-521, because the byte length was not overflowing. However, the bit length could still overflow. Fixes #60741 Change-Id: I37a0ee210add0eb566e6dc1c141e83e992983eb6 Reviewed-on: https://go-review.googlesource.com/c/go/+/502478 Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
2023-06-13runtime/trace: disable frame pointer unwinding on plan9Philip Silva
Fixes #60254 Change-Id: Ifd9e517a9479e5cd63fd3622b2556989d5f84eb9 Reviewed-on: https://go-review.googlesource.com/c/go/+/499036 Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Bypass: Keith Randall <khr@golang.org>
2023-06-13slices: add benchmark for IsSorted vs. IntsAreSortedEli Bendersky
We'd like to mention in a comment that users should prefer slices.IsSorted over sort.IntsAreSorted and similar functions. Create a benchmark that shows this. goos: linux goarch: amd64 pkg: slices cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz BenchmarkIntsAreSorted-8 6031 198315 ns/op BenchmarkIsSorted-8 26580 45801 ns/op Change-Id: I4f14fafd799ecec35c8a5215b74994e972103061 Reviewed-on: https://go-review.googlesource.com/c/go/+/502556 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Eli Bendersky‎ <eliben@golang.org> Reviewed-by: Eli Bendersky <eliben@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-13cmd/link: fix log formats for log.Fatal callsRuss Cox
link contains many calls to log.Fatal, but it uses the default log output format, which is configured for server programs, not command-line tools. Set it up for command-line tools instead. Changes errors like 2023/06/12 14:32:24 reference to undefined builtin "runtime.gcWriteBarrier" from package "internal/abi" to link: reference to undefined builtin "runtime.gcWriteBarrier" from package "internal/abi" Change-Id: I3565960408c03f2f499a7517ec18c01870eb166c Reviewed-on: https://go-review.googlesource.com/c/go/+/502698 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-06-12net: test net.FileConn and net.FileListener with UDP sockets on wasip1Achille Roussel
The WASI specification has file types for both stream and datagram sockets. This change refactors the internal implementation of the net.FileConn and net.FileListener functions to avoid returning a misleading ENOTSOCK when calling net.FileConn with a file referencing a datagram socket and instead properly construct net.UDPConn values or return EOPNOTSUPP otherwise. Change-Id: I594f700847254895cd6ce172979fd89c4b851940 Reviewed-on: https://go-review.googlesource.com/c/go/+/502316 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-06-12doc/go1.21: clean up remaining TODOsMichael Pratt
These sections are now complete, remove remaining TODOs. Several entries were missing CL numbers. For #58645 Change-Id: I67489356016013be876c4bd522afb977becf54ac Reviewed-on: https://go-review.googlesource.com/c/go/+/502696 Run-TryBot: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
2023-06-12cmd/dist: do not use user build cache in versioned treesRuss Cox
There is no guarantee that the user build cache will have correct data if we are using a versioned build (with a VERSION file), because that overrides the use of tool build IDs for staleness. An earlier build might have run with a buggy compiler, and we don't want those files lying around. Change-Id: I831956911162ccbd0b4d943c305b3537918fe119 Reviewed-on: https://go-review.googlesource.com/c/go/+/502699 Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2023-06-12cmd/compile: use callsite as line number for argument marshalingKeith Randall
Don't use the line number of the argument itself, as that may be from arbitrarily earlier in the function. Fixes #60673 Change-Id: Ifc0a2aaae221a256be3a4b0b2e04849bae4b79d7 Reviewed-on: https://go-review.googlesource.com/c/go/+/502656 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com>
2023-06-12cmd/go/internal/modload: address comment and test issues from CL 496635Bryan C. Mills
Michael noticed some minor issues in backports of CL 496635. Those issues have been addressed in the backport CLs; this change applies them to the main branch as well. Updates #60313. Change-Id: If68696711a10a9270193df66ed551395c14cae00 Reviewed-on: https://go-review.googlesource.com/c/go/+/502695 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-12go/build: check for invalid import paths againMichael Matloob
The go parser previously checked for invalid import paths, go/build, seeing the parse error would put files with invalid import paths into InvalidGoFiles. golang.org/cl/424855 removed that check from the parser, which meant files with invalid import paths not have any parse errors on them and not be put into InvalidGoFiles. Do a check for invalid import paths in go/build soon after parsing so we can make sure files with invalid import paths go into InvalidGoFiles. This fixes an issue where the Go command assumed that if a file wasn't invalid it had non empty import paths, leading to a panic. Fixes #60230 Fixes #60686 Change-Id: I33c1dc9304649536834939cef7c689940236ee20 Reviewed-on: https://go-review.googlesource.com/c/go/+/502615 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org>
2023-06-12Revert "crypto/internal/nistec: refactor scalar multiplication"Filippo Valsorda
This reverts CL 471256, except for its new tests, which are expanded to cover the case in #60717. Updates #60717 Change-Id: I712bbcd05bf3ea4a2c9aecc9e0f02841b21aadfa Reviewed-on: https://go-review.googlesource.com/c/go/+/502477 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Filippo Valsorda <filippo@golang.org> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
2023-06-12go/types, types2: use correct reverse inference approachRobert Griesemer
To infer type arguments in an assignment of the form var target func(t1, t2, ...) = g where g is a generic function func g[P1, P2, ...](p1, p2, ...) the type checker used the synthetic function call g(t1, t2, ...) But because each argument (of type) t1, t2, ... is assigned to its corresponding parameter p1, p2, ..., type inference uses assignment rules ("inexact match") for unification. As a result, types such as mystring and string match even though they should not (they are not identical), yet function parameter types must be identical to match. This CL fixes this by constructing the synthetic call g'(func(t1, t2, ...)) where g' is the generic function func g'[P1, P2, ...](func(p1, p2, ...)) This mimics the function assignment directly by representing it as a single argument passing (of a function-typed argument). Function parameter types must now be identical to unify. As an added benefit, the implementation is simpler. As a consequence, when such an assignment is invalid because the function types cannot possibly match, we now correctly get an inference error. Without this change, in some cases unification would succeed, only to lead to an assignment error afterwards. While at it, update the date in the copyright notice of testdata/manual.go so we don't need to fix it each time we copy code from a test case in manual.go into a issueXXXXX.go file. Fixes #60688. Change-Id: I716247f426ef33d76c7849b0c33c59124e55b859 Reviewed-on: https://go-review.googlesource.com/c/go/+/501938 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-12cmd/compile/internal/types2: add missing tests from go/typesRobert Griesemer
Add 3 tests that exist in go/types but that were not ported to types2. Change-Id: I34d219f605f9ae66e8b4439c3dfe93cfa0ec9524 Reviewed-on: https://go-review.googlesource.com/c/go/+/501304 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-12go/types, types2: use inexact unification when unifying against core typesRobert Griesemer
Follow-up on CL 498955 which introduced a unification mode, to be used to control the precision of unification of element types (CL 498895): When unifying against core types of unbound type parameters, we must use inexact unification at the top (irrespective of the unification mode), otherwise it may fail when unifying against a defined type (core types are always underlying types). No specific test case (I have not been able to create one yet). Change-Id: Ie15e98f4b9e9fb60d6857d34b03d350ebbf0375e Reviewed-on: https://go-review.googlesource.com/c/go/+/501302 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com>
2023-06-12doc/go1.21: fix typochressie
Change-Id: Ie0af0ff135ac14d35476d738a16f04e9c3eebcd2 Reviewed-on: https://go-review.googlesource.com/c/go/+/502475 TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Chressie Himpel <chressie@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-06-12cmd/go: omit checksums for go.mod files needed for go version lines more ↵Bryan C. Mills
often in pre-1.21 modules This updates the logic from CL 489075 to avoid trying to save extra sums if they aren't already expected to be present and cfg.BuildMod != "mod" (as in the case of "go list -m -u all" with a go.mod file that specifies go < 1.21). Fixes #60667. Updates #56222. Change-Id: Ied6ed3e80a62f9cd9a328b43a415a42d14481056 Reviewed-on: https://go-review.googlesource.com/c/go/+/502015 Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-11net/url: correct field name in Redacted doc commentIan Lance Taylor
Fixes #60716 Change-Id: I86037784d6c12fd22bd03c3efabef379fa0646aa Reviewed-on: https://go-review.googlesource.com/c/go/+/502355 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-06-11doc/go1.21: add heading for cmp packageDmitri Shuralyov
For #59488. For #58645. Change-Id: Ia9b76d49825dd74f7e52d829ec6d47e6c2addd76 Reviewed-on: https://go-review.googlesource.com/c/go/+/501825 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
2023-06-11cmp, builtin: document NaN behaviorIan Lance Taylor
Add notes for cmp.Ordered and builtin.{min,max}. Fixes #60648 Change-Id: I81806af2d9a0613befde3f2bbfbc2720f0726912 Reviewed-on: https://go-review.googlesource.com/c/go/+/502235 Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org>
2023-06-11context: fix doc tipo (s/timout/timeout)Ian Lance Taylor
Change-Id: Ib02b35887896eab418ba9dde764754538cb23b4f Reviewed-on: https://go-review.googlesource.com/c/go/+/501277 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-10runtime: fix typosJes Cok
Change-Id: If13f4d4bc545f78e3eb8c23cf2e63f0eb273d71f GitHub-Last-Rev: 32ca70f52a5c3dd66f18535c5e595e66afb3903c GitHub-Pull-Request: golang/go#60703 Reviewed-on: https://go-review.googlesource.com/c/go/+/502055 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-10syscall: implement Ptrace{Set,Get}Regs using PTRACE_{GET,SET}REGSET on all ↵chenguoqi
linux platforms In the ptrace system call, most of the newer architectures (e.g. arm64,riscv64,loong64) do not provide support for the command PTRACE_{GET, SET}REGS. The Linux kernel 2.6.33-rc7[1] introduces support for the command PTRACE_{GET,SET}REGSET, which exports different types of register sets depending on the NT_* types, completely overriding the functionality provided by PTRACE_{GET,SET}REGS. [1] https://lore.kernel.org/all/20100211195614.886724710@sbs-t61.sc.intel.com/ Fixes #60679. Change-Id: I8c2671d64a7ecd654834740f4f1e1e50c00edcae Reviewed-on: https://go-review.googlesource.com/c/go/+/501756 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>