4769 Commits

Author SHA1 Message Date
Filippo Valsorda
6997bcd820 crypto/x509: add RawSignatureAlgorithm
Fixes #76133

Change-Id: I7889aeff2ed197ee15f2ce7689b99b936a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/778660
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2026-05-18 09:09:22 -07:00
Marten Seemann
1456da550a crypto/tls: add QUICConfig.ClientHelloInfoConn
Fixes #77363.

Change-Id: I28ec5cdd16e96bae13f495a904006845dfbf3a2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/745720
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
2026-05-07 14:34:33 -07:00
Damien Neil
15b9fc2659 net/http: support non-tls.Conn TLS connections
Historically, x/net/http2 has supported working with user-provided
net.Conns that implement the ConnectionState method from *tls.Conn.

Howver, net/http has required that user-provided net.Conns be a
concrete *tls.Conn for it to observe the TLS state of the connection.

CL 440795 made the net/http Server set Request.TLS when the net.Conn
has a ConnectionState method, but did not affect protocol negotiation.
(So a non-*tls.Conn can never negotiate HTTP/2.)

CL 765360 made the net/http Server also able to negotiate HTTP/2
when using a non-*tls.Conn net.Conn with a ConnectionState method.
This was part of a change to support net/http/internal/http2 tests,
not an intentional change to functionality in net/http.

Finish off the job by making the net/http Transport negotiate HTTP/2
when using a non-*tls.Conn net.Conn with a ConnectionState method.

Document the new support.

Fixes #21753

Change-Id: Ia9854f90df3044fcc855fce105006a186a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/772961
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: 王伟强 <wwqgtxx@gmail.com>
TryBot-Bypass: Damien Neil <dneil@google.com>
2026-05-07 14:04:41 -07:00
Emmanuel T Odeke
978f00ab7f crypto/x509/pkix: render string-typed attribute values as strings
RFC 2253 §2.4 says that an AttributeValue should be rendered as a string
when its ASN.1 type has a string representation, reserving the
prefixed hex form for types that don't.

RDNSequence.String previously hex-encoded any value whose OID wasn't in
attributeTypeNames, even when the value was already a Go string. Render
string-typed values directly; the existing escape logic handles RFC 2253
special characters.

Fixes #33093

Change-Id: Idb8acd907f9dac902790c9ac7d0bc0cb36b5b918
Reviewed-on: https://go-review.googlesource.com/c/go/+/773800
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-05-06 07:52:57 -07:00
cuishuang
4e0783368b all: fix a lot of spelling mistakes
Change-Id: I86e48219ddfdf0d8607a69d7915443e8e21194d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/768940
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-05-01 13:52:37 -07:00
Michael Pratt
02d136966c cmd/trace: listen on localhost when address omitted
Today `-http=:6060` listens on all addresses. Strictly speaking, that is
what `:6060` implies, but most users actually only care to access from
their own machine.

cmd/pprof listens only on localhost when given such an address.
Change cmd/trace to match this behavior since it is a safer default and
makes cmd/trace more consistent with our other tools.

Users that actually want to listen on all addresses can explicitly
include the unspecified address (e.g., `-http=0.0.0.0:6060`).

For #78921.

Change-Id: I47e1fbbdd5374abfeeec10916eb9d2136a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/770461
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-04-24 12:08:18 -07:00
Damien Neil
2fb2b98da3 uuid: new package for generating and parsing UUIDs
For #62026

Change-Id: Idd186c0eb1d9e9962e1bd4c26d61ea0c57473eb8
Reviewed-on: https://go-review.googlesource.com/c/go/+/725602
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
2026-04-21 08:37:26 -07:00
qiulaidongfeng
11b596c22d bytes,strings: add CutLast
Fixes #71151

Change-Id: I3b3d49c35b0fa2c1220d3f39bbd506cc072b52b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/764601
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2026-04-14 06:58:23 -07:00
Michael Matloob
027a5bf27f cmd/go: remove bzr support
Fixes #78090

Change-Id: Ib222ca91a8421f6de3934d46b68b03c56a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/764760
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2026-04-11 15:28:25 -07:00
Robert Griesemer
2393d14061 spec: move rule for type parameters up in section of range clause
Make the rule for range expressions of type parameter type more
visible by moving it up (it was easily missed before as it was
at the end of the example section).

Add a corresponding example to the examples.

Per suggestion from @adonovan.

Change-Id: I8527e69ecc7d0110554ba00f4c30829f7d260d41
Reviewed-on: https://go-review.googlesource.com/c/go/+/764921
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2026-04-09 14:33:22 -07:00
Robert Griesemer
0eb3e5736d spec: fix prose in Instantiatons section
For #77273.

Change-Id: Idf5b81f77115e4e30921476f7424769fdf604ef4
Reviewed-on: https://go-review.googlesource.com/c/go/+/764920
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2026-04-09 13:05:40 -07:00
Nicholas S. Husin
e2a9aeae52 doc/next: move 78137.md to the correct directory
The release note was put in the wrong directory in the original
CL 754960.

Updates #78137

Change-Id: I6b3b776214c7fa3d90f2ec919072d3016a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/763900
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Nicholas Husin <nsh@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
2026-04-07 20:38:53 -07:00
Robert Griesemer
524b8606a8 spec: add syntax and prose for generic methods
For #77273.

Change-Id: I600cfd6209cf77d07c18a94ac1126da1c0ba9fab
Reviewed-on: https://go-review.googlesource.com/c/go/+/759880
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
2026-04-07 16:47:00 -07:00
Alan Donovan
a2cc178edf go/types: Hasher, a hash function for Types
This CL defines a hash function for Types using the
maphash.Hasher API proposed in #70471 (CL 657296)
that is consistent with the equivalence relation
of types.Identical.

It also defines a variant, HasherIgnoreTypes, that is
consistent with types.IdenticalIgnoreTags. (The actual
hash functions are identical: both ignore tags.)

The logic of the hash function was derived from
golang.org/x/tools/go/types/typeutil.Hash.

+ test, doc, relnote

Fixes #69420
Updates #70471

Change-Id: I1947cda6aec229d56eeda13decfb05eb266770f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/657297
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2026-04-07 15:39:48 -07:00
Alan Donovan
330aec8109 hash/maphash: add Hasher interface and ComparableHasher impl
Hasher is the standard interface for expressing custom hash
functions and equivalence relations for arbitrary data types.
This allows them to be used in hash-based collection types
such as a hash table (CL 612217) or a Bloom filter (CL 740440).

The ComparableHasher type is an implementation of the Hasher
interface for comparable values that is consistent with their
usual equivalence relation (==).

Fixes #70471

Change-Id: Iaa42eb7017d9c4dab487ad6c842c68a81fa7d28a
Reviewed-on: https://go-review.googlesource.com/c/go/+/657296
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
TryBot-Bypass: Alan Donovan <adonovan@google.com>
2026-04-03 08:21:15 -07:00
Robert Griesemer
515b8bf22e spec: in range-over-func, the yield function cannot be variadic
Be explicit about it.

For #78483.
For #78314.

Change-Id: I9dc65d72ec7840a73c21869a8ca26dfeed17ad61
Reviewed-on: https://go-review.googlesource.com/c/go/+/761701
Reviewed-by: Jakub Ciolek <jakub@ciolek.dev>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2026-04-01 16:39:18 -07:00
Robert Griesemer
c7e151d8c4 spec: s/defined/declared/ in a handful of places (cleanup)
Use "declared" rather than "defined" where referring to a declaration
(rather than a type definition) is more appropriate.

Change-Id: I691b55e05fcdce489e45286c7a88cbd992e80e57
Reviewed-on: https://go-review.googlesource.com/c/go/+/757121
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
2026-03-24 08:22:18 -07:00
Robert Griesemer
39267791a4 spec: predeclared types are named, not defined types
We want the predeclared types (excluding any) to have unique identity.
Originally (Go 1.0), the only types with unique identity were named
types (and they happened to have names).

When we introduced alias declarations, we changed the terminology and
called named types (old) defined types (new). With this change, the
predeclared types became defined types.

When we introduced type parameters, we re-introduced the notion of a
named type as the (new-again) umbrella term for types with a unique
identity. But we didn't adjust the spec for predeclared types - we
kept calling them defined types.

Fix this by completing the terminology transition.
Also, clarify that the predeclared type `any` is not a named type.

Fixes #78208.

Change-Id: I13c2b8faa35e2b51958097872b1529c2aaf42c4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/757120
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
2026-03-24 08:22:13 -07:00
Nicholas S. Husin
c861da326e doc/next: add release note for automatic HTTP/1 response body draining
For #77370

Change-Id: I8310bad4b0cf92e0e4f9fd826eab8172558a5144
Reviewed-on: https://go-review.googlesource.com/c/go/+/756160
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2026-03-24 06:29:25 -07:00
Basavaraj PB
f26befb380 net: avoid wrapping io.EOF in UnixConn read methods
The io.Reader contract requires that Read methods return io.EOF
directly instead of wrapping it in another error.

Currently UnixConn.ReadFromUnix, ReadFrom, and ReadMsgUnix wrap
io.EOF inside net.OpError, causing callers checking for io.EOF
to fail.

Fix by avoiding wrapping when err == io.EOF.

Fixes #78137

Change-Id: Ibb4e67cfb4c727c668ad79d1fb9e205f9b7e1903
Reviewed-on: https://go-review.googlesource.com/c/go/+/754960
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Nicholas Husin <nsh@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Basavaraj P <basavarajbankolli76@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Nicholas Husin <nsh@golang.org>
2026-03-23 13:47:18 -07:00
Dmitri Shuralyov
686b127fe8 doc: fix 2 links in godebug.md
For #76349.

Change-Id: I27dd7658e6cbcf6afd1287a7ec5a39c576ceee67
Reviewed-on: https://go-review.googlesource.com/c/go/+/756580
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Finkel <david.finkel@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2026-03-20 08:49:10 -07:00
Dmitri Shuralyov
f9bdf58fb1 doc: remove template use in godebug.md
This file used to be implicitly a template prior to CL 733500, but now
it's no longer a template. The only template use here can be trivially
expressed with pure Markdown syntax, so do that. (The alternative path
would be to set 'template: true' explicitly.)

Fixes #78211.

Change-Id: I66970f0d081b4e80e8d330330ad17a5702364391
Reviewed-on: https://go-review.googlesource.com/c/go/+/756560
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
2026-03-20 08:49:06 -07:00
Michael Podtserkovskii
4b7b1be731 cmd/internal/objabi: implement GCC-compatible response file parsing
Replace line-based response file parsing with GCC-compatible one
that supports:
- Whitespace-delimited arguments (multiple args per line)
- Single quotes for literal content (no escape processing)
- Double quotes with escape sequences: \\, \", \$, \`
- Backslash-newline line continuation (both LF and CRLF)

Update encodeArg in cmd/go/internal/work to produce GCC-compatible
output with proper escaping of special characters.

Add response file support to cmd/pack.

For #77177

Change-Id: Ib8dbe2761ebe139b3949dcaeb1de4bb5b15ddabb
Reviewed-on: https://go-review.googlesource.com/c/go/+/737500
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2026-03-18 19:58:52 -07:00
Sean Liao
34ff24cb4b doc/next: add release notes for enabling stdversion in tests
For CL 755240
For #77729

Change-Id: I8e3cd744bce0e7807fb403f0b391a1442a79adcc
Reviewed-on: https://go-review.googlesource.com/c/go/+/756040
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-17 09:55:33 -07:00
Robert Griesemer
c697e0fc48 spec: fix prose in rule for keys of struct composite literals
Use "promoted" rather than "embedded" because the selector
provides access to a promoted field.

For #9859.

Change-Id: If62c5260ab7bdfef3d6ea4ff770543ad668ac9b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/755782
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2026-03-16 19:07:40 -07:00
David Finkel
3694f33692 runtime: GODEBUG=tracebacklabels=1 for 1.27+
https://go.dev/cl/742580 updated the goroutine label format in
tracebacks to only quote the values under some circumstances, and use a
more broadly acceptable format. Flip the GODEBUG=tracebacklabels default
for go 1.27+ modules.

Notably, tracebacklabels is marked as Opaque to avoid some diciness in
maintaining a usage metric in signal handlers, etc. (where mutex
acquisition may be problematic)

Also, update the go 1.27 release notes to call out the new feature.

Updates #76349

Change-Id: Iedd3f6b17d83e99da20365b952a565022d20ff13
Reviewed-on: https://go-review.googlesource.com/c/go/+/751580
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
2026-03-10 20:06:24 -07:00
Emmanuel T Odeke
0359353574 net/url: add Values.Clone
This change implements a method Clone on Values
that creates a deep copy of all of the subject's
consistent values.

CL 746800 added URL.Clone and this one therefore closes
out the feature.

Fixes #73450

Change-Id: I6fb95091c856e43063ab641c03034e1faaff8ed6
Reviewed-on: https://go-review.googlesource.com/c/go/+/746801
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Emmanuel Odeke <emmanuel@orijtech.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
2026-03-06 10:48:32 -08:00
Roland Shoemaker
fb16297ae5 html/template: properly escape URLs in meta content attributes
The meta tag can include a content attribute that contains URLs, which
we currently don't escape if they are inserted via a template action.
This can plausibly lead to XSS vulnerabilities if untrusted data is
inserted there, the http-equiv attribute is set to "refresh", and the
content attribute contains an action like `url={{.}}`.

Track whether we are inside of a meta element, if we are inside of a
content attribute, _and_ if the content attribute contains "url=". If
all of those are true, then we will apply the same URL escaping that we
use elsewhere.

Also add a new GODEBUG, htmlmetacontenturlescape, to allow disabling this
escaping for cases where this behavior is considered safe. The behavior
can be disabled by setting htmlmetacontenturlescape=0.

Fixes CVE-2026-27142
Fixes #77954

Change-Id: I9bbca263be9894688e6ef1e9a8f8d2f4304f5873
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3360
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/752181
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-05 17:05:07 -08:00
Robert Griesemer
1a8f9d8141 spec: permit keys denoting embedded fields in struct literals
For #9859.

Change-Id: I4209b41c4c09126d9ad377eea6c091c8d8a9480f
Reviewed-on: https://go-review.googlesource.com/c/go/+/734321
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2026-03-05 08:48:37 -08:00
Towaiji
0856d46fd1 doc/go_spec: add max and min to forbidden expression statements list
The expression statements section omitted max and min from the list
of built-ins that are not permitted in statement context.

Fixes #77896

Change-Id: I1f3d4b1d2465bde156ff751a9a7b5a212509e9a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/751080
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Bypass: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2026-03-03 13:29:18 -08:00
Alan Donovan
4e693d1ec5 go/token: add File.String method
It returns a brief, unspecified, human-readable description
of the File.

+ test, doc, relnote

Fixes #76285

Change-Id: I8b0705cf20eaac095bc9dfba7f1181774544f02c
Reviewed-on: https://go-review.googlesource.com/c/go/+/743280
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2026-02-23 07:48:58 -08:00
Emmanuel T Odeke
09c3cfbc20 net/url: add (*URL).Clone
This change adds URL.Clone which creates a deep copy
of the URL's fields including the .User and tests these.
In a separate CL I shall send Values.Clone too.

Updates #73450

Change-Id: Ifea4bfc4ddd0640247544ec111ec83bd9bbe9104
Reviewed-on: https://go-review.googlesource.com/c/go/+/746800
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
2026-02-19 15:40:16 -08:00
Mateusz Poliwczak
4f5d5ddf7c doc: document the gotypesalias removal
Change-Id: I21a23870ba1917c72efaa6438f7cd32f6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/745280
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Mateusz Poliwczak <mpoliwczak34@gmail.com>
2026-02-13 11:44:40 -08:00
Sean Liao
3e4143dd44 doc: document GODEBUG carve out for security releases
Fixes #63741

Change-Id: I9c40fff7d3ad67565205657c5d89934a3f1f576c
Reviewed-on: https://go-review.googlesource.com/c/go/+/723102
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-02-13 09:44:50 -08:00
Damien Neil
8ac41b52c4 testing/synctest: add Sleep
Add a convenience function which combines time.Sleep and synctest.Wait.

Fixes #77169

Change-Id: I2ff105105e95cfd8e5b4f72ccacf7afa59efb6bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/740066
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-02 14:43:36 -08:00
Mateusz Poliwczak
3c924059e6 go/scanner: add End method to Scanner
Fixes #74958

Change-Id: I50ef64ae9ae6a762a7aada3d29914bae6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/738681
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-28 22:44:07 -08:00
Dmitri Shuralyov
bb221e8954 doc/go1.27: document macOS requirements
For #75836.

Change-Id: I07f607178fadbfec95459b2a446f58ae3c5e8932
Reviewed-on: https://go-review.googlesource.com/c/go/+/739380
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-26 13:07:04 -08:00
Nicholas S. Husin
e0c4ad77cf net/http: Add Server.DisableClientPriority field
The DisableClientPriority field is currently still a no-op, and will
only take effect once golang.org/x/net is bundled up into h2_bundle.go
again.

For #75500

Change-Id: I9e2135bed50b7f201aea93467e3f5f5f6c81cb1c
Reviewed-on: https://go-review.googlesource.com/c/go/+/738620
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
2026-01-22 14:02:25 -08:00
Russ Cox
dd39dfb534 all: update to Unicode 17
Process:
- Disable unicode TestProperties.
- Run UNICODE_VERSION=17.0.0 go -C ../src/golang.org/x/text generate
- Run go generate strconv
- Update unicode TestProperties by hand to add missing test cases.

This will break x/text using the main repo until the corresponding
x/text CL is submitted. It should not break anything else.

For #77266.

Change-Id: Ia3ffb5a81e212b991714eef70eebfca98a0c8aab
Reviewed-on: https://go-review.googlesource.com/c/go/+/737420
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Bypass: Russ Cox <rsc@golang.org>
2026-01-22 13:16:03 -08:00
Carlos Amedee
455282911a doc/next: initialize
Initialize the doc/next directory for the next release by copying the
contents of doc/initial into it.

For #76474.

Change-Id: I52c826cf42aa93f1dea8bf8f7f386a77265bf31a
Reviewed-on: https://go-review.googlesource.com/c/go/+/737961
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
TryBot-Bypass: Carlos Amedee <carlos@golang.org>
2026-01-21 12:27:12 -08:00
Michael Pratt
7251c9e0f0 doc: fix urlmaxqueryparams typos
Updates #77101.

Change-Id: I6a6a636cd58e1bd01943066368cb1424db6c6a92
Reviewed-on: https://go-review.googlesource.com/c/go/+/737040
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-16 09:40:45 -08:00
Damien Neil
2dcaaa7512 net/url: add urlmaxqueryparams GODEBUG to limit the number of query parameters
net/url does not currently limit the number of query parameters parsed by
url.ParseQuery or URL.Query.

When parsing a application/x-www-form-urlencoded form,
net/http.Request.ParseForm will parse up to 10 MB of query parameters.
An input consisting of a large number of small, unique parameters can
cause excessive memory consumption.

We now limit the number of query parameters parsed to 10000 by default.
The limit can be adjusted by setting GODEBUG=urlmaxqueryparams=<n>.
Setting urlmaxqueryparams to 0 disables the limit.

Thanks to jub0bs for reporting this issue.

Fixes #77101
Fixes CVE-2025-61726

Change-Id: Iee3374c7ee2d8586dbf158536d3ade424203ff66
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3020
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736712
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-15 10:35:53 -08:00
Robert Griesemer
cc1d7afb24 spec: slightly re-arrange composite literal section for readability
- introduce subtitles to make various sub-sections easier to find
- split rules for struct literals into two groups (literals without
  and with keys)
- move section on syntax ambiguity up as it pertains to the syntax
  introduced at the start
- move prose specific to map literals into its own section

No language changes.

Change-Id: If8895b869138693179ca6e4d8b1c6ebdc705eccf
Reviewed-on: https://go-review.googlesource.com/c/go/+/734322
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2026-01-12 10:17:06 -08:00
Gopher Robot
5945fc02fc doc/next: delete
The release note fragments have been merged and added
as _content/doc/go1.26.md in x/website in CL 726360.

For #75005.

Change-Id: I13533b8a6aac470afe066ddf420028c0360a5bb1
Reviewed-on: https://go-review.googlesource.com/c/go/+/726341
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
2025-12-03 09:37:54 -08:00
Will Faught
2729e87aa5 doc/next: pluralize 'result'
Change-Id: Id53ee875ee31b43a6d7bd3f180260276ddd4f8b9
GitHub-Last-Rev: c90e3869671888b71b3c6a34bd639ce013f89762
GitHub-Pull-Request: golang/go#76664
Reviewed-on: https://go-review.googlesource.com/c/go/+/725922
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2025-12-03 08:04:02 -08:00
Alan Donovan
6e72f526cd doc/next/6-stdlib/99-minor/go/ast/76031.md: add BasicLit caveat
For #76395

Change-Id: Ied054b54f319a2a448ccdfa4b42044250abb5af7
Reviewed-on: https://go-review.googlesource.com/c/go/+/722820
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2025-12-03 07:26:36 -08:00
Robert Griesemer
7cab1b1b26 doc: pre-announce removal of gotypesalias and asynctimerchan GODEBUG flags
This announcement follows the policy outlined in #76163.

For #76472.

Change-Id: I4299e7f474e314810883dc4f50be6afba8c3e3e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/726020
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-02 16:18:09 -08:00
Robert Griesemer
1a64db3a4b spec: remove restriction on channel element types for close built-in (bug fix)
The spec states that if the argument type for close is a type parameter,
it's type set must only contain channels and they must all have the same
element type. This latter requirement (all must have the same element
type) was never enforced by the compiler, nor is it important for
correctness or required by the implementation.

This change removes this requirement also in the spec and thus
documents what was always (since 1.18) the case.

Fixes #74034.

Change-Id: If65d50bfb581b7f37999413088d3d3b1820e054a
Reviewed-on: https://go-review.googlesource.com/c/go/+/725923
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2025-12-02 15:07:19 -08:00
Michael Anthony Knyszek
2e06fa6b68 doc/next: release note for scheduler metrics
For #15490.

Change-Id: Ic268a7d1d54814e903fc44f5f143008fb5d6dcde
Reviewed-on: https://go-review.googlesource.com/c/go/+/725663
TryBot-Bypass: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
2025-12-02 14:44:07 -08:00
Michael Anthony Knyszek
77c795011b doc/next: document cgo call overhead improvement
Change-Id: Ibac18513d2f76172665b4f3a4ea09b69ae0bdef3
Reviewed-on: https://go-review.googlesource.com/c/go/+/725664
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
2025-12-02 14:43:44 -08:00