1
0
mirror of https://github.com/golang/go synced 2024-11-22 22:40:02 -07:00
Commit Graph

60537 Commits

Author SHA1 Message Date
TangYang
601ea46a53 runtime: add ERMS-based memmove support for modern CPU platforms
The current memmove implementation uses REP MOVSB to copy data larger than
2KB when the useAVXmemmove global variable is false and the CPU supports
the ERMS feature.

This feature is currently only enabled on CPUs in the Sandy Bridge (Client)
, Sandy Bridge (Server), Ivy Bridge (Client), and Ivy Bridge (Server)
microarchitectures.

For modern Intel CPU microarchitectures that support the ERMS feature, such
as Ice Lake (Server), Sapphire Rapids , REP MOVSB achieves better
performance than the AVX-based copy currently implemented in memmove.

Benchstat result:

goos: linux
goarch: amd64
pkg: runtime
cpu: Intel(R) Xeon(R) Gold 6348 CPU @ 2.60GHz
               │  ./old.txt  │              ./new.txt              │
               │   sec/op    │   sec/op     vs base                │
Memmove/2048-2   25.24n ± 0%   24.27n ± 0%   -3.84% (p=0.000 n=10)
Memmove/4096-2   44.87n ± 0%   33.16n ± 1%  -26.11% (p=0.000 n=10)
geomean          33.65n        28.37n       -15.71%

               │  ./old.txt   │               ./new.txt               │
               │     B/s      │      B/s       vs base                │
Memmove/2048-2   75.56Gi ± 0%    78.59Gi ± 0%   +4.02% (p=0.000 n=10)
Memmove/4096-2   85.01Gi ± 0%   115.05Gi ± 1%  +35.34% (p=0.000 n=10)
geomean          80.14Gi         95.09Gi       +18.65%

Fixes #66958

Change-Id: I1fafd1b51a16752f83ac15047cf3b29422a79d5d
GitHub-Last-Rev: 89cf5af32b
GitHub-Pull-Request: golang/go#66959
Reviewed-on: https://go-review.googlesource.com/c/go/+/580735
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-07-22 21:22:16 +00:00
Diego Augusto Molina
20e18c9550 unicode/utf8: AppendRune and EncodeRune performance improvement
- Prefer the evaluation of the valid higher byte-width runes branches
over the one for invalid ones
- Avoid the evaluation of the bytes of the RuneError constant, and
instead hard code its byte values
- EncodeRune only: inline for fast handling of ASCII

goos: linux
goarch: amd64
pkg: unicode/utf8
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
                              │ baseline.test-append.txt │ append-rune-invalid-case-last.test.txt │
                              │          sec/op          │     sec/op      vs base                │
AppendASCIIRune-8                           0.2135n ± 0%     0.2135n ± 0%        ~ (p=0.578 n=20)
AppendSpanishRune-8                          1.645n ± 1%      1.509n ± 2%   -8.30% (p=0.000 n=20)
AppendJapaneseRune-8                         2.196n ± 1%      2.004n ± 1%   -8.74% (p=0.000 n=20)
AppendMaxRune-8                              2.670n ± 1%      2.349n ± 3%  -12.01% (p=0.000 n=20)
AppendInvalidRuneMaxPlusOne-8                2.214n ± 2%      1.798n ± 3%  -18.77% (p=0.000 n=20)
AppendInvalidRuneSurrogate-8                 2.258n ± 1%      1.793n ± 2%  -20.59% (p=0.000 n=20)
AppendInvalidRuneNegative-8                  2.171n ± 2%      1.767n ± 2%  -18.61% (p=0.000 n=20)
geomean                                      1.559n           1.361n       -12.69%

goos: linux
goarch: amd64
pkg: unicode/utf8
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
                              │ baseline.test-encode.txt │     encode-rune-invalid-last.txt     │
                              │          sec/op          │    sec/op     vs base                │
EncodeASCIIRune-8                           1.0950n ± 1%   0.2140n ± 0%  -80.46% (p=0.000 n=20)
EncodeSpanishRune-8                          1.499n ± 0%    1.414n ± 2%   -5.64% (p=0.000 n=20)
EncodeJapaneseRune-8                         1.960n ± 2%    1.716n ± 4%  -12.43% (p=0.000 n=20)
EncodeMaxRune-8                              2.145n ± 2%    2.227n ± 1%   +3.78% (p=0.000 n=20)
EncodeInvalidRuneMaxPlusOne-8                1.955n ± 2%    1.802n ± 2%   -7.80% (p=0.000 n=20)
EncodeInvalidRuneSurrogate-8                 1.946n ± 3%    1.777n ± 2%   -8.68% (p=0.000 n=20)
EncodeInvalidRuneNegative-8                  1.968n ± 2%    1.766n ± 2%  -10.29% (p=0.000 n=20)
geomean                                      1.757n         1.308n       -25.57%

Fixes #68131

Change-Id: Ibcafa75d63cca07a2e78cd06f6f1e382cb8c716e
Reviewed-on: https://go-review.googlesource.com/c/go/+/594115
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-07-22 21:20:30 +00:00
Keith Randall
afe0e60054 cmd/compile: give function position on function-too-big error
Update #67916

Change-Id: Iec3603c136b30ff6f760783c175eeb7e6ce139ec
Reviewed-on: https://go-review.googlesource.com/c/go/+/591675
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
2024-07-22 21:20:26 +00:00
Will Faught
e061fb89e8 text/template: fix doc spacing
Change-Id: I4550ce3135b3cd675010a3701618e9350f282453
GitHub-Last-Rev: d2e52f1496
GitHub-Pull-Request: golang/go#68519
Reviewed-on: https://go-review.googlesource.com/c/go/+/599535
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Rob Pike <r@golang.org>
2024-07-22 20:58:50 +00:00
Darren
00cb41e14d flag: handle nil os.Args when setting CommandLine at package level
Fixes #68340

Change-Id: I65037be6961e9ec720537713cb3f23ab9f5f8459
GitHub-Last-Rev: fadcb299c3
GitHub-Pull-Request: golang/go#68341
Reviewed-on: https://go-review.googlesource.com/c/go/+/597075
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Rob Pike <r@golang.org>
2024-07-22 20:58:27 +00:00
Yossef Hisham
53270be21c strconv: document that Unquote("''") returns an empty string
Fixes #64280

Change-Id: I1ad84d85b666a2ef52dc6ecdecd508b4e7fe24a6
GitHub-Last-Rev: 6242027261
GitHub-Pull-Request: golang/go#68524
Reviewed-on: https://go-review.googlesource.com/c/go/+/599575
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2024-07-22 18:35:09 +00:00
Olivier Mengué
a6f3add91a net: add godoc links on UDP related symbols
Change-Id: Ibc861e7b2aebc8fd1e0ba15d8d35ae0ecfe7747e
Reviewed-on: https://go-review.googlesource.com/c/go/+/599996
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-07-22 18:33:24 +00:00
Dmitri Shuralyov
e8c5bed7ea doc: initialize next directory for Go 1.24
Following the "For the release team" steps in README:

	cd doc
	cp -R initial/ next
	$EDITOR next/1-intro.md

Dropped '*' from the cp -R command to avoid needing to
create an empty next directory with a separate command.

For #68545.
For #67586.

Change-Id: I25215bc35a043e0f26d4a86ffe66eb3c26348fef
Reviewed-on: https://go-review.googlesource.com/c/go/+/600177
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-07-22 17:55:04 +00:00
Dmitri Shuralyov
c622f5c341 internal/goversion: update Version to 1.24
Go 1.24 is in the process of being opened for development (to be
eventually released). This change marks the very beginning of its
development cycle, updating the Version value accordingly.

For #40705.
For #67586.

Change-Id: Ibd194f229e7dbd25bc2713f86330fab50ea1dfaa
Reviewed-on: https://go-review.googlesource.com/c/go/+/600176
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2024-07-22 17:52:34 +00:00
Will Faught
5e8a731665 README: fix CC BY license name
Change-Id: Idf3c4427426e3cb74c7749762f2b4f621cf82dba
GitHub-Last-Rev: 86f51a5d50
GitHub-Pull-Request: golang/go#68518
Reviewed-on: https://go-review.googlesource.com/c/go/+/599515
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-07-22 17:45:27 +00:00
Sean Liao
a799fa5189 slices: explicitly document nil and empty slice equality
Fixes #68472

Change-Id: I21282621d679d9e2b032256b338c0b5ff107c8f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/599816
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-22 17:38:46 +00:00
Cherry Mui
f0de94ff12 cmd/compile: don't inline runtime functions in -d=checkptr build
Runtime functions, e.g. internal/abi.NoEscape, should not be
instrumented with checkptr. But if they are inlined into a
checkptr-enabled function, they will be instrumented, and may
result in a check failure.

Let the compiler not inline runtime functions into checkptr-
enabled functions.

Also undo the change in the strings package in CL 598295, as the
compiler handles it now.

Fixes #68511.
Updates #68415.

Change-Id: I78eb380855ac9dd53c1a1a628ec0da75c3e5a1a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/599435
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
2024-07-22 15:45:09 +00:00
Cuong Manh Le
3959d54c0b runtime: mark lockWithRankMayAcquire as nosplit
The function is called in nosplit context already.

Fixes #68525

Change-Id: I8b9e324335b7c605d5a20cacdd58df09b7a7cf52
Reviewed-on: https://go-review.googlesource.com/c/go/+/599675
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2024-07-19 19:51:57 +00:00
Sean Liao
70491a8111 maps: document handling of non-reflexive keys
Fixes #63312

Change-Id: I7861bddcd4c6dc208b4449b923eb2785a122aadf
Reviewed-on: https://go-review.googlesource.com/c/go/+/553157
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Auto-Submit: Keith Randall <khr@golang.org>
2024-07-17 23:08:52 +00:00
Rob Findley
7321aa91c6 cmd: vendor golang.org/x/telemetry@0b706e1
Update x/telemetry to fix problems caused by the file rotation timer.

Commands run:
  go get golang.org/x/telemetry@0b706e1
  go mod tidy
  go mod vendor

Fixes golang/go#68497

Change-Id: I29861ec89dfaaf260eb051eb23ab9251903b5ea8
Reviewed-on: https://go-review.googlesource.com/c/go/+/598957
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-17 20:45:50 +00:00
Ian Lance Taylor
420037b16d os: don't try to signal PID -1 on Unix
This restores behavior that we lost in CL 588675.

Fixes #68496

Change-Id: I1740986bed647835986d54109071b7a6b37413d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/599015
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
2024-07-17 20:32:58 +00:00
Nick Ripley
87abb4afb6 runtime: avoid multiple records with identical stacks from MutexProfile
When using frame pointer unwinding, we defer frame skipping and inline
expansion for call stacks until profile reporting time. We can end up
with records which have different stacks if no frames are skipped, but
identical stacks once skipping is taken into account. Returning multiple
records with the same stack (but different values) has broken programs
which rely on the records already being fully aggregated by call stack
when returned from runtime.MutexProfile. This CL addresses the problem
by handling skipping at recording time. We do full inline expansion to
correctly skip the desired number of frames when recording the call
stack, and then handle the rest of inline expansion when reporting the
profile.

The regression test in this CL is adapted from the reproducer in
https://github.com/grafana/pyroscope-go/issues/103, authored by Tolya
Korniltsev.

Fixes #67548

This reapplies CL 595966.
The original version of this CL introduced a bounds error in
MutexProfile and failed to correctly expand inlined frames from that
call. This CL applies the original CL, fixing the bounds error and
adding a test for the output of MutexProfile to ensure the frames are
expanded properly.

Change-Id: I5ef8aafb9f88152a704034065c0742ba767c4dbb
Reviewed-on: https://go-review.googlesource.com/c/go/+/598515
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-07-17 19:17:19 +00:00
Cherry Mui
8c88f0c736 cmd/cgo/internal/testcarchive: remove 1-minute timeout
The 1-minute test timeout seems a bit arbitrary. Use
internal/testenv.Command, which applies t.Deadline to subcommand.

For #67566.

Change-Id: If84c96e353bdfaf02c9b123758198e031305ae32
Reviewed-on: https://go-review.googlesource.com/c/go/+/599056
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-07-17 19:00:57 +00:00
withsky
fc51e5023e math/big: fix comment typo in natdiv.go
Comment in line 395:
[x₀ < S, so S - x₀ < 0; drop it]
Should be:
[x₀ < S, so S - x₀ > 0; drop it]

The proof is based on S - x₀ > 0, thus it's a typo of comment.

Fixes #68466

Change-Id: I68bb7cb909ba2bfe02a8873f74b57edc6679b72a
GitHub-Last-Rev: 40a2fc80cf
GitHub-Pull-Request: golang/go#68487
Reviewed-on: https://go-review.googlesource.com/c/go/+/598855
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
2024-07-17 15:08:04 +00:00
Zxilly
90c6558b6a internal/bytealg: extend memchr result correctly on wasm
The mem address should be regarded as uint32.

Fixes #65571

Change-Id: Icee38d11f2d93eeca7d50b2e133159e321daeb90
GitHub-Last-Rev: c2568b1043
GitHub-Pull-Request: golang/go#68400
Reviewed-on: https://go-review.googlesource.com/c/go/+/597955
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-17 07:00:20 +00:00
Than McIntosh
355711821e cmd/internal/cov: close counter data files eagerly
When reading the counter data files from a given pod, close the
underlying *os.File immediately after each one is read, as opposed to
using a deferred close in the loop (which will close them all at the
end of the function). Doing things this way avoids running into "too
many open files" when processing large clumps of counter data files.

Fixes #68468.

Change-Id: Ic1fe1d36c44d3f5d7318578cd18d0e65465d71d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/598735
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-16 20:20:05 +00:00
Kir Kolyshkin
f2bcab5fb3 regexp: more cross-references in docstrings
Change-Id: I93f617bb6d82b00d44ce9a54c2ddcc8a61209783
Reviewed-on: https://go-review.googlesource.com/c/go/+/597776
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2024-07-16 20:07:41 +00:00
Kir Kolyshkin
9915b87059 bytes: more cross-references in docstrings
Change-Id: Iea0243edcf8bf73ce325695178a3ea5cfe420d31
Reviewed-on: https://go-review.googlesource.com/c/go/+/597775
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-16 18:17:37 +00:00
Kir Kolyshkin
97ccc224f1 math/big: use lists in docstrings
This looks way better than the code formatting.

Similar to CL 597656.

Change-Id: I2c8809c1d6f8a8387941567213880662ff649a73
Reviewed-on: https://go-review.googlesource.com/c/go/+/597659
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-16 18:17:35 +00:00
Kir Kolyshkin
66e940b6f8 math/big: more cross-references in docstrings
Change-Id: I3541859bbf3ac4f9317b82a66d21be3d5c4c5a84
Reviewed-on: https://go-review.googlesource.com/c/go/+/597658
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-07-16 18:17:32 +00:00
Kir Kolyshkin
0dae393a26 encoding/binary: use list format in docstrings
This looks way better than the code formatting.

Similar to CL 597656.

Change-Id: If404c952ece384aea096f2394bd475a601627a79
Reviewed-on: https://go-review.googlesource.com/c/go/+/597657
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-07-16 18:17:30 +00:00
Kir Kolyshkin
451a284d80 strings,bytes,regexp: use lists in Split* docstrings
This looks better than the default of using a code block.
While at it, fix punctuation.

Change-Id: I86abca4da1e9999b7e9043e615ad0988d35a5a46
Reviewed-on: https://go-review.googlesource.com/c/go/+/597656
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-16 18:17:26 +00:00
Clide Stefani
b4a92f56ff crypto/tls: add exclude tls flags to bogo_shim_test
The existing implementation of bogo_shim_test does not support tests
that use the -no-tls1, -no-tls11, or -no-tls12 flags.
This change adds support for these flags.

Updates #51434

Change-Id: I43eaea9f5ec6da6811b150630a7dde24d108017e
Reviewed-on: https://go-review.googlesource.com/c/go/+/595775
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Russell Webb <russell.webb@protonmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2024-07-16 18:17:19 +00:00
Sean Liao
3bfbfa821f encoding/json: document compact json output in Encoder.Encode
Using the same wording as Compact.

Fixes #67943

Change-Id: I578874f3e917bba1634dd988895e622a5ac78c74
Reviewed-on: https://go-review.googlesource.com/c/go/+/597976
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-07-16 18:06:21 +00:00
Sean Liao
d5479e197d net: document ParseIP always returns IPv6 addresses
Fixes #65131

Change-Id: I050c6459a8e0a6c99425759d3131cf775b05aac9
Reviewed-on: https://go-review.googlesource.com/c/go/+/598076
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-07-16 18:03:01 +00:00
Sean Liao
5c7f541386 archive/zip: document handling of duplicate names in Writer.Create
Fixes #66810

Change-Id: I6a7848dce245ae14941d61d2f78abaf0dc5c1247
Reviewed-on: https://go-review.googlesource.com/c/go/+/597978
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-07-16 18:02:59 +00:00
cui fliter
6b97448132 sort: add example for Find
Change-Id: Id7b12356dd2114dfbab260cff00114b6055ee011
Reviewed-on: https://go-review.googlesource.com/c/go/+/561175
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-16 17:55:15 +00:00
Cuong Manh Le
8b48290895 cmd/compile: fix recursive generic interface instantiation
When shapifying recursive instantiated types, the compiler ends up
leaving the type as-is if it already has been a shape type. However, if
both of type arguments are interfaces, and one of them is a recursive
one, it ends up being shaped as-is, while the other is shaped to its
underlying, causing mismatch in function signature.

Fixing this by shapifying an interface type as-is, if it is fully
instantiated and already been a shape type.

Fixes #65362
Fixes #66663

Change-Id: I839d266e0443b41238b1b7362aca09adc0177362
Reviewed-on: https://go-review.googlesource.com/c/go/+/559656
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2024-07-16 16:43:30 +00:00
Miki Tebeka
959b3fd426 flag: add FlagSet example
Add an example for using FlagSet.

Fixes #36307

Change-Id: I0bf5805bd836a4f2e9632aafe22dc3eeb1164dcd
GitHub-Last-Rev: 79e53040cb
GitHub-Pull-Request: golang/go#64443
Reviewed-on: https://go-review.googlesource.com/c/go/+/545736
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Christopher Taylor <ccmtaylor@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2024-07-15 21:12:53 +00:00
Cherry Mui
6948b4df8c Revert "runtime: avoid multiple records with identical stacks from MutexProfile"
This reverts CL 595966.

Reason for revert: This CL contains a bug. See the comment in https://go-review.googlesource.com/c/go/+/595966/8#message-57f4c1f9570b5fe912e06f4ae3b52817962533c0

Change-Id: I48030907ded173ae20a8965bf1b41a713dd06059
Reviewed-on: https://go-review.googlesource.com/c/go/+/598219
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-07-15 20:09:02 +00:00
Cuong Manh Le
8f1ec59bdb strings: re-introduce noescape wrapper
CL 573955 added internal/abi:NoEscape function, and use it in strings
builder copyCheck code.

However, internal/abi is a runtime package, which can not be built with
-d=checkptr flag yet. This causes incorrect inlining decision, since
NoEscape must not be inlined when -d=checkptr is used.

Fixing this by re-introducing noescape wrapper.

Fixes #68415

Change-Id: I776cab4c9e9e4b3e58162dcce6ec025cb366bdee
Reviewed-on: https://go-review.googlesource.com/c/go/+/598295
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2024-07-15 17:08:26 +00:00
Sean Liao
5d36bc18d5 net/http: document io.Seeker requirement for fs.FS arguments
Using the same wording as http.FS, even though it's not strictly
required if a content type can be determined by file extension.

Fixes #66877
Updates #44553

Change-Id: I7b70c10909bdd289a57d1998a565262b8aaf2dd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/597977
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-15 16:32:33 +00:00
Rob Findley
071b8d51c1 cmd: vendor golang.org/x/telemetry@268b4a8ec2d7
Commands run, from cmd:
  go get golang.org/x/telemetry@268b4a8ec2d7
  go mod tidy
  go mod vendor

Commands run, from std (to keep versions consistent):
  go get golang.org/x/sys@v0.22.0
  go mod tidy
  go mod vendor

Fixes #67617

Change-Id: I65e759c9b03443619a2a7acbeba53694ff5bbf6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/597896
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-12 22:42:17 +00:00
Tim King
4e77872d16 go/types: fix assertion failure when range over int is not permitted
Fixes an assertion failure in Checker.rangeStmt that range over int
only has a key type and no value type. When allowVersion failed,
rangeKeyVal returns Typ[Invalid] for the value instead of nil. When
Config.Error != nil, rangeStmt proceeded. The check for rhs[1]==nil
was not enough to catch this case. It must also check rhs[1]==

Updates #68334

Change-Id: Iffa1b2f7b6a94570ec50b8c6603e727a45ba3357
Reviewed-on: https://go-review.googlesource.com/c/go/+/597356
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-12 18:39:52 +00:00
Joel Sing
8bc32ab6b1 os: clean up after TestIssue60181
This test currently leaves two temp files lying around - ensure these
are created in the current working directory (a temp dir) so that they
get cleaned up when the test is complete.

Change-Id: I9a29e24a2cd601de3ab39c421830ee2bcda76516
Reviewed-on: https://go-review.googlesource.com/c/go/+/597317
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-07-12 16:31:06 +00:00
Ian Lance Taylor
b31e9a63a4 unsafe: say "functions like syscall.Syscall", not only Syscall
Fixes #68301

Change-Id: I9d7f623370705ab2ad4c49489b5a89162467f22a
Reviewed-on: https://go-review.googlesource.com/c/go/+/596936
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-07-11 23:38:31 +00:00
cuishuang
a71bb570d0 all: make struct comments match struct names
Change-Id: I011f66854a9af5f3baa20abebd4b315c15db571f
Reviewed-on: https://go-review.googlesource.com/c/go/+/596715
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: shuang cui <imcusg@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-11 17:23:45 +00:00
Kir Kolyshkin
611f18c4e9 strings: more cross-references in docstrings
This amends CL 534775.

Change-Id: I25a217da51853ec29106998e19e9386d756902fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/597655
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-07-11 15:01:18 +00:00
Jonathan Hall
08a6e080ca database/sql/driver: fix name in comment
DefaultValueConverter => DefaultParameterConverter

Change-Id: I0e726cfdbf21a5e00928899d1fd9144f89dcb805
Reviewed-on: https://go-review.googlesource.com/c/go/+/555235
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Shay Nehmad <dude500@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-07-11 15:01:00 +00:00
Diogo Pinela
dfaaa91f05 os: clarify that IsNotExist, IsExist, IsPermission and IsTimeout work with nil errors
Referring to these functions' parameter as "*the* error" could be taken
to imply that a non-nil error from elsewhere is expected; referring to
it as "its argument" avoids that ambiguity.

Fixes #31065

Change-Id: I117892dd53fff6f92d11a416e4abedee5d2f9337
Reviewed-on: https://go-review.googlesource.com/c/go/+/170077
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-07-11 00:10:03 +00:00
Clide Stefani
5881d857c5 crypto/tls: add support for -expect-no-hrr to bogo_shim_test
The existing implementation of bogo_shim_test does not support tests
that use the expect-no-hrr flag. This change adds support for this flag.

Updates #51434

Change-Id: Iadb38fc2262783cab144a7b52904d0443e7fc2c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/594835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Russell Webb <russell.webb@protonmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
2024-07-10 19:39:51 +00:00
Jorropo
b3040679ad math: remove riscv64 assembly implementations of rounding
Fixes #68322

This reverts commit ad377e906a.

Change-Id: Ifa4811e2c679d789cc830dbff5e50301410e24d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/596516
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Commit-Queue: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2024-07-10 03:19:58 +00:00
Sean Liao
70e453b436 context: handle nil values for valueCtx.String()
Fixes #68356

Change-Id: I57dc089a99f545e29a6759a8db5e28fabb6d1a61
Reviewed-on: https://go-review.googlesource.com/c/go/+/597415
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-07-10 02:44:20 +00:00
Nick Ripley
183a40db6d runtime: avoid multiple records with identical stacks from MutexProfile
When using frame pointer unwinding, we defer frame skipping and inline
expansion for call stacks until profile reporting time. We can end up
with records which have different stacks if no frames are skipped, but
identical stacks once skipping is taken into account. Returning multiple
records with the same stack (but different values) has broken programs
which rely on the records already being fully aggregated by call stack
when returned from runtime.MutexProfile. This CL addresses the problem
by handling skipping at recording time. We do full inline expansion to
correctly skip the desired number of frames when recording the call
stack, and then handle the rest of inline expansion when reporting the
profile.

The regression test in this CL is adapted from the reproducer in
https://github.com/grafana/pyroscope-go/issues/103, authored by Tolya
Korniltsev.

Fixes #67548

Co-Authored-By: Tolya Korniltsev <korniltsev.anatoly@gmail.com>
Change-Id: I6a42ce612377f235b2c8c0cec9ba8e9331224b84
Reviewed-on: https://go-review.googlesource.com/c/go/+/595966
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
2024-07-09 21:41:42 +00:00
Clide Stefani
e89e880eac crypto/tls: add support for -reject-alpn and -decline-alpn flags to bogo_shim_test
The existing implementation of bogo_shim_test does not support tests
which use the reject-alpn or the decline-alpn flag.
This change adds support for these flags in bogo_shim_test.

Updates #51434
Updates #46310

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: I3ff23ff4edd8f4c6c37ee6c9f2ee4689066c4e00
Reviewed-on: https://go-review.googlesource.com/c/go/+/592198
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-09 16:14:04 +00:00