Skip to content

Commit 8b2902f

Browse files
dmitshurgopherbot
authored andcommitted
_content/doc/go1.24: add release date
The month and year alone should be enough granularity for the purpose of the introduction to Go 1.24. In this case, February 2025 refers to when the go1.24.0 major release came out, but we released pre-release versions even before then. Link to the dedicated release history page where full details and exact dates can be found. Add a test so we don't forget. For golang/go#68545. Fixes golang/go#54170. Change-Id: Ia2bceee9208094b0623add6696585592f4399893 Reviewed-on: https://go-review.googlesource.com/c/website/+/654015 Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent a04b3c9 commit 8b2902f

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

_content/doc/go1.24.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ template: false
99

1010
## Introduction to Go 1.24 {#introduction}
1111

12-
The latest Go release, version 1.24, arrives six months after [Go 1.23](/doc/go1.23).
12+
The latest Go release, version 1.24,
13+
arrives in [February 2025](/doc/devel/release#go1.24.0),
14+
six months after [Go 1.23](/doc/go1.23).
1315
Most of its changes are in the implementation of the toolchain, runtime, and libraries.
1416
As always, the release maintains the Go 1 [promise of compatibility](/doc/go1compat).
1517
We expect almost all Go programs to continue to compile and run as before.

cmd/golangorg/server_test.go

+30
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"bytes"
99
"fmt"
1010
"go/build"
11+
"io/fs"
1112
"net/http/httptest"
1213
"net/url"
1314
"os"
@@ -18,6 +19,8 @@ import (
1819
"testing"
1920

2021
"golang.org/x/net/html"
22+
"golang.org/x/website"
23+
"golang.org/x/website/internal/history"
2124
"golang.org/x/website/internal/webtest"
2225
)
2326

@@ -319,3 +322,30 @@ func findAttr(n *html.Node, name string) string {
319322
}
320323
return ""
321324
}
325+
326+
// TestReleaseNotesHaveDate tests that release notes
327+
// include the date of the corresponding major release.
328+
// See go.dev/issue/54170.
329+
func TestReleaseNotesHaveDate(t *testing.T) {
330+
for _, r := range history.Majors {
331+
if r.Version.Before(history.Version{X: 1, Y: 24}) {
332+
// No dates in release notes before Go 1.24.
333+
break
334+
}
335+
maj := r.Version.MajorPrefix()
336+
t.Run(maj, func(t *testing.T) {
337+
name := fmt.Sprintf("doc/go%s.md", maj)
338+
have, err := fs.ReadFile(website.Content(), name)
339+
if err != nil {
340+
t.Fatalf("Go %s release notes (_content/%s) can't be read: %v", maj, name, err)
341+
}
342+
want := fmt.Sprintf("[%s %d](/doc/devel/release#go%s)", r.Date.Month, r.Date.Year, r.Version)
343+
if r.Future {
344+
want = fmt.Sprintf("%s %d", r.Date.Month, r.Date.Year)
345+
}
346+
if !strings.Contains(string(have), want) {
347+
t.Errorf("Go %s release notes (_content/%s) doesn't contain the release date and link to release history page %q", maj, name, want)
348+
}
349+
})
350+
}
351+
}

0 commit comments

Comments
 (0)