1
0
mirror of https://github.com/golang/go synced 2024-11-15 10:30:54 -07:00
Commit Graph

60059 Commits

Author SHA1 Message Date
Hiroaki Nakamura
fba90c9096 cmd/go/internal/script: Fix build tags of isETXTBSY
syscall.ETXTBSY is only meaningful on Unix platforms, not on Windows.

Fixes #67356

Change-Id: I1b13292d821d61d820b396e08be9a4dd1683e843
Reviewed-on: https://go-review.googlesource.com/c/go/+/585695
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: Michael Matloob <matloob@golang.org>
2024-05-16 00:12:01 +00:00
Jes Cok
ae5ee7042e net/http, reflect: rename Test function names
To be consistent with other tests.

Change-Id: Ibea1d3bf57a295f024e05173d17112ce46a4f0bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/585895
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-05-15 23:39:44 +00:00
Michael Matloob
13d36a9b46 cmd/go: don't start upload until after toolchain selection
Run telemetry.Start (without the upload) first thing so we can increment
counters in toolchain selection. Then run telemetry.StartWithUpload
after toolchain selection so we don't start the upload until after
toolchain selection has happened so we don't start something heavyweight
before selection.

Change-Id: Ia8979175a163265c3e29f6cb11a4ada4714d1d95
Reviewed-on: https://go-review.googlesource.com/c/go/+/585419
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
2024-05-15 21:51:49 +00:00
Alan Donovan
7730e5b783 go/ast: add Preorder go1.23 iterator
This CL adds a new function Preorder that makes it
easier to iterate over the nodes of a syntax tree.
In particular, break, continue, and return retain
their usual continuations.

Fixes #66339

Change-Id: I438b3c23780c91ed589871ad3b8822d54e8fabc7
Reviewed-on: https://go-review.googlesource.com/c/go/+/570680
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-15 21:44:50 +00:00
Robert Griesemer
3c8f925606 go/types, types2: factor out type parameter access into genericType
Also, remove types2.Signature.SetTypeParams as it is not used
and does not exist in go/types.

Change-Id: I16c3ae988988d3735907e9c6c56e8626497ea405
Reviewed-on: https://go-review.googlesource.com/c/go/+/581817
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-05-15 21:33:05 +00:00
Robert Griesemer
bf279b71e2 go/types, types2: add Alias.{TypeParams, SetTypeParams, TypeArgs, Origin}
Fixes #67143.

Change-Id: I8bf9c2559f95d3d6a40874454208ae074b68875c
Reviewed-on: https://go-review.googlesource.com/c/go/+/583757
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-15 21:32:30 +00:00
Alan Donovan
36b06c3d2f cmd/vendor/golang.org/x/telemetry: update to ac8fed8
Updates #67182

Change-Id: I14f6a35491e3a58fff2f33285bd13ac706668df6
Reviewed-on: https://go-review.googlesource.com/c/go/+/585818
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
2024-05-15 21:12:15 +00:00
Alan Donovan
3f7a030e02 runtime/debug: add SetCrashOutput(...CrashOptions) parameter
This is a placeholder for future options (e.g. JSON).

The parameter is temporarily variadic to avoid breaking
x/telemetry (see CL 585378), but I plan to remove
the "..." later this week.

Updates #67182

Change-Id: I3f6f39455d852f92902f8e3f007d3093cbe555db
Reviewed-on: https://go-review.googlesource.com/c/go/+/585557
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
2024-05-15 21:04:14 +00:00
Rob Findley
3d80761531 go/types, types2: add additional documentation for Underlying
The concept of an underlying type has become more complicated with the
addition of TypeParam and Alias types. Update the documentation to
clarify that it strips off Named, TypeParam, and Alias types, and to
reference the spec.

Fixes #65774

Change-Id: I40a8efe15b45591b95068acbf4ef9eae17a4cef1
Reviewed-on: https://go-review.googlesource.com/c/go/+/585456
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
2024-05-15 20:03:31 +00:00
Cherry Mui
c4772d30bf cmd/link: disallow pull-only linknames
As mentioned in CL 584598, linkname is a mechanism that, when
abused, can break API integrity and even safety of Go programs.
CL 584598 is a first step to restrict the use of linknames, by
implementing a blocklist. This CL takes a step further, tightening
up the restriction by allowing linkname references ("pull") only
when the definition side explicitly opts into it, by having a
linkname on the definition (possibly to itself). This way, it is at
least clear on the definition side that the symbol, despite being
unexported, is accessed outside of the package. Unexported symbols
without linkname can now be actually private. This is similar to
the symbol visibility rule used by gccgo for years (which defines
unexported non-linknamed symbols as C static symbols).

As there can be pull-only linknames in the wild that may be broken
by this change, we currently only enforce this rule for symbols
defined in the standard library. Push linknames are added in the
standard library to allow things build.

Linkname references to external (non-Go) symbols are still allowed,
as their visibility is controlled by the C symbol visibility rules
and enforced by the C (static or dynamic) linker.

Assembly symbols are treated similar to linknamed symbols.

This is controlled by -checklinkname linker flag, currently not
enabled by default. A follow-up CL will enable it by default.

Change-Id: I07344f5c7a02124dbbef0fbc8fec3b666a4b2b0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/585358
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2024-05-15 19:57:43 +00:00
Cherry Mui
849770dec9 cmd/compile: disallow linkname referring to instantiations
Linknaming an instantiated generic symbol isn't particularly
useful: it doesn't guarantee the instantiation exists, and the
instantiated symbol name may be subject to change. Checked with a
large code corpus, currently there is no occurrance of linkname
to an instantiated generic symbol (or symbol with a bracket in its
name). This also suggests that it is not very useful. Linkname is
already an unsafe mechanism. We don't need to allow it to do more
unsafe things without justification.

Change-Id: Ifaa20c98166b28a9d7dc3290c013c2b5bb7682e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/585458
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-15 19:27:25 +00:00
Alan Donovan
bf0b605dfb runtime: make convTstring write barrier unreachable from throw
CL 581215 changed 'throw' so that instead of print(s) it called
a more complicated function, printpanicval, that statically
appeared to have convTstring in its call graph, even though this
isn't dynamically reachable when called with a string argument.

However, this caused the link-time static callgraph test to point
out that throw (which is called in nowritebarrierrec contexts
such as markgc) reaches a write barrier.

The solution is to inline and specialize the printpanicval
function for strings; it reduces to printindented.

Thanks to mpratt for pointing out that the reachability
check is on the fully lowered code, and is thus sensitive
to optimizations such as inlining.
I added an explanatory comment on the line that generates
the error message to help future users confused as I was.

Fixes golang/go#67274

Change-Id: Ief110d554de365ce4c09509dceee000cbee30ad9
Reviewed-on: https://go-review.googlesource.com/c/go/+/584617
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-05-15 17:29:46 +00:00
Michael Matloob
90b1521138 cmd/go/internal/modload: compute direct in workspace mode
The Requirements structure, which represents the root level requirements
of the module graph also has a 'direct' field which contains the set of
direct dependencies of a module.

Before this change, in workspace mode, the direct field was not set on
the Requirements structure. This change sets direct in the two places
it's needed: when initializing Requirements from the workspace's mod
files and when updating Requirements based on imports.

When initializing Requirements from the workspace's mod files, this
change will use the 'indirect' comments in those mod files to record the
set of direct modules passed to the Requirements.

There is a loop in updateRequirements where we consider the imports of
the packages we loaded from the main module to make sure that all those
imported packages' modules are required.  The loop also updates direct
for each of those modules (which have at least one package directly
imported by the main modules).  Before this change, in the workspace
case we continued early from the loop and didn't proceed to the code
where direct is computed. This change fixes that.

Fixes #66789

Change-Id: I2b497fbf28c2197e8ba8e8ca5314c1a720f16364
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/580256
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2024-05-15 16:04:44 +00:00
David Chase
18d0e6a14f cmd/compile, cmd/internal: fine-grained fiddling with loop alignment
This appears to be useful only on amd64, and was specifically
benchmarked on Apple Silicon and did not produce any benefit there.
This CL adds the assembly instruction `PCALIGNMAX align,amount`
which aligns to `align` if that can be achieved with `amount`
or fewer bytes of padding. (0 means never, but will align the
enclosing function.)

Specifically, if low-order-address-bits + amount are
greater than or equal to align; thus, `PCALIGNMAX 64,63` is
the same as `PCALIGN 64` and `PCALIGNMAX 64,0` will never
emit any alignment, but will still cause the function itself
to be aligned to (at least) 64 bytes.

Change-Id: Id51a056f1672f8095e8f755e01f72836c9686aa3
Reviewed-on: https://go-review.googlesource.com/c/go/+/577935
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>
2024-05-15 15:44:14 +00:00
Matthew Dempsky
31c8150082 cmd/compile/internal/noder: enable type aliases in type checker
This CL fixes an initialization loop during IR construction, that
stems from IR lacking first-class support for aliases. As a
workaround, we avoid publishing alias declarations until the RHS type
expression has been constructed.

Thanks to gri@ for investigating while I was out.

Fixes #66873.

Change-Id: I11e0d96ea6c357c295da47f44b6ec408edef89b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/585399
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
2024-05-15 15:09:14 +00:00
Kir Kolyshkin
c3c97ad1bf run.bash: rm bumping open files soft limit
Since CL 393354 this should no longer be necessary.

Change-Id: Ie9a7f779515aaf8b40a4f0083ba680f7b0231f04
Reviewed-on: https://go-review.googlesource.com/c/go/+/585576
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>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2024-05-15 15:02:23 +00:00
Cherry Mui
27603028eb cmd/internal/obj/x86: make SEH symbols content-addressable
Currently, the SEH symbol is defined as an aux symbol of the
function symbol, without adding to ctxt.Data. Each function has
its own SEH symbol. As there are a lot of duplications of the
SEH symbol contents, currently a Go object file may contain many
copies of identical SEH symbols. They are deduplicated at link
time. But it does make the linker do redundant work, and make it
hard to reason about the SEH symbol writing in the object file
writer, and its resolution in the linker. In fact, in the object
file writer, the same SEH symbol may be added to the ctxt.defs
multiple times (as it is the aux of multiple function symbols),
which is not expected.

In fact, "aux symbol" is just a mechanism to associate auxiliary
data to another symbol. The auxiliary data symbol itself can be an
ordinary data symbol, even a content-addressable symbol. Define
the SEH symbol as a conntent-addressable symbol and add it to
ctxt.Data. This way there is only one definition of each unique
SEH symbol, which can be the aux of many functions.

While here, add a check to ensure that we add a symbol at most
once to the defs list.

Change-Id: Ie7a0cf02ca114060423e025931b30de97ca330fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/585656
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-15 14:41:10 +00:00
Cherry Mui
8056540772 cmd/internal/obj: print symbol index at -S=3
When the compiler or assembler's -S flag is set to 3 or higher,
print the symbol index, for debugging.

Change-Id: Ia7a42b0c017105ef12fd97b3e52de0e155b0cf2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/585655
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-15 14:39:06 +00:00
Paul E. Murphy
408739fc96 cmd/compile,cmd/asm: on PPC64, generate compares against constant 0
Merge the handling of CMPx r,r,cr and CMPx r,i,cr when assembling.

This prevents generating machine code like cmpd rx,r0 when cmpdi rx,0
is preferred. The preferred form can be fused on Power10 for faster
execution of some instruction sequences.

Likewise, update a common case to use $0 instead of R0 to take
advantage of this.

Change-Id: If2549ca25a5f7d23001885ad444c70d829b3b066
Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-ppc64_power8,gotip-linux-ppc64le_power10,gotip-linux-ppc64le_power8,gotip-linux-ppc64le_power9
Reviewed-on: https://go-review.googlesource.com/c/go/+/585137
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-15 13:55:28 +00:00
Russ Cox
6ccd8e4cf6 cmd/go: add support for godebug lines in go.mod and go.work
The fact that the go line sets both the language version and the
GODEBUG compatibility version can be a problem, especially since
the go line is also required to be ≥ the go lines of any required
dependency modules.

This change adds a new 'godebug' line to go.mod and go.work
to allow setting the GODEBUG values for the entire module.

It also adds a new meta-value default=go1.21 that means
take the defaults from Go 1.21 no matter what the go line says.

These were discussed in proposal #65573.

Fixes #65573.

Change-Id: I91746322a10178370ed1015ce5278372a024c824
Reviewed-on: https://go-review.googlesource.com/c/go/+/584476
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2024-05-15 13:52:10 +00:00
Paul E. Murphy
0222a028f1 cmd/compile/internal/ssa: combine more shift and masking on PPC64
Investigating binaries, these patterns seem to show up frequently.

Change-Id: I987251e4070e35c25e98da321e444ccaa1526912
Reviewed-on: https://go-review.googlesource.com/c/go/+/583302
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-15 13:27:41 +00:00
Russ Cox
bbdad50c09 doc/godebug: correct gotypealias=1 deprecation
Per the note earlier in the page, GODEBUGs are maintained for a
minimum of two years (four Go releases). Not said but certainly
implied is that they are maintained for four Go releases from the
point where people started needing to use them.

Since people would start needing gotypesalias=0 in Go 1.23,
it can be removed in Go 1.27.

Change-Id: Ifad63a1fff63c3f96f2ee192ca74bd1ce8bdb61f
Reviewed-on: https://go-review.googlesource.com/c/go/+/585457
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2024-05-15 12:20:56 +00:00
Michael Stapelberg
d05af62695 syscall: skip TestAmbientCapsUserns when restricted, document
fixes golang/go#67088

Change-Id: I42e7a8d02b161187772f147e3e136ab6e0f71d7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/585059
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-15 07:45:37 +00:00
Damien Neil
a524b87253 net/http: avoid panic when writing 100-continue after handler done
When a request contains an "Expect: 100-continue" header,
the first read from the request body causes the server to
write a 100-continue status.

This write caused a panic when performed after the server handler
has exited. Disable the write when cleaning up after a handler
exits.

This also fixes a bug where an implicit 100-continue could be
sent after a call to WriteHeader has sent a non-1xx header.

This change drops tracking of whether we've written a
100-continue or not in response.wroteContinue. This tracking
was used to determine whether we should consume the remaining
request body in chunkWriter.writeHeader, but the discard-the-body
path was only taken when the body was already consumed.
(If the body is not consumed, we set closeAfterReply, and we
don't consume the remaining body when closeAfterReply is set.
If the body is consumed, then we may attempt to discard the
remaining body, but there is obviously no body remaining.)

Fixes #53808

Change-Id: I3542df26ad6cdfe93b50a45ae2d6e7ef031e46fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/585395
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-05-14 22:34:15 +00:00
Cherry Mui
b86527ec05 cmd/compile/internal/ssa: print output on failure in TestFmaHash
When the test fails to run the command, print the error message
to help debug.

Change-Id: I443579a622ba1bf67ef27071f141e945303d4c2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/585357
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 21:57:53 +00:00
apocelipes
1f6a983baf database/sql: reordering fields to reduce struct sizes
There are 16 bytes reduced.

Change-Id: I33ca96fd22002b3111f0462c3029d70df48adb6e
GitHub-Last-Rev: 8df56a9655
GitHub-Pull-Request: golang/go#67055
Reviewed-on: https://go-review.googlesource.com/c/go/+/581935
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-05-14 20:18:21 +00:00
Tobias Klauser
c7597a8d23 internal/poll: use internal/byteorder
Change-Id: Ied768b8b675281b340f91f4ac6f688594be8bf4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/585118
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-14 20:14:02 +00:00
Tobias Klauser
7ba8a23b67 syscall: use internal/byteorder
Change-Id: I798729a6095494e9d0bd18d6b7d4372910056218
Reviewed-on: https://go-review.googlesource.com/c/go/+/585117
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-14 20:13:24 +00:00
Tobias Klauser
7008859ae1 os: use internal/byteorder
Change-Id: Ic88535f05a55966e35e5da7abb499aa5fadb5cc7
Reviewed-on: https://go-review.googlesource.com/c/go/+/585116
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2024-05-14 20:11:45 +00:00
Michael Matloob
eef288da1e cmd: add telemetry for commands in cmd
This change modifies the commands in cmd to open counter files,
increment invocations counters and to increment counters for the names
of the flags that were passed in.

cmd/pprof and cmd/vet are both wrappers around tools defined in other
modules which do their own flag processing so we can't directly
increment flag counters right after flags are parsed. For those two
commands we wait to increment counters until after the programs have
returned.

cmd/dist is built with the bootstrap go so it can't depend on telemetry
yet. We can add telemetry support to it once 1.23 is the minimum
bootstrap version.

For #58894

Change-Id: Ic7f6009992465e55c56ad4dc6451bcb1ca51374a
Reviewed-on: https://go-review.googlesource.com/c/go/+/585235
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 19:41:17 +00:00
Michael Matloob
efc347348e cmd: pull in golang.org/x/telemetry@7d78a97
Commands run:
    go get golang.org/x/telemetry@7d78a97
    go mod tidy
    go mod vendor

Change-Id: Iea0fbe11bcc69fac35fba0ee3d02cd14344a3ee9
Reviewed-on: https://go-review.googlesource.com/c/go/+/585455
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-05-14 19:09:33 +00:00
Russ Cox
ca5fc8de65 cmd/vendor: pull in x/mod/modfile godebug changes
go get golang.org/x/mod@c0bdc7bd
	go mod tidy
	go mod vendor

Pulls in CL 584300.

For #65573.

Change-Id: Ia8ec86e2ee049b911fcf09d57f83972786b0470d
Reviewed-on: https://go-review.googlesource.com/c/go/+/584475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2024-05-14 18:34:56 +00:00
Russ Cox
2cc42f7328 time: more flake removal in asynctimerchan test
Trying to write a test for the corner cases in the old async timer chan
implementation may have been a mistake, especially since this isn't
going to be the default timer chan implementation anymore.
But let's try one more time to fix the test.

I reproduced the remaining builder failures on my Mac laptop
by overloading the CPU in one window and then running 48 instances
of the flaky test in loops using 'stress' in another window.

It turns out that, contrary to my understanding of async timers
and therefore contrary to what the test expected, it is technically
possible for

	t := time.NewTicker(1)
	t.Reset(1000*time.Hour)
	<-t.C
	<-t.C

to observe two time values on t.C, as opposed to blocking forever.

We always expect the first time value, since the ticker goes off
immediately (after 1ns) and sends that value into the channel buffer.
To get the second value, the ticker has to be in the process of
going off (which it is doing constantly anyway), and the timer
goroutine has to be about to call sendTime and then get rescheduled.
Then t.Reset and the first <-t.C have to happen.
Then the timer goroutine gets rescheduled and can run sendTime's
non-blocking send on t.C, which finds an empty buffer and writes
a value.

This is unlikely, of course, but it definitely happens. This program
always panics in just a second or two on my laptop:

	package main

	import (
		"os"
		"time"
	)

	func main() {
		os.Setenv("GODEBUG", "asynctimerchan=1")
		for  {
			go func() {
				t := time.NewTicker(1)
				t.Reset(1000*time.Hour)
				<-t.C
				select {
				case <-t.C:
					panic("two receives")
				case <-time.After(1*time.Second):
				}
			}()
		}
	}

Because I did not understand this nuance, the test did not expect it.

This CL rewrites the test to expect that possibility. I can no longer
make the test fail under 'stress' on my laptop.

For #66322.

Change-Id: I15c75d2c6f24197c43094da20d6ab55306a0a9f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/585359
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 18:27:21 +00:00
Than McIntosh
0767ffdf27 doc: add relnote fragment on stack slot merging
Add a blurb to the toolchain section talking about stack slot merging.

Updates #62737.

Change-Id: I26193a6a381c95ff5d79ce80b77c10c7561d00cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/581439
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-05-14 17:18:10 +00:00
Than McIntosh
3454ac0d63 cmd/link/internal/ld: clean tmpdir obj timestamps
This patch changes the Go linker to "clean" (reset to Unix epoch) the
timestamps on object files copied to the tmpdir that is presented to
the external linker or archive tool. The intent is to improve build
reproducibility on Darwin, where later versions of xcode seem to want
to incorporate object file timestamps into the hash used for the final
build ID (which precludes the possibility of having reproducible Go
builds). Credit for this idea goes to Cherry (see
https://github.com/golang/go/issues/64947#issuecomment-1887667189).

Updates #64947.

Change-Id: I2eb7dddff538e247122b04fdcf8a57c923f61201
Reviewed-on: https://go-review.googlesource.com/c/go/+/585355
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 16:44:47 +00:00
Niklas Ott
c7c578cdf3 encoding/base32: use correct length for unpadded buffer in Read
If unpadded content was passed, in some occassions content was omitted,
because the division result was floored. Ceiling it makes sure all
content is always read.

Fixes #65166

Change-Id: I1d8ee7ef436080483ed8f0e615b70a1013455f92
Reviewed-on: https://go-review.googlesource.com/c/go/+/581415
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 16:25:54 +00:00
Tobias Klauser
9fa34d9fa2 net/netip: fix TestInlining after CL 585057
Addr.AsSlice is not inlinable on all architectures.

Fixes #67354

Change-Id: Ibaf7daa2e1188a05952f8df3c84255436b29478d
Reviewed-on: https://go-review.googlesource.com/c/go/+/585058
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-14 16:17:33 +00:00
Mateusz Poliwczak
8623c0ba95 internal/chacha8rand: use internal/byteorder
Change-Id: Ia5bcaba47da949583a720ca3506d6bd9e3794824
GitHub-Last-Rev: 1ed3dad2bf
GitHub-Pull-Request: golang/go#67320
Reviewed-on: https://go-review.googlesource.com/c/go/+/584996
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: 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-05-13 21:47:29 +00:00
Tobias Klauser
9f9afbf332 net/netip: test that Addr.AsSlice is inlineable
CL 584995 made Addr.AsSlice inlineable as a side effect. Make sure we
don't regress.

Updates #56136

Change-Id: Ib5f77a430db66ffe45c4cbb264da7a401945fec9
Reviewed-on: https://go-review.googlesource.com/c/go/+/585057
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-13 21:43:09 +00:00
Mateusz Poliwczak
259d2347d2 net/netip: replace != nil with != "" in comment
Change-Id: Ie204f90e51c210efe520a075b917c6178e109676
GitHub-Last-Rev: 9ca21ff92f
GitHub-Pull-Request: golang/go#67341
Reviewed-on: https://go-review.googlesource.com/c/go/+/585155
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Auto-Submit: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 21:42:34 +00:00
Tobias Klauser
4015277b61 net/netip: combine import groups
Change-Id: If79f4452a34281796c4b8e7b0246c978e09a64af
Reviewed-on: https://go-review.googlesource.com/c/go/+/585056
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 21:42:31 +00:00
Alberto Donizetti
cc1479653d slices: fix punctuation in the documentation of Values
Change-Id: Idea4f92d511b5f18531758667cb0cb5ed6f91a0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/584359
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>
2024-05-13 21:40:32 +00:00
apocelipes
a949ade592 image/gif: use internal/byteorder
Change-Id: Ic00e63aa35bcea4c97a5885d61edb8fc37d84e22
GitHub-Last-Rev: 1ad3a5d0ed
GitHub-Pull-Request: golang/go#67324
Reviewed-on: https://go-review.googlesource.com/c/go/+/584997
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>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-13 21:38:09 +00:00
nobishino
133cdfb469 encoding/csv: clarify that Writer uses different line break than RFC 4180 by default
Package documentation of encoding/csv says:

> this package supports the format described in RFC 4180.

According to section 2 of RFC 4180:

> Each record is located on a separate line, delimited by a line break (CRLF).

On the other hand, Writer uses LF (not CRLF) as newline character by default.

> If [Writer.UseCRLF] is true, the Writer ends each output line with \r\n instead of \n.

Strictly speaking, this behavior is different from RFC 4180.
Package documentation would improve if we clarify that point.

Change-Id: I120e9332b593e1ac9ed8e49f6f8419ea88efc57d
GitHub-Last-Rev: 489167eb04
GitHub-Pull-Request: golang/go#67290
Reviewed-on: https://go-review.googlesource.com/c/go/+/584835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-13 21:32:28 +00:00
Mateusz Poliwczak
509bbeb407 math/rand/v2, math/big: use internal/byteorder
Change-Id: Id07f16d14133ee539bc2880b39641c42418fa6e2
GitHub-Last-Rev: 7b327d508f
GitHub-Pull-Request: golang/go#67319
Reviewed-on: https://go-review.googlesource.com/c/go/+/585016
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-05-13 21:31:58 +00:00
aimuz
7e196c04ed fmt, internal/fmtsort: refactor SortedMap to use slice of structs for map sorting
This change refactors the SortedMap type in the fmtsort package from using
two parallel slices for keys and values to a single slice of structs. This
improves code clarity and reduces the complexity of handling map entries.
Affected files and their respective functions have been updated to work
with the new structure, including adjustments in fmt/print.go and
text/template/exec.go to iterate over the new map representation.

goos: darwin
goarch: arm64
pkg: fmt
cpu: Apple M2 Max
                                 │   old.txt    │               new.txt                │
                                 │    sec/op    │    sec/op     vs base                │
SprintfPadding-12                  21.29n ±  5%   20.89n ±  8%        ~ (p=0.393 n=10)
SprintfEmpty-12                    2.986n ±  4%   2.997n ± 10%        ~ (p=0.697 n=10)
SprintfString-12                   8.327n ±  9%   8.493n ± 12%        ~ (p=0.579 n=10)
SprintfTruncateString-12           15.93n ± 10%   15.56n ± 10%        ~ (p=0.853 n=10)
SprintfTruncateBytes-12            14.56n ± 12%   14.13n ± 11%        ~ (p=0.796 n=10)
SprintfSlowParsingPath-12          9.026n ± 15%   9.511n ± 14%        ~ (p=0.646 n=10)
SprintfQuoteString-12              40.88n ±  3%   40.73n ±  1%        ~ (p=0.782 n=10)
SprintfInt-12                      6.279n ±  7%   6.130n ±  6%        ~ (p=0.218 n=10)
SprintfIntInt-12                   11.08n ± 10%   11.37n ± 10%        ~ (p=0.424 n=10)
SprintfPrefixedInt-12              31.24n ±  3%   31.21n ±  2%        ~ (p=0.912 n=10)
SprintfFloat-12                    13.96n ±  7%   13.99n ± 15%        ~ (p=0.986 n=10)
SprintfComplex-12                  49.16n ±  7%   50.57n ±  6%        ~ (p=0.436 n=10)
SprintfBoolean-12                  7.578n ± 15%   7.267n ± 11%        ~ (p=0.529 n=10)
SprintfHexString-12                36.14n ±  2%   35.74n ±  1%        ~ (p=0.118 n=10)
SprintfHexBytes-12                 48.74n ±  1%   48.34n ±  4%        ~ (p=0.128 n=10)
SprintfBytes-12                    60.16n ±  3%   61.36n ±  5%        ~ (p=0.218 n=10)
SprintfStringer-12                 39.02n ± 10%   39.31n ±  9%        ~ (p=0.739 n=10)
SprintfStructure-12                161.2n ±  1%   133.9n ±  4%  -16.90% (p=0.000 n=10)
ManyArgs-12                        31.87n ± 17%   33.00n ± 12%        ~ (p=0.165 n=10)
FprintInt-12                       32.32n ±  0%   33.13n ±  1%   +2.49% (p=0.000 n=10)
FprintfBytes-12                    47.31n ±  0%   47.99n ±  1%   +1.44% (p=0.000 n=10)
FprintIntNoAlloc-12                32.05n ±  1%   33.12n ±  0%   +3.34% (p=0.000 n=10)
ScanInts-12                        130.5µ ±  1%   131.3µ ±  0%   +0.57% (p=0.000 n=10)
ScanRecursiveInt-12                40.83m ±  1%   40.65m ±  2%        ~ (p=0.353 n=10)
ScanRecursiveIntReaderWrapper-12   40.77m ±  2%   40.83m ±  2%        ~ (p=0.971 n=10)
geomean                            100.6n         100.3n         -0.32%

                                 │    old.txt     │                new.txt                 │
                                 │      B/op      │     B/op      vs base                  │
SprintfPadding-12                    16.00 ± 0%       16.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfEmpty-12                      0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfString-12                     5.000 ± 0%       5.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfTruncateString-12             16.00 ± 0%       16.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfTruncateBytes-12              16.00 ± 0%       16.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfSlowParsingPath-12            5.000 ± 0%       5.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfQuoteString-12                32.00 ± 0%       32.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfInt-12                        0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfIntInt-12                     3.000 ± 0%       3.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfPrefixedInt-12                64.00 ± 0%       64.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfFloat-12                      8.000 ± 0%       8.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfComplex-12                    24.00 ± 0%       24.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfBoolean-12                    4.000 ± 0%       4.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfHexString-12                  80.00 ± 0%       80.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfHexBytes-12                   104.0 ± 0%       104.0 ± 0%        ~ (p=1.000 n=10) ¹
SprintfBytes-12                      88.00 ± 0%       88.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfStringer-12                   32.00 ± 0%       32.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfStructure-12                  216.0 ± 0%       168.0 ± 0%  -22.22% (p=0.000 n=10)
ManyArgs-12                          0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintInt-12                         0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintfBytes-12                      24.00 ± 0%       24.00 ± 0%        ~ (p=1.000 n=10) ¹
FprintIntNoAlloc-12                  0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
ScanInts-12                        14.87Ki ± 0%     14.87Ki ± 0%        ~ (p=1.000 n=10) ¹
ScanRecursiveInt-12                16.37Ki ± 0%     16.34Ki ± 9%        ~ (p=0.950 n=10)
ScanRecursiveIntReaderWrapper-12   16.43Ki ± 8%     16.35Ki ± 0%        ~ (p=0.052 n=10)
geomean                                         ²                  -1.03%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                 │    old.txt    │                new.txt                │
                                 │   allocs/op   │  allocs/op   vs base                  │
SprintfPadding-12                   1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfEmpty-12                     0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfString-12                    1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfTruncateString-12            1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfTruncateBytes-12             1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfSlowParsingPath-12           1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfQuoteString-12               1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfInt-12                       0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfIntInt-12                    1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfPrefixedInt-12               1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfFloat-12                     1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfComplex-12                   1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfBoolean-12                   1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfHexString-12                 1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfHexBytes-12                  2.000 ± 0%      2.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfBytes-12                     2.000 ± 0%      2.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfStringer-12                  4.000 ± 0%      4.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfStructure-12                 8.000 ± 0%      6.000 ± 0%  -25.00% (p=0.000 n=10)
ManyArgs-12                         0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintInt-12                        0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintfBytes-12                     1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintIntNoAlloc-12                 0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
ScanInts-12                        1.590k ± 0%     1.590k ± 0%        ~ (p=1.000 n=10) ¹
ScanRecursiveInt-12                1.592k ± 0%     1.592k ± 0%        ~ (p=0.303 n=10)
ScanRecursiveIntReaderWrapper-12   1.594k ± 0%     1.594k ± 0%        ~ (p=0.582 n=10)
geomean                                        ²                 -1.14%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

Change-Id: I2e850d827d2fd7d6618db60f7071977af5639032
GitHub-Last-Rev: 5a4afcf045
GitHub-Pull-Request: golang/go#67256
Reviewed-on: https://go-review.googlesource.com/c/go/+/584155
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>
Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-05-13 21:22:43 +00:00
Lorenz Bauer
ec1724bc99 encoding/binary: simplify encoder.value
Remove some duplicate type switching from encoder.value. reflect.Uint and
reflect.Int don't have a case statement anymore, but since they aren't valid
types there is no change in semantics.

goos: darwin
goarch: arm64
pkg: encoding/binary
cpu: Apple M1 Pro
                            │   base.txt   │            simplify.txt             │
                            │    sec/op    │    sec/op     vs base               │
ReadSlice1000Int32s-10         2.649µ ± 1%    2.645µ ± 0%        ~ (p=0.069 n=6)
ReadStruct-10                  204.8n ± 2%    199.9n ± 0%   -2.39% (p=0.002 n=6)
WriteStruct-10                 185.6n ± 2%    154.0n ± 0%  -17.03% (p=0.002 n=6)
WriteSlice1000Structs-10       157.9µ ± 1%    125.0µ ± 0%  -20.86% (p=0.002 n=6)
ReadSlice1000Structs-10        162.6µ ± 2%    159.3µ ± 0%        ~ (p=0.065 n=6)
ReadInts-10                    159.7n ± 1%    156.7n ± 0%   -1.88% (p=0.002 n=6)
WriteInts-10                   134.2n ± 0%    134.1n ± 0%   -0.11% (p=0.011 n=6)
WriteSlice1000Int32s-10        2.680µ ± 0%    2.680µ ± 0%        ~ (p=0.955 n=6)
PutUint16-10                  0.6253n ± 2%   0.6211n ± 0%   -0.67% (p=0.013 n=6)
AppendUint16-10                1.417n ± 2%    1.413n ± 0%        ~ (p=0.065 n=6)
PutUint32-10                  0.6210n ± 0%   0.6210n ± 0%        ~ (p=0.835 n=6)
AppendUint32-10                1.414n ± 0%    1.414n ± 0%        ~ (p=1.000 n=6)
PutUint64-10                  0.6210n ± 0%   0.6212n ± 0%        ~ (p=0.260 n=6)
AppendUint64-10                1.414n ± 1%    1.417n ± 0%        ~ (p=0.097 n=6)
LittleEndianPutUint16-10      0.6236n ± 0%   0.6238n ± 0%        ~ (p=0.426 n=6)
LittleEndianAppendUint16-10    1.419n ± 0%    1.421n ± 1%        ~ (p=0.054 n=6)
LittleEndianPutUint32-10      0.6236n ± 0%   0.6239n ± 0%        ~ (p=0.457 n=6)
LittleEndianAppendUint32-10    1.421n ± 3%    1.421n ± 0%        ~ (p=1.000 n=6)
LittleEndianPutUint64-10      0.6242n ± 1%   0.6239n ± 0%        ~ (p=0.372 n=6)
LittleEndianAppendUint64-10    1.421n ± 0%    1.421n ± 0%        ~ (p=1.000 n=6)
ReadFloats-10                  39.39n ± 0%    39.35n ± 0%   -0.10% (p=0.026 n=6)
WriteFloats-10                 33.64n ± 0%    33.65n ± 0%        ~ (p=0.297 n=6)
ReadSlice1000Float32s-10       2.661µ ± 0%    2.664µ ± 0%        ~ (p=0.916 n=6)
WriteSlice1000Float32s-10      2.763µ ± 0%    2.758µ ± 2%        ~ (p=0.225 n=6)
ReadSlice1000Uint8s-10         129.5n ± 2%    129.5n ± 2%        ~ (p=0.485 n=6)
WriteSlice1000Uint8s-10        144.4n ± 4%    146.1n ± 2%        ~ (p=0.065 n=6)
PutUvarint32-10                12.12n ± 0%    12.12n ± 2%        ~ (p=0.933 n=6)
PutUvarint64-10                30.75n ± 0%    31.29n ± 1%   +1.76% (p=0.002 n=6)
geomean                        33.44n         32.89n        -1.65%

Change-Id: Ibce978012c268a7f26fe7567c340c861fa4b115d
Reviewed-on: https://go-review.googlesource.com/c/go/+/579156
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 21:22:39 +00:00
lifubang
59003b6d87 syscall: don't change local limit if prlimit used for another process
Fixes: #67184

Change-Id: Ibdf3810cbba30ae29f466f7f95f357e8512f228b
GitHub-Last-Rev: 5eabc760be
GitHub-Pull-Request: golang/go#67185
Reviewed-on: https://go-review.googlesource.com/c/go/+/583299
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-05-13 21:18:19 +00:00
Tim King
99283b81f4 cmd/go: add module information to vet actions
Update golang/go#66315

Change-Id: Ica9b7e010ea9a0a12f80cc83b8ace51f22822ec2
Reviewed-on: https://go-review.googlesource.com/c/go/+/580076
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 20:08:58 +00:00
Mateusz Poliwczak
c98867d23a crypto: replace encoding/binary in favour of internal/byteorder
Updates #54097

Change-Id: I827a5efd1736ce057b76f079466f2d9ead225898
GitHub-Last-Rev: 40af10469d
GitHub-Pull-Request: golang/go#67321
Reviewed-on: https://go-review.googlesource.com/c/go/+/585017
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Commit-Queue: 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: Ian Lance Taylor <iant@google.com>
2024-05-13 18:57:38 +00:00