Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1926d1d
cmd/compile: clarify relativity of a simple file name in a line direc…
griesemer May 20, 2026
a00bbab
crypto/internal/fips140/edwards25519/field: speed up add chains
josharian Mar 25, 2026
acced3d
crypto/internal/fips140/edwards25519/field: delete Square amd64 assembly
josharian May 14, 2026
c0bd270
net/netip: update godoc comments
tklauser May 19, 2026
05ab7b8
cmd/compile/internal/syntax: refactor/reword new line directives tests
griesemer May 20, 2026
3652f29
cmd/link: skip TestAbstractOriginSanity
prattmic May 20, 2026
694604e
runtime: further reduce number of size classes
matloob May 20, 2026
6a002d1
cmd/dist: pass -std to assembler
cherrymui May 20, 2026
4dde0f6
all: use linknamestd for new linknames
cherrymui May 20, 2026
4a38094
database/sql: add RowsColumnScanner, expose ConvertAssign
neild Mar 24, 2026
c700213
encoding/json/jsontext: expand Decoder.UnreadBuffer documentation
dsnet May 19, 2026
f571fc9
encoding/json: clarify that v1 Unmarshal calls UnmarshalerFrom methods
dsnet May 20, 2026
bbf60f3
all: update to x/tools@b38156a7
mrkfrmn May 20, 2026
91a81e5
go/types,cmd/compile/internal/types2: add String methods
adonovan May 20, 2026
be35de2
crypto/internal/fips140/nistec: replace P-256 scalar assembly with fiat
FiloSottile May 5, 2025
e4e6887
crypto/internal/fips140/nistec: mechanically improve P-256 scalar fia…
FiloSottile Feb 25, 2026
2c659bb
crypto/internal/fips140/nistec: optimize P-256 scalar fiat implementa…
FiloSottile Feb 25, 2026
244c8ae
crypto/internal/fips140/nistec: avoid some mul64 in p256 calculations
egonelbre May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/next/67546.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pkg database/sql, func ConvertAssign(driver.ScanContext, interface{}, driver.Value) error #67546
pkg database/sql/driver, type RowsColumnScanner interface { Close, Columns, Next, NextRow, ScanColumn } #67546
pkg database/sql/driver, type RowsColumnScanner interface, Close() error #67546
pkg database/sql/driver, type RowsColumnScanner interface, Columns() []string #67546
pkg database/sql/driver, type RowsColumnScanner interface, Next([]Value) error #67546
pkg database/sql/driver, type RowsColumnScanner interface, NextRow() error #67546
pkg database/sql/driver, type RowsColumnScanner interface, ScanColumn(ScanContext, int, interface{}) error #67546
pkg database/sql/driver, type ScanContext struct #67546
3 changes: 3 additions & 0 deletions api/next/79287.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pkg go/types, method (*TypeList) String() string #79287
pkg go/types, method (*TypeParamList) String() string #79287
pkg go/types, method (Instance) String() string #79287
2 changes: 2 additions & 0 deletions doc/next/6-stdlib/99-minor/database/sql/67546.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The new [ConvertAssign] function gives database drivers access
to the type conversions performed by [Rows.Scan].
2 changes: 2 additions & 0 deletions doc/next/6-stdlib/99-minor/database/sql/driver/67546.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Drivers may implement the new [RowsColumnScanner] interface
to scan directly into user-provided destinations.
1 change: 1 addition & 0 deletions doc/next/6-stdlib/99-minor/go/types/79287.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- nothing to see here but some String methods -->
2 changes: 1 addition & 1 deletion src/cmd/compile/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ all other compiler directives are of the form
//
// Examples:
//
// //line foo.go:10 the filename is foo.go, and the line number is 10 for the next line
// //line foo.go:10 the (relative) filename is foo.go, and the line number is 10 for the next line
// //line ../foo.go:10 relative filenames are resolved against the directive's source directory
// //line C:foo.go:10 colons are permitted in filenames, here the filename is C:foo.go, and the line is 10
// //line a:100 :10 blanks are permitted in filenames, here the filename is " a:100 " (excluding quotes)
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/compile/internal/ir/symtab.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ type symsStruct struct {
InterfaceSwitch *obj.LSym
MallocGC *obj.LSym
MallocGCTiny *obj.LSym
MallocGCSmallNoScan [11]*obj.LSym
MallocGCSmallScanNoHeader [11]*obj.LSym
MallocGCSmallNoScan [8]*obj.LSym
MallocGCSmallScanNoHeader [8]*obj.LSym
Memmove *obj.LSym
Memequal *obj.LSym
Msanread *obj.LSym
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/compile/internal/ssa/stmtlines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ func TestStmtLines(t *testing.T) {
if pkgname == "runtime" {
continue
}
if pkgname == "crypto/internal/fips140/nistec/fiat" {
if pkgname == "crypto/internal/fips140/nistec/fiat" ||
pkgname == "crypto/internal/fips140/nistec" {
continue // golang.org/issue/49372
}
if e.Val(dwarf.AttrStmtList) == nil {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/ssagen/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ func (s *state) specializedMallocSym(size int64, hasPointers bool) *obj.LSym {
if !s.sizeSpecializedMallocEnabled() {
return nil
}
const specializedMallocMax = 128 // This must match the constant in mkmalloc.
const specializedMallocMax = 80 // This must match the constant in mkmalloc.
if size > specializedMallocMax {
return nil
}
Expand Down
126 changes: 36 additions & 90 deletions src/cmd/compile/internal/syntax/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func TestParseFile(t *testing.T) {
var tooLarge int = PosMax + 1

func TestLineDirectives(t *testing.T) {
// valid line directives lead to a syntax error after them
// valid line directives lead to this syntax error after them
const valid = "syntax error: package statement must be first"
const filename = "directives.go"

Expand Down Expand Up @@ -271,8 +271,8 @@ func TestLineDirectives(t *testing.T) {
{fmt.Sprintf("//line foo:10:%d\n", tooLarge), fmt.Sprintf("invalid column number: %d", tooLarge), filename, 1, 15},

// effect of valid //line directives on lines
{"//line foo:123\n foo", valid, "foo", 123, 0},
{"//line foo:123\n foo", valid, " foo", 123, 0},
{"//line foo:123\n", valid, "foo", 123, 0},
{"//line foo:123\n", valid, " foo", 123, 0},
{"//line foo:123\n//line bar:345\nfoo", valid, "bar", 345, 0},
{"//line :x:1\n", valid, ":x", 1, 0},
{"//line foo ::1\n", valid, "foo :", 1, 0},
Expand Down Expand Up @@ -322,7 +322,7 @@ func TestLineDirectives(t *testing.T) {
{fmt.Sprintf("/*line foo:10:%d*/", tooLarge), fmt.Sprintf("invalid column number: %d", tooLarge), filename, 1, 15},

// effect of valid /*line directives on lines
{"/*line foo:123*/ foo", valid, "foo", 123, 0},
{"/*line foo:123*/", valid, "foo", 123, 0},
{"/*line foo:123*/\n//line bar:345\nfoo", valid, "bar", 345, 0},
{"/*line :x:1*/", valid, ":x", 1, 0},
{"/*line foo ::1*/", valid, "foo :", 1, 0},
Expand All @@ -342,6 +342,14 @@ func TestLineDirectives(t *testing.T) {
{"/*line :10:20*/", valid, filename, 10, 20},
{"//line bar:1\n/*line :10*/", valid, "", 10, 0},
{"//line bar:1\n/*line :10:20*/", valid, "bar", 10, 20},

// effect of cleaning filenames
{"//line C:foo:123\n", valid, filepath.Clean("C:foo"), 123, 0},
{"//line /src/a/a.go:123\n", valid, filepath.Clean("/src/a/a.go"), 123, 0},
{"//line foo/../bar:1\n", valid, filepath.Clean("foo/../bar"), 1, 0},
{"/*line C:foo:123*/", valid, filepath.Clean("C:foo"), 123, 0},
{"/*line /src/a/a.go:123*/", valid, filepath.Clean("/src/a/a.go"), 123, 0},
{"/*line foo/../bar:1*/", valid, filepath.Clean("foo/../bar"), 1, 0},
} {
base := NewFileBase(filename)
_, err := Parse(base, strings.NewReader(test.src), nil, nil, 0)
Expand Down Expand Up @@ -372,102 +380,40 @@ func TestLineDirectives(t *testing.T) {
}

func TestLineDirectivesWithDir(t *testing.T) {
const valid = "syntax error: package statement must be first"
srcFile := filepath.Join("dir", "directives.go")

check := func(src, want string) {
t.Helper()
base := NewFileBase(srcFile)
_, err := Parse(base, strings.NewReader(src), nil, nil, 0)
if err == nil {
t.Errorf("%s: no error reported", src)
return
}
perr, ok := err.(Error)
if !ok {
t.Errorf("%s: got %v; want parser error", src, err)
return
}
if perr.Msg != valid {
t.Errorf("%s: got msg = %q; want %q", src, perr.Msg, valid)
return
}
if got := perr.Pos.RelFilename(); got != want {
t.Errorf("%s: got filename = %q; want %q", src, got, want)
}
const dir = "dir"
filename := filepath.Join(dir, "directives.go")

type test struct{ src, filename string }
relPaths := []test{
{"//line foo:1\n", filepath.Join(dir, "foo")},
{"//line ./foo:1\n", filepath.Join(dir, "foo")},
{"//line ../foo:1\n", "foo"},
{"//line sub/foo:1\n", filepath.Join(dir, "sub", "foo")},
{"/*line foo:1*/", filepath.Join(dir, "foo")},
{"//line bar:1\n//line :2:1\n", filepath.Join(dir, "bar")},
}

for _, test := range []struct {
src string
filename string
}{
{"//line foo:1\n x", filepath.Join("dir", "foo")},
{"//line ./foo:1\n x", filepath.Join("dir", "foo")},
{"//line ../foo:1\n x", "foo"},
{"//line sub/foo:1\n x", filepath.Join("dir", "sub", "foo")},
{"/*line foo:1*/ x", filepath.Join("dir", "foo")},
{"//line bar:1\n//line :2:1\n x", filepath.Join("dir", "bar")},
} {
check(test.src, test.filename)
}

var absCases []struct {
src, filename string
}
var absPaths []test
if runtime.GOOS == "windows" {
absCases = append(absCases, struct{ src, filename string }{
"//line c:\\bar:1\n x", "c:\\bar",
})
absPaths = []test{
{"//line c:\\bar:1\n", "c:\\bar"},
}
} else {
absCases = append(absCases,
struct{ src, filename string }{"//line /abs/foo:1\n x", "/abs/foo"},
struct{ src, filename string }{"//line /src/a/a.go:1\n x", "/src/a/a.go"},
)
}
for _, test := range absCases {
check(test.src, test.filename)
absPaths = []test{
{"//line /abs/foo:1\n", "/abs/foo"},
{"//line /src/a/a.go:1\n", "/src/a/a.go"},
}
}
}

func TestLineDirectivesPaths(t *testing.T) {
const valid = "syntax error: package statement must be first"
const filename = "directives.go"

type tc struct {
src string
filename string
line uint
}
var cases []tc
cases = []tc{
{"//line C:foo:123\n", "C:foo", 123},
{"//line /src/a/a.go:123\n foo", filepath.Clean("/src/a/a.go"), 123},
{"/*line C:foo:123*/", "C:foo", 123},
{"/*line /src/a/a.go:123*/ foo", filepath.Clean("/src/a/a.go"), 123},
{"//line foo/../bar:1\n x", "bar", 1},
}
for _, test := range cases {
for _, test := range append(relPaths, absPaths...) {
base := NewFileBase(filename)
_, err := Parse(base, strings.NewReader(test.src), nil, nil, 0)
if err == nil {
t.Errorf("%s: no error reported", test.src)
continue
}
perr, ok := err.(Error)
if !ok {
t.Errorf("%s: got %v; want parser error", test.src, err)
continue
}
if perr.Msg != valid {
t.Errorf("%s: got msg = %q; want %q", test.src, perr.Msg, valid)
continue
pkg, err := Parse(base, strings.NewReader(test.src+"package p"), nil, nil, 0)
if err != nil {
t.Error(err)
}
if got := perr.Pos.RelFilename(); got != test.filename {
if got := pkg.Pos().RelFilename(); got != test.filename {
t.Errorf("%s: got filename = %q; want %q", test.src, got, test.filename)
}
if got := perr.Pos.RelLine(); got != test.line {
t.Errorf("%s: got line = %d; want %d", test.src, got, test.line)
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/cmd/compile/internal/types2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ type Instance struct {
Type Type
}

func (inst Instance) String() string {
return fmt.Sprintf("%s%s", inst.TypeArgs, inst.Type)
}

// An Initializer describes a package-level variable, or a list of variables in case
// of a multi-valued initialization expression, and the corresponding initialization
// expression.
Expand Down
28 changes: 28 additions & 0 deletions src/cmd/compile/internal/types2/typelists.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package types2

import "bytes"

// TypeParamList holds a list of type parameters.
type TypeParamList struct{ tparams []*TypeParam }

Expand All @@ -24,6 +26,19 @@ func (l *TypeParamList) list() []*TypeParam {
return l.tparams
}

func (l *TypeParamList) String() string {
var buf bytes.Buffer
buf.WriteByte('[')
for i, tparam := range l.tparams {
if i > 0 {
buf.WriteString(", ")
}
WriteType(&buf, tparam, nil)
}
buf.WriteByte(']')
return buf.String()
}

// TypeList holds a list of types.
type TypeList struct{ types []Type }

Expand Down Expand Up @@ -52,6 +67,19 @@ func (l *TypeList) list() []Type {
return l.types
}

func (l *TypeList) String() string {
var buf bytes.Buffer
buf.WriteByte('[')
for i, t := range l.types {
if i > 0 {
buf.WriteString(", ")
}
WriteType(&buf, t, nil)
}
buf.WriteByte(']')
return buf.String()
}

// ----------------------------------------------------------------------------
// Implementation

Expand Down
1 change: 1 addition & 0 deletions src/cmd/dist/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ func runInstall(pkg string, ch chan struct{}) {
"-D", "GOARCH_" + goarch,
"-D", "GOOS_GOARCH_" + goos + "_" + goarch,
"-p", pkg,
"-std",
}
if goarch == "mips" || goarch == "mipsle" {
// Define GOMIPS_value from gomips.
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ require (
golang.org/x/mod v0.36.1-0.20260513122029-343ee60345a1
golang.org/x/sync v0.20.0
golang.org/x/sys v0.44.0
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa
golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6
golang.org/x/term v0.39.0
golang.org/x/tools v0.44.1-0.20260414062052-55fb96ff894f
golang.org/x/tools v0.45.1-0.20260520205638-b38156a7a9f5
)

require (
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ=
golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa h1:efT73AJZfAAUV7SOip6pWGkwJDzIGiKBZGVzHYa+ve4=
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa/go.mod h1:kHjTxDEnAu6/Nl9lDkzjWpR+bmKfxeiRuSDlsMb70gE=
golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6 h1:HjU6IWBiAgRIdAJ9/y1rwCn+UELEmwV+VsTLzj/W4sE=
golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6/go.mod h1:Eqhaxk/wZsWEH8CRxLwj6xzEJbz7k1EFGqx7nyCoabE=
golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY=
golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/tools v0.44.1-0.20260414062052-55fb96ff894f h1:OsDhJTPRMdqueEUhZ6K1sdC07K6rj9i4RYTQGF6zSHA=
golang.org/x/tools v0.44.1-0.20260414062052-55fb96ff894f/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI=
golang.org/x/tools v0.45.1-0.20260520205638-b38156a7a9f5 h1:jqdNq3qAaJT9zQL5Cbq/TRYEdoLZmystI2hoCyAsAuw=
golang.org/x/tools v0.45.1-0.20260520205638-b38156a7a9f5/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0=
rsc.io/markdown v0.0.0-20240306144322-0bf8f97ee8ef h1:mqLYrXCXYEZOop9/Dbo6RPX11539nwiCNBb1icVPmw8=
rsc.io/markdown v0.0.0-20240306144322-0bf8f97ee8ef/go.mod h1:8xcPgWmwlZONN1D9bjxtHEjrUtSEa3fakVF8iaewYKQ=
3 changes: 3 additions & 0 deletions src/cmd/link/internal/ld/dwarf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,9 @@ func TestAbstractOriginSanity(t *testing.T) {
t.Skip("skipping test in short mode.")
}

// TODO(go.dev/issue/79547): -l=4 builds are temporarily broken.
t.Skip("-l=4 builds are currently broken because they introduce an allocation in runtime.printfloat64")

mustHaveDWARF(t)
abstractOriginSanity(t, "testdata/httptest", OptAllInl4)
}
Expand Down
Loading
Loading