Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 doc/next/1-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<style>
main ul li { margin: 0.5em 0; }
</style>

## DRAFT RELEASE NOTES — Introduction to Go 1.28 {#introduction}

**Go 1.28 is not yet released. These are work-in-progress release notes.
Go 1.28 is expected to be released in February 2027.**
3 changes: 3 additions & 0 deletions doc/next/2-language.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Changes to the language {#language}


6 changes: 6 additions & 0 deletions doc/next/3-tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Tools {#tools}

### Go command {#go-command}

### Cgo {#cgo}

1 change: 1 addition & 0 deletions doc/next/4-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Runtime {#runtime}
7 changes: 7 additions & 0 deletions doc/next/5-toolchain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Compiler {#compiler}

## Assembler {#assembler}

## Linker {#linker}


2 changes: 2 additions & 0 deletions doc/next/6-stdlib/0-heading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Standard library {#library}

1 change: 1 addition & 0 deletions doc/next/6-stdlib/99-minor/0-heading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
### Minor changes to the library {#minor_library_changes}
1 change: 1 addition & 0 deletions doc/next/6-stdlib/99-minor/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API changes and other small changes to the standard library go here.
2 changes: 2 additions & 0 deletions doc/next/7-ports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Ports {#ports}

2 changes: 1 addition & 1 deletion src/cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
golang.org/x/sys v0.45.0
golang.org/x/telemetry v0.0.0-20260519152614-eab6ae52b5e2
golang.org/x/term v0.43.0
golang.org/x/tools v0.45.1-0.20260710204130-3cdf838841de
golang.org/x/tools v0.45.1-0.20260714184632-28657d66a087
)

require (
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
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.45.1-0.20260710204130-3cdf838841de h1:DAFpdvgVicTKCGgv6rwHZv1Nk1fRPM1r/yyTbH9XbaA=
golang.org/x/tools v0.45.1-0.20260710204130-3cdf838841de/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0=
golang.org/x/tools v0.45.1-0.20260714184632-28657d66a087 h1:OBacbO7Pun0pcIzRzkngMhqkKWPEgHQP6EZmltKDw4o=
golang.org/x/tools v0.45.1-0.20260714184632-28657d66a087/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=

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 27 additions & 13 deletions src/cmd/vendor/golang.org/x/tools/internal/typesinternal/toonew.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cmd/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ golang.org/x/text/internal/tag
golang.org/x/text/language
golang.org/x/text/transform
golang.org/x/text/unicode/norm
# golang.org/x/tools v0.45.1-0.20260710204130-3cdf838841de
# golang.org/x/tools v0.45.1-0.20260714184632-28657d66a087
## explicit; go 1.25.0
golang.org/x/tools/cmd/bisect
golang.org/x/tools/cover
Expand Down
29 changes: 29 additions & 0 deletions src/encoding/json/v2/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"bytes"
"errors"
"fmt"
"io"
"log"
"net/http"
"net/netip"
Expand Down Expand Up @@ -559,3 +560,31 @@ func ExampleWithUnmarshalers_recordOffsets() {
// Output:
// 3:3: source and destination must both be specified
}

// UnmarshalDecode can be used to unmarshal a stream of whitespace-delimited
// JSON values.
func ExampleUnmarshalDecode_stream() {
const jsonStream = `
{"Name": "Platypus", "Order": "Monotremata"}
{"Name": "Quoll", "Order": "Dasyuromorphia"}
{"Name": "Gopher", "Order": "Rodentia"}
`
type Animal struct {
Name string
Order string
}
dec := jsontext.NewDecoder(strings.NewReader(jsonStream))
for {
var a Animal
if err := json.UnmarshalDecode(dec, &a); err == io.EOF {
break
} else if err != nil {
log.Fatal(err)
}
fmt.Printf("%s: %s\n", a.Name, a.Order)
}
// Output:
// Platypus: Monotremata
// Quoll: Dasyuromorphia
// Gopher: Rodentia
}
8 changes: 6 additions & 2 deletions src/encoding/pem/pem.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,12 @@ func Encode(out io.Writer, b *Block) error {
if _, err := b64.Write(b.Bytes); err != nil {
return err
}
b64.Close()
breaker.Close()
if err := b64.Close(); err != nil {
return err
}
if err := breaker.Close(); err != nil {
return err
}

if _, err := out.Write(pemEnd[1:]); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion src/internal/goversion/goversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ package goversion
//
// It should be updated at the start of each development cycle to be
// the version of the next Go 1.x release. See go.dev/issue/40705.
const Version = 27
const Version = 28
2 changes: 1 addition & 1 deletion src/net/http/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ func testClientCallsCloseOnlyOnce(t *testing.T, mode testMode) {
// Issue occurred non-deterministically: needed to occur after a successful
// write (into TCP buffer) but before end of body.
for i := 0; i < 50 && !t.Failed(); i++ {
body := &issue40382Body{t: t, n: 300000}
body := &issue40382Body{t: t, n: 256 << 10} // maxPostHandlerReadBytes large
req, err := NewRequest(MethodPost, cst.ts.URL, body)
if err != nil {
t.Fatal(err)
Expand Down
6 changes: 6 additions & 0 deletions src/net/http/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,12 @@ func toHTTPError(err error) (msg string, httpStatus int) {
// localRedirect gives a Moved Permanently response.
// It does not convert relative paths to absolute paths like Redirect does.
func localRedirect(w ResponseWriter, r *Request, newPath string) {
// There is no reliable way for us to redirect correctly when the path has
// escaped slashes, since StripPrefix might be in use. Just return 404.
if p := r.URL.EscapedPath(); strings.Contains(p, "%2f") || strings.Contains(p, "%2F") {
NotFound(w, r)
return
}
if q := r.URL.RawQuery; q != "" {
newPath += "?" + q
}
Expand Down
18 changes: 15 additions & 3 deletions src/net/http/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,19 @@ func TestServeContentWithEmptyContentIgnoreRanges(t *testing.T) {

var fsRedirectTestData = []struct {
original, redirect string
status int
}{
{"/test/index.html", "/test/"},
{"/test/testdata", "/test/testdata/"},
{"/test/testdata/file/", "/test/testdata/file"},
{"/test/index.html", "/test/", 200},
{"/test/testdata", "/test/testdata/", 200},
{"/test/testdata/file/", "/test/testdata/file", 200},
// Redirect attempts for path with escaped slashes should result in 404.
// However, escaped paths are okay if they do not trigger a redirect.
// See https://go.dev/issue/80289.
{"/test%2ftestdata", "/test/testdata", 404},
{"/test/testdata%2ffile/", "/test/testdata/file/", 404},
{"/test/testdata%2Findex.html", "/test/testdata/index.html", 404},
{"/test/testdata%2ffile", "/test/testdata/file", 200},
{"/test/testdata%2F", "/test/testdata/", 200},
}

func TestFSRedirect(t *testing.T) { run(t, testFSRedirect) }
Expand All @@ -288,6 +297,9 @@ func testFSRedirect(t *testing.T, mode testMode) {
if g, e := res.Request.URL.Path, data.redirect; g != e {
t.Errorf("redirect from %s: got %s, want %s", data.original, g, e)
}
if res.StatusCode != data.status {
t.Errorf("redirect from %s: got status %d, want %d", data.original, res.StatusCode, data.status)
}
}
}

Expand Down
Loading
Loading