Damien Neil [Wed, 19 Jul 2023 17:30:46 +0000 (10:30 -0700)]
net/http: permit requests with invalid Host headers
Historically, the Transport has silently truncated invalid
Host headers at the first '/' or ' ' character. CL 506996 changed
this behavior to reject invalid Host headers entirely.
Unfortunately, Docker appears to rely on the previous behavior.
When sending a HTTP/1 request with an invalid Host, send an empty
Host header. This is safer than truncation: If you care about the
Host, then you should get the one you set; if you don't care,
then an empty Host should be fine.
Continue to fully validate Host headers sent to a proxy,
since proxies generally can't productively forward requests
without a Host.
For #60374
Fixes #61431
Change-Id: If170c7dd860aa20eb58fe32990fc93af832742b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/511155
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Austin Clements [Tue, 1 Aug 2023 18:41:42 +0000 (14:41 -0400)]
runtime: drop stack-allocated pcvalueCaches
Now that pcvalue keeps its cache on the M, we can drop all of the
stack-allocated pcvalueCaches and stop carefully passing them around
between lots of operations. This significantly simplifies a fair
amount of code and makes several structures smaller.
This series of changes has no statistically significant effect on any
runtime Stack benchmarks.
I also experimented with making the cache larger, now that the impact
is limited to the M struct, but wasn't able to measure any
improvements.
Austin Clements [Tue, 1 Aug 2023 17:54:32 +0000 (13:54 -0400)]
runtime: move pcvalue cache to M
Currently, the pcvalue cache is stack allocated for each operation
that needs to look up a lot of pcvalues. It's not always clear where
to put it, a lot of the time we just pass a nil cache, it doesn't get
reused across operations, and we put a surprising amount of effort
into threading these caches around.
This CL moves it to the M, where it can be long-lived and used by all
pcvalue lookups, and we don't have to carefully thread it across
operations.
Austin Clements [Tue, 1 Aug 2023 17:45:31 +0000 (13:45 -0400)]
runtime: store start PC in pcvalueCache
Currently, pcvalue only returns a valid start PC if cache is nil.
We're about to eliminate the cache argument and always use a pcvalue
cache, so make sure the cache stores the start PC and always return it
from pcvalue.
montag451 [Fri, 4 Aug 2023 22:04:10 +0000 (22:04 +0000)]
testing: improve the usage message of -benchtime
Specify that -benchtime can take the form Nx.
Change-Id: I1e711cdb2e19e3ff5eb2cea4e7c8843bc58696b1
GitHub-Last-Rev: 1cb13f7dba829497c5cbb3d4c578f4984e1cbd28
GitHub-Pull-Request: golang/go#61756
Reviewed-on: https://go-review.googlesource.com/c/go/+/515801
TryBot-Result: Gopher Robot <gobot@golang.org> 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: Michael Knyszek <mknyszek@google.com>
Matthew Dempsky [Fri, 4 Aug 2023 03:29:47 +0000 (20:29 -0700)]
runtime: avoid relying on the unwinder in deferreturn
This CL changes deferreturn so that it never needs to invoke the
unwinder. Instead, in the unusual case that we recover into a frame
with pending open-coded defers, we now save the extra state needed to
find them in g.param.
Change-Id: Ied35f6c1063fee5b6044cc37b2bccd3f90682fe6
Reviewed-on: https://go-review.googlesource.com/c/go/+/515856 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Matthew Dempsky [Fri, 4 Aug 2023 21:10:59 +0000 (14:10 -0700)]
runtime, cmd/compile: optimize open-coded defers
This CL optimizes open-coded defers in two ways:
1. It modifies local variable sorting to place all open-coded defer
closure slots in order, so that rather than requiring the metadata to
contain each offset individually, we just need a single offset to the
first slot.
2. Because the slots are in ascending order and can be directly
indexed, we can get rid of the count of how many defers are in the
frame. Instead, we just find the top set bit in the active defers
bitmask, and load the corresponding closure.
Change-Id: I6f912295a492211023a9efe12c94a14f449d86ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/516199 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
These new apis are analogous to ServeFile, FileServer and NewFileTransport respectively. The main difference is that these functions operate on an fs.FS.
Fixes #51971
Change-Id: Ie56b245b795eeb7edf613657578592306945469b
GitHub-Last-Rev: 26e75c0368f155a2299fbdcb72f47036b71a5e06
GitHub-Pull-Request: golang/go#61641
Reviewed-on: https://go-review.googlesource.com/c/go/+/513956
Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
Andy Pan [Thu, 3 Aug 2023 22:47:56 +0000 (06:47 +0800)]
log/slog: restore the original log setting before test exits
Change-Id: Ib3daffb8a4cc018d62ed6e5741355b1c1a206034
Reviewed-on: https://go-review.googlesource.com/c/go/+/515775
Run-TryBot: Andy Pan <panjf2000@gmail.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Alan Donovan [Wed, 21 Jun 2023 17:49:42 +0000 (13:49 -0400)]
go/ast: deprecate Object
The following declarations related to syntactic object resolution
are now deprecated:
- Ident.Obj
- Object
- Scope
- File.{Scope,Unresolved}
- Importer
- Package, NewPackage
New programs should use the type checker instead.
Updates golang/go#52463
Updates golang/go#48141
Change-Id: I82b315f49b1341c11ae20dcbf81106084bd2ba86
Reviewed-on: https://go-review.googlesource.com/c/go/+/504915
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
Daniel Martí [Fri, 7 Jul 2023 09:06:05 +0000 (11:06 +0200)]
all: add a few more godoc links
Over the past few months as I read the standard library's documentation
I kept finding spots where godoc links would have helped me.
I kept adding to a stash of changes to fix them up bit by bit.
The stash has grown big enough by now, and we're nearing a release,
so I think it's time to merge to avoid git conflicts or bit rot.
Note that a few sentences are slightly reworded,
since "implements the Fooer interface" can just be "implements [Fooer]"
now that the link provides all the context needed to the user.
Change-Id: I01c31d3d3ff066d06aeb44f545f8dd0fb9a8d998
Reviewed-on: https://go-review.googlesource.com/c/go/+/508395
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Cuong Manh Le [Sat, 5 Aug 2023 15:51:49 +0000 (22:51 +0700)]
cmd/compile: fix missing init nodes for len(string([]byte)) optimization
CL 497276 added optimization for len(string([]byte)) by avoiding call to
slicebytetostring. However, the bytes to string expression may contain
init nodes, which need to be preserved. Otherwise, it would make the
liveness analysis confusing about the lifetime of temporary variables
created by init nodes.
Fixes #61778
Change-Id: I6d1280a7d61bcc75f11132af41bda086f084ab54
Reviewed-on: https://go-review.googlesource.com/c/go/+/516375
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Jes Cok [Fri, 4 Aug 2023 04:58:40 +0000 (04:58 +0000)]
os: replace "used to used" with "used to use" in description text
Change-Id: I5445f3393373423592dfdd88b91d267c2c98d113
GitHub-Last-Rev: f554da58f49deb38101fd9ffba744bf4bf35ab55
GitHub-Pull-Request: golang/go#61749
Reviewed-on: https://go-review.googlesource.com/c/go/+/515798
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: qiulaidongfeng <2645477756@qq.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>
Maya Rashish [Wed, 2 Aug 2023 08:32:07 +0000 (08:32 +0000)]
crypto/rand, internal/syscall/unix: use simpler random seed on NetBSD
sysctl kern.arandom has been supported since NetBSD 4.0, works inside a
chroot, has no confusing bells and whistles like Linux getrandom,
requires no complicated querying to avoid SIGSYS traps, and is what
NetBSD 10 will usee for the getentropy(3) library routine soon to
appear in POSIX.
Change-Id: I23bd84ecd5ff3e33e8958c60896db842c44667ba
GitHub-Last-Rev: 5db094c85ae14bbd9f80247d46d90e00061187cc
GitHub-Pull-Request: golang/go#61441
Reviewed-on: https://go-review.googlesource.com/c/go/+/511036
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Converts the 5 x 8-bit source byte to two 32-bit integers.
This will reduce the number of shift operations.
benchmark old ns/op new ns/op delta
BenchmarkEncode-10 9005 4426 -50.85%
BenchmarkEncodeToString-10 10739 6155 -42.69%
benchmark old MB/s new MB/s speedup
BenchmarkEncode-10 909.69 1850.81 2.03x
BenchmarkEncodeToString-10 762.84 1331.02 1.74x
Change-Id: I9418d3436b73f94a4eb4b2b525e4f83612ff4d47
Reviewed-on: https://go-review.googlesource.com/c/go/+/514095 Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
cui fliter [Wed, 2 Aug 2023 08:38:12 +0000 (16:38 +0800)]
cmd/fix: use reflect.TypeFor for known types
For #60088
Change-Id: Id19435e864bcfd2adbb1492db3f8cdf2ee3c915e
Reviewed-on: https://go-review.googlesource.com/c/go/+/515175
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
qiulaidongfeng [Fri, 4 Aug 2023 05:15:41 +0000 (05:15 +0000)]
archive/tar: add FileInfoNames interface
An optional interface FileInfoNames has been added.
If the parameter fi of FileInfoHeader implements the interface
the Gname and Uname of the return value Header are
provided by the method of the interface.
Change-Id: I6fd06c7c9aaf29b22b7384542fe57affed33009a
GitHub-Last-Rev: 5e82257948759e13880d8af12743b9524ae3df5a
GitHub-Pull-Request: golang/go#61662
Reviewed-on: https://go-review.googlesource.com/c/go/+/514235
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
apocelipes [Fri, 4 Aug 2023 03:15:12 +0000 (03:15 +0000)]
encoding/xml, image/jpeg, image/png: use the builtin min function
Change-Id: I9bafc7aa4e20e7cd994b75e7576156ca68f4fc8b
GitHub-Last-Rev: e037f689bddd0ef03a6ad38982fe98b4c26aaede
GitHub-Pull-Request: golang/go#61746
Reviewed-on: https://go-review.googlesource.com/c/go/+/515855
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Jes Cok [Thu, 3 Aug 2023 23:50:14 +0000 (23:50 +0000)]
os: use t.Fatalf instead of t.Errorf in TestErrProcessDone
If err is non-nil, use t.Fatalf to avoid panic when calling p.Wait().
Change-Id: Ief4e43ba5ad782999063941ed3b12f3fe4d93621
GitHub-Last-Rev: 5d32b3c082e54a914360cb4434d4cc7682e7031e
GitHub-Pull-Request: golang/go#61740
Reviewed-on: https://go-review.googlesource.com/c/go/+/515655
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Eduard Bondarenko [Tue, 1 Aug 2023 14:48:16 +0000 (14:48 +0000)]
regexp: improve Regexp.ReplaceAll documentation and tests related to Expand part
For #40329
Change-Id: Ie0cb337545ce39cd169129227c45f7d2eaebc898
GitHub-Last-Rev: c017d4c7c1bc1f8cd39e6c70b60885cef1231dcd
GitHub-Pull-Request: golang/go#56507
Reviewed-on: https://go-review.googlesource.com/c/go/+/446836 Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
cui fliter [Sat, 5 Aug 2023 15:52:52 +0000 (15:52 +0000)]
cmd/compile/internal/base: optimize the readImportCfg function to make it clearer
Change-Id: If8fc77d5b04b2979707032d91112d4f33ef5e3da
GitHub-Last-Rev: d82d769c04569af8a0c99a0ba9a78db641b97368
GitHub-Pull-Request: golang/go#55913
Reviewed-on: https://go-review.googlesource.com/c/go/+/435536 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: qiulaidongfeng <2645477756@qq.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
adetunjii [Sat, 5 Aug 2023 21:14:36 +0000 (21:14 +0000)]
arm64: replace "PCALGIN with PCALIGN" in package documentation
Change-Id: I476e2a75f39c876fa9c071cada36573740d546de
GitHub-Last-Rev: dec3fb438f4dd0d8e0aff300356c8d92e8ee6749
GitHub-Pull-Request: golang/go#61783
Reviewed-on: https://go-review.googlesource.com/c/go/+/516395
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Jorropo [Fri, 2 Jun 2023 18:20:18 +0000 (20:20 +0200)]
io: remove manual SectionReader.Size in SectionReader.ReadAt
Change-Id: Ib3e8953dbdefa2b78c31b1bcbf0909bce248e423
Reviewed-on: https://go-review.googlesource.com/c/go/+/500475 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Rather than testing for architectures that use libc-based system calls,
test that it is not the single architecture that Go is still using direct
system calls. This reduces the number of changes needed for new openbsd
ports.
Updates #36435
Updates #61546
Change-Id: I79c4597c629b8b372e9efcda79e8f6ff778b9e8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/516016 Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>
Jes Cok [Fri, 4 Aug 2023 20:50:12 +0000 (20:50 +0000)]
internal/testenv: replace “go run.” with “go run”. in comments
Change-Id: I7d960ebeac38262c8ee39deeed9e1a2ea2803f5f
GitHub-Last-Rev: 59c5d7ea76dcca5424ce79f6030196c8adbf1fd9
GitHub-Pull-Request: golang/go#61755
Reviewed-on: https://go-review.googlesource.com/c/go/+/515800
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Cherry Mui [Fri, 4 Aug 2023 20:30:40 +0000 (16:30 -0400)]
runtime/pprof: correct field alignment in machVMRegionBasicInfoData
The type machVMRegionBasicInfoData is generated from C type
vm_region_basic_info_data_64_t, which is a packed struct with a
64-bit field at offset 20. We cannot use uint64 as the field type
in the Go struct, as that will be aligned at offset 24, which does
not match the C struct. Change back to [8]byte (which is what the
cgo command generates), but keep the name Offset.
Updates #61707.
Updates #50891.
Change-Id: I2932328d7f9dfe9d79cff89752666c794d4d3788
Reviewed-on: https://go-review.googlesource.com/c/go/+/516156 Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
David Chase [Fri, 4 Aug 2023 16:57:32 +0000 (12:57 -0400)]
doc: move Go 1.21 release notes to x/website
Now that the development of the Go 1.21 release is almost done, its
release notes are moved to their eventual long-term home in x/website
in CL 516095. Delete the initial development copy here.
Keith Randall [Tue, 1 Aug 2023 21:32:56 +0000 (14:32 -0700)]
cmd/compile: don't use BTS when OR works, add direct memory BTS operations
Stop using BTSconst and friends when ORLconst can be used instead.
OR can be issued by more function units than BTS can, so it could
lead to better IPC. OR might take a few more bytes to encode, but
not a lot more.
Still use BTSconst for cases where the constant otherwise wouldn't
fit and would require a separate movabs instruction to materialize
the constant. This happens when setting bits 31-63 of 64-bit targets.
Add BTS-to-memory operations so we don't need to load/bts/store.
Fixes #61694
Change-Id: I00379608df8fb0167cb01466e97d11dec7c1596c
Reviewed-on: https://go-review.googlesource.com/c/go/+/515755 Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Matthew Dempsky [Thu, 3 Aug 2023 20:52:00 +0000 (13:52 -0700)]
runtime: add deferreturn fast path for linked defers
A consequence of go.dev/cl/513837 was that calling deferreturn would
now use the unwinder to find (just) the current frame, and it turns
out there are workloads where this has a significant performance
impact.
As a simple optimization, this CL adds a fast path for deferreturn to
detect when there are pending linked defers, which allows us to skip
invoking the unwinder entirely.
Notably, this still doesn't handle the corner case of calling
deferreturn in a function that uses linked defer when dynamically
there just aren't any defers pending. It also means that after
recovering from a panic and returning to a frame that used open-coded,
we still need to use the unwinder too.
I hope to further optimize defer handling to improve these cases too,
but this is an easy, short-term optimization that relieves the
performance impact to the affected workloads.
Change-Id: I11fa73649302199eadccc27b403b231db8f33db2
Reviewed-on: https://go-review.googlesource.com/c/go/+/515716
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Klaus Post [Wed, 6 Oct 2021 16:11:40 +0000 (16:11 +0000)]
crypto/md5: optimize amd64 assembly
* Use two ADDL instead of LEAL
* Keep ones in R11
* Use XORL with lower latency instead of NOTL
* Remove loads and load the correct value in the previous round
* Reduce dependency chain in round 2.
* Remove MOVL in round 3.
This PR will be imported into Gerrit with the title and first
comment (this text) used to generate the subject and body of
the Gerrit change.
Change-Id: I02b31229b857e9257dc9d36538883eb3af4ad993
GitHub-Last-Rev: ec8b15d789181d0dac57bf0ba5041ee7aeb305c9
GitHub-Pull-Request: golang/go#43690
Reviewed-on: https://go-review.googlesource.com/c/go/+/283538
Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Joel Sing <joel@sing.id.au>
Cherry Mui [Fri, 16 Sep 2022 22:10:56 +0000 (18:10 -0400)]
cmd/go: default to PIE linking on darwin/amd64
The recent version of darwin linker ld64 emits an warning about
deprecation of the -no_pie flag. Further, the new darwin linker
ld-prime ignores -no_pie flag and generates a PIE binary anyway.
Switch to building PIE binaries by default.
Updates #54482.
Updates #61229.
Change-Id: I81294dcd07a368a20e1349d56556ee2fdcb8df44
Reviewed-on: https://go-review.googlesource.com/c/go/+/461697
Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Mateusz Poliwczak [Thu, 3 Aug 2023 09:34:44 +0000 (09:34 +0000)]
net: use fake DNS dialer for /etc/hosts aliases tests
Change-Id: If9c41bd1e0497e76d901bfd2f749fbeb1ed3ac38
GitHub-Last-Rev: f5777d8c20afb47b8cf093e43c7c25bbbb386e91
GitHub-Pull-Request: golang/go#61734
Reviewed-on: https://go-review.googlesource.com/c/go/+/515535
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Mateusz Poliwczak <mpoliwczak34@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Andy Pan [Sun, 30 Jul 2023 03:42:14 +0000 (11:42 +0800)]
log/slog: catch panics during formatting
Fixes #61648
Change-Id: I6b7f4948ca89142a358d74624607daf42ea8b304
Reviewed-on: https://go-review.googlesource.com/c/go/+/514135 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
miller [Thu, 18 May 2023 10:25:48 +0000 (11:25 +0100)]
encoding/gob: skip TestLargeSlice on machines with small address space
The encoding/gob.TestLargeSlice test needs too much virtual memory
to run reliably on machines with a small address space, for example
the plan9-arm builders where user processes only have 1 gigabyte.
Fixes #60284
Change-Id: Ied88630e5ec6685e14d2060ae316abca1619f9b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/496138
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: David du Colombier <0intro@gmail.com>
Robert Griesemer [Thu, 3 Aug 2023 00:03:55 +0000 (17:03 -0700)]
spec: remove unnecessary sentence
Change-Id: I06345199ff16c80be83c345d734caef1714ec089
Reviewed-on: https://go-review.googlesource.com/c/go/+/515338
TryBot-Bypass: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Joel Sing [Sat, 7 Jan 2023 16:00:21 +0000 (03:00 +1100)]
cmd/internal/obj/arm64: move register encoding into opxrrr
Rather than having register encoding knowledge in each caller of opxrrr,
pass the registers into opxrrr and let it handle the encoding. This reduces
duplication and improves readability.
Change-Id: I202c503465a0169277a0f64340598203c9dcf20c
Reviewed-on: https://go-review.googlesource.com/c/go/+/461140
Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Joel Sing [Thu, 15 Sep 2022 16:29:12 +0000 (02:29 +1000)]
cmd/asm,cmd/internal/obj/riscv,cmd/link: improve TLS handling on riscv64
The existing Thread Local Storage (TLS) implementation for riscv64 uses
initial-exec (IE) mode, however a MOV of a TLS symbol currently loads the
thread pointer offset and not the actual address or memory location.
Rework TLS on riscv64 to generate the full instruction sequence needed to
load from or store to a TLS symbol. Additionally, provide support for both
initial-exec (IE) and local-exec (LE) TLS - in many cases we can use LE,
which is slightly more efficient and easier to support in the linker.
Change-Id: I1b43f8888b3b6b10354bbb79d604771e64d92645
Reviewed-on: https://go-review.googlesource.com/c/go/+/431103 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: M Zhuo <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Cosmos Nicolaou [Wed, 14 Jun 2023 21:33:43 +0000 (14:33 -0700)]
runtime,runtime/pprof: get memory mappings on darwin.
Displaying assembly language has never worked for Apple Silicon
macs (see #50891). This change uses mach_vm_region to obtain the
necessary VM mappings to allow for locating assembly instructions
for a cpu profile.
Fixes #50891
Change-Id: Ib968c55a19b481b82f63337276b552f3b18f69d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/503919
Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Jes Cok [Tue, 1 Aug 2023 13:28:14 +0000 (13:28 +0000)]
text/template: use "IsValid" instead of "!= zero" to compare zero Value
See CL 308769
Change-Id: I0caa0a84215b3d4b8b3dc6f041b6cd9cbe2c0908
GitHub-Last-Rev: e3aa5bde23fe26cbb6711a6ffbf4856a23fa6f54
GitHub-Pull-Request: golang/go#61657
Reviewed-on: https://go-review.googlesource.com/c/go/+/514195
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Johan Brandhorst-Satzkorn [Tue, 1 Aug 2023 23:01:13 +0000 (16:01 -0700)]
runtime/internal: switch GOWASIRUNTIME default
CL 513235 switched the default wasip1 runtime in the misc/wasm
executable script, but it missed this use of the GOWASIRUNTIME
environment variable. Update this instance to make the default runtime
choice consistent.
Change-Id: Iff7f96231422747a38d65d13a940f6e9d04d835d
Reviewed-on: https://go-review.googlesource.com/c/go/+/515115
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Achille Roussel <achille.roussel@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Ian Lance Taylor [Tue, 1 Aug 2023 19:38:43 +0000 (12:38 -0700)]
net/rpc: use reflect.TypeFor for known types
For #60088
Change-Id: I56586b68d5e38a46560f4ced19214f1d2db2850e
Reviewed-on: https://go-review.googlesource.com/c/go/+/514995
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Rob Pike <r@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Change-Id: I23e0005071fcbafeaecaa05f51712dd1de6eed01
GitHub-Last-Rev: 364d7c74fef1668930b730b05a7539f7ac43e60a
GitHub-Pull-Request: golang/go#61661
Reviewed-on: https://go-review.googlesource.com/c/go/+/514215
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Hiro [Tue, 1 Aug 2023 07:25:46 +0000 (07:25 +0000)]
image/jpeg, image/png: replace Fatal with Error in tests
Replaced t.Fatalf with t.Errorf for non-critical errors to footprint more failing test cases for better analysis of the error.
Change-Id: I6f51d21e37a4ddb95d239d8afed2154f3ef52d31
GitHub-Last-Rev: d56aa49bced80c80f1177ae4b9ce038265ead551
GitHub-Pull-Request: golang/go#60524
Reviewed-on: https://go-review.googlesource.com/c/go/+/499336
Run-TryBot: Ian Lance Taylor <iant@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: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
Mateusz Poliwczak [Tue, 1 Aug 2023 18:02:54 +0000 (18:02 +0000)]
net: use the extended RCode from EDNS(0) OPT resources
For a while now we support EDNS, but the current
implementation only sends the OPT resource and doesn't
do anything with the response OPT resource.
For reference the miekg/dns updates the RCode in the
header when there is a OPT resource:
https://github.com/miekg/dns/blob/48f38ebef989eedc6b57f1869ae849ccc8f5fe29/msg.go#L868-L872
Change-Id: I0a7146aed3e50654f340a3925f48612561cb85f4
GitHub-Last-Rev: adc304167e0540cb1f066f07a249d67fad89182e
GitHub-Pull-Request: golang/go#61695
Reviewed-on: https://go-review.googlesource.com/c/go/+/514835
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>
Add support for WSBH/DSBH/DSHD instructions, which are introduced in mips{32,64}r2.
WSBH reverse bytes within halfwords for 32-bit word, DSBH reverse bytes within halfwords for 64-bit doubleword, and DSHD reverse halfwords within doublewords. These instructions can be used to optimize byte swaps.
Ref: The MIPS64 Instruction Set, Revision 5.04: https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00087-2B-MIPS64BIS-AFP-05.04.pdf
Updates #60072
Change-Id: I31c043150fe8ac03027f413ef4cb2f3e435775e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/493816
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Matthew Dempsky [Wed, 26 Jul 2023 17:40:12 +0000 (10:40 -0700)]
doc/go1.21: finish last TODO for go/types.Package.GoVersion
Updates #58645.
Change-Id: I7352bf7f03c478d92ebd0b8345d676d5b2dfccb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/513475
Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
Robert Griesemer [Tue, 1 Aug 2023 22:48:17 +0000 (15:48 -0700)]
go/types, types2: move posVers field into group of package-specific fields (cleanup)
posVers exists once for an entire package. Move it into the group
of fields related to the entire package (and out from the group
of fields that are specific to each batch of files).
Change-Id: I40ea722578408bdf2b85db91b65680e720c0c502
Reviewed-on: https://go-review.googlesource.com/c/go/+/514998
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
runtime: cpu profiler to use high resolution timers on Windows
The CPU profiler skip samples if the sampling rate is too high
for the system timer resolution. This CL uses high resolution
timers on Windows when available, to avoid this problem.
Note that the default sampling rate (100Hz) is already too high
for the Windows timer resolution (15.6ms), so this CL also improves
the default Windows sampling coverage.
Not adding regression tests, as they would be too flaky.
Fixes #61665
Change-Id: Ifdadabc9ebaf56f397eac517bd0e5f1502b956b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/514375
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: David Chase <drchase@google.com>
Change-Id: I9abaf3613c797006b803dcb1dbee16f25ffb7516
GitHub-Last-Rev: 7bc2cba77286be1bd322ee31eee3e1df3d8761f1
GitHub-Pull-Request: golang/go#61645
Reviewed-on: https://go-review.googlesource.com/c/go/+/514035
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Roland Shoemaker [Wed, 7 Jun 2023 22:27:13 +0000 (15:27 -0700)]
crypto/tls: restrict RSA keys in certificates to <= 8192 bits
Extremely large RSA keys in certificate chains can cause a client/server
to expend significant CPU time verifying signatures. Limit this by
restricting the size of RSA keys transmitted during handshakes to <=
8192 bits.
Based on a survey of publicly trusted RSA keys, there are currently only
three certificates in circulation with keys larger than this, and all
three appear to be test certificates that are not actively deployed. It
is possible there are larger keys in use in private PKIs, but we target
the web PKI, so causing breakage here in the interests of increasing the
default safety of users of crypto/tls seems reasonable.
Thanks to Mateusz Poliwczak for reporting this issue.
Fixes #61460
Fixes CVE-2023-29409
Change-Id: Ie35038515a649199a36a12fc2c5df3af855dca6c
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1912161 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/515257
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
Dmitri Shuralyov [Tue, 1 Aug 2023 17:43:08 +0000 (13:43 -0400)]
cmd/distpack: test for .DS_Store files in all directories
macOS may write a .DS_Store file to any directory at any time in
the general case, unfortunately. Expand test rules to catch them
no matter where they may appear.
For #24904.
Change-Id: I98a2bb5d0ae2ab3a191ff87b33d6f8048ca39aa8
Reviewed-on: https://go-review.googlesource.com/c/go/+/514898 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Dmitri Shuralyov [Sat, 29 Jul 2023 20:33:13 +0000 (16:33 -0400)]
cmd/dist: tolerate macOS writing .DS_Store to GOROOT/bin
I was trying out gorebuild (a program that runs make.bash many times)
on a macOS system. Unfortunately there were a few failed invocations
on my first try, but not with a very good or interesting reason:
go tool dist: unexpected new file in $GOROOT/bin: .DS_Store
Tolerate it since it's not unexpected, and will not affect the build.
Change-Id: I656536b896098c2ba934667196d4ce82e706c8da
Reviewed-on: https://go-review.googlesource.com/c/go/+/513763 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Keith Randall [Tue, 1 Aug 2023 17:03:40 +0000 (10:03 -0700)]
reflect: make linkable cross-references in documentation
This makes it easier to click around in documentation on pkg.go.dev.
Change-Id: Idc67c312bc72c612e660607e5400b43ecc110bc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/514895
Run-TryBot: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
root [Wed, 31 May 2023 12:06:02 +0000 (12:06 +0000)]
runtime: handle SIGPE exception for p256 crypto package on s390x
Older s390x before z13 did not have support to carry out floating point operations i.e. they didn't have the support for vector instructions like VX/VL, etc.
Starting with Go1.19, z13 is the minimum hardware level for running Go on LoZ (s390x). The main cause of this issue was the refactoring of elliptic curve to internal/nistec. The new code structures made it difficult to dynamically switch implementations at runtime, so it became necessary (in order machines to continue to use the accelerated implementation) to require z13 as the minimum hardware.
Hence, Go programs, when run on unsupported hardware, should crash on startup instead of crashing out in crypto code.
Fixes: #58465
Change-Id: I7c1a816205d19b5ddd2f1464839d16fa96815384
Reviewed-on: https://go-review.googlesource.com/c/go/+/499495 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Cherry Mui <cherryyz@google.com>
Rob Findley [Tue, 25 Jul 2023 15:57:37 +0000 (11:57 -0400)]
go/types, types2: instantiated interfaces must be concurrency safe
It is the responsibility of go/types to complete any interface it
creates, except for those created by the user using NewInterface.
However, this was not being done for interfaces created during
instantiation.
Fix this by (rather carefully) ensuring that all newly created
interfaces are eventually completed.
Fixes golang/go#61561
Change-Id: I3926e7c9cf80714838d2c1b5f36a2d3221c60c41
Reviewed-on: https://go-review.googlesource.com/c/go/+/513015
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
cmd/compile/internal/mips: use hardware NOP instruction as NOOP on mips platform
This CL uses mips hardware NOP instruction as NOOP on mips platform, instead of pseudo NOP "nor $zero,$zero,$zero".
Change-Id: I336e1ba4228b71e6bfc6be66b367a4327fb3b36e
Reviewed-on: https://go-review.googlesource.com/c/go/+/509015 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Ian Lance Taylor [Mon, 31 Jul 2023 22:24:18 +0000 (15:24 -0700)]
text/template, html/template: use reflect.TypeFor for known types
For #60088
Change-Id: Ibc3983ca5cfe396087ddfa96c43cfe32ca47129a
Reviewed-on: https://go-review.googlesource.com/c/go/+/514640
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Ian Lance Taylor [Mon, 31 Jul 2023 22:18:12 +0000 (15:18 -0700)]
encoding/json: use reflect.TypeFor for known types
For #60088
Change-Id: I2e471c76de62944b14472966b63f5778124b9b8b
Reviewed-on: https://go-review.googlesource.com/c/go/+/514655
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Ian Lance Taylor [Mon, 31 Jul 2023 22:20:54 +0000 (15:20 -0700)]
encoding/xml: use reflect.TypeFor for known types
For #60088
Change-Id: Ib2589b994d304cca1f2e2081639959d80818ac7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/514639
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
os/exec: Use the built-in function min instead of minInt
The built-in function `min` has been implemented and can now be used to replace some manually written `minType` helper functions.
Change-Id: Ie8ffc7881c8652ece752751214f1242bf76a6e7e
GitHub-Last-Rev: 5db344f13142c78f437571e3a1cdc0b02c0589cb
GitHub-Pull-Request: golang/go#60866
Reviewed-on: https://go-review.googlesource.com/c/go/+/504315
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Jes Cok [Mon, 12 Jun 2023 12:09:44 +0000 (12:09 +0000)]
archive/tar: narrow trim range for formatter'formatString
Trim s[:len(b)-1] rather than s[:len(b)], since s[len(b)-1] is '/'.
Change-Id: I055da555810c112774549bd13d4faa8bfa0a60dc
GitHub-Last-Rev: 457977514d75a6c72086c2f4d89fb601280b8b90
GitHub-Pull-Request: golang/go#60729
Reviewed-on: https://go-review.googlesource.com/c/go/+/502376
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
Ian Lance Taylor [Mon, 31 Jul 2023 17:30:27 +0000 (10:30 -0700)]
encoding/gob: use reflect.TypeFor for known types
This avoids several mildly confusing Elem calls.
For #60088
Change-Id: If7b83d2ab10537c7e886a035b43cb272130c1669
Reviewed-on: https://go-review.googlesource.com/c/go/+/514455
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Ian Lance Taylor [Sat, 29 Jul 2023 15:59:20 +0000 (08:59 -0700)]
sync: panic rather than throw on nil *Pool
Fixes #61651
Change-Id: I27d581719e6bf38910f9d47dcf023bbff74ddf72
Reviewed-on: https://go-review.googlesource.com/c/go/+/514037 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Mauri de Souza Meneguzzo [Sat, 29 Jul 2023 20:26:00 +0000 (20:26 +0000)]
regexp/syntax: accept (?<name>...) syntax as valid capture
Currently the only named capture supported by regexp is (?P<name>a).
The syntax (?<name>a) is also widely used and there is currently an effort from
the Rust regex and RE2 teams to also accept this syntax.
Fixes #58458
Change-Id: If22d44d3a5c4e8133ec68238ab130c151ca7c5c5
GitHub-Last-Rev: 31b50e6ab40cfb0f36df6f570525657d4680017f
GitHub-Pull-Request: golang/go#61624
Reviewed-on: https://go-review.googlesource.com/c/go/+/513838
Auto-Submit: Ian Lance Taylor <iant@google.com>
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>