Skip to content

Commit cbd7084

Browse files
authored
all: update to go 1.24 (#3522)
1 parent af15ad4 commit cbd7084

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
os: [ubuntu-latest, macos-latest]
2525
# When updating this, make sure to also update the
2626
# latest_go_version variable in internal/testing/runchecks.sh.
27-
go-version: [1.23.x]
27+
go-version: [1.24.x]
2828
include:
29-
- go-version: 1.22.x
29+
- go-version: 1.23.x
3030
os: ubuntu-latest
3131

3232
runs-on: ${{ matrix.os }}

internal/testing/runchecks.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ rootdir="$(pwd)"
4444
# new Go version. Some checks below we only run
4545
# for the latest Go version.
4646
latest_go_version=0
47-
if [[ $(go version) == *go1\.23* ]]; then
47+
if [[ $(go version) == *go1\.24* ]]; then
4848
latest_go_version=1
4949
fi
5050

internal/website/content/howto/server/_index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The Go CDK Server constructor takes an `http.Handler` and an `Options` struct.
1616
The simplest way to start the server is to use `http.DefaultServeMux` and
1717
pass `nil` for the options.
1818

19-
{{< goexample src="gocloud.dev/server.ExampleServer_New" >}}
19+
{{< goexample src="gocloud.dev/server.ExampleServer" >}}
2020

2121
### Adding a request logger
2222

@@ -26,7 +26,7 @@ The example is shown with the Go CDK [`requestlog`](https://godoc.org/gocloud.de
2626
To get logs in the Stackdriver JSON format, use `NewStackdriverLogger` in place
2727
of `NewNCSALogger`.
2828

29-
{{< goexample src="gocloud.dev/server.ExampleServer_RequestLogger" >}}
29+
{{< goexample src="gocloud.dev/server.ExampleServer_withRequestLogger" >}}
3030

3131
### Adding health checks
3232

@@ -64,7 +64,7 @@ func (h *customHealthCheck) CheckHealth() error {
6464
}
6565
```
6666

67-
{{< goexample src="gocloud.dev/server.ExampleServer_HealthChecks" >}}
67+
{{< goexample src="gocloud.dev/server.ExampleServer_withHealthChecks" >}}
6868

6969
## Other Usage Samples
7070

internal/website/data/examples.json

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pubsub/azuresb/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func Example_openSubscriptionFromURL() {
119119
defer subscription.Shutdown(ctx)
120120
}
121121

122-
func Example_OpenSubscription_inReceiveAndDeleteMode() {
122+
func ExampleOpenSubscription_inReceiveAndDeleteMode() {
123123
ctx := context.Background()
124124

125125
// Change these as needed for your application.

pubsub/gcppubsub/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func ExampleOpenSubscription() {
109109
defer subscription.Shutdown(ctx)
110110
}
111111

112-
func ExampleExtendingAckDeadline() {
112+
func Example_extendingAckDeadline() {
113113
ctx := context.Background()
114114

115115
// Construct a *pubsub.Subscription, in this example using a URL.

pubsub/natspubsub/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func ExampleOpenSubscription() {
6363
defer subscription.Shutdown(ctx)
6464
}
6565

66-
func ExampleOpenQueueSubscription() {
66+
func ExampleOpenSubscription_queue() {
6767
// PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.
6868
// PRAGMA: On gocloud.dev, hide lines until the next blank line.
6969
ctx := context.Background()

pubsub/natspubsub/nats_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func TestInteropWithDirectNATS(t *testing.T) {
237237
}
238238
m, err := nsub.NextMsgWithContext(ctx)
239239
if err != nil {
240-
t.Fatalf(err.Error())
240+
t.Fatal(err.Error())
241241
}
242242
if !bytes.Equal(m.Data, body) {
243243
t.Fatalf("Data did not match. %q vs %q\n", m.Data, body)
@@ -291,7 +291,7 @@ func TestInteropWithDirectNATSV2(t *testing.T) {
291291
}
292292
m, err := nsub.NextMsgWithContext(ctx)
293293
if err != nil {
294-
t.Fatalf(err.Error())
294+
t.Fatal(err.Error())
295295
}
296296
if !bytes.Equal(m.Data, body) {
297297
t.Fatalf("Data did not match. %q vs %q\n", m.Data, body)

server/example_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
"gocloud.dev/server/requestlog"
3232
)
3333

34-
func ExampleServer_New() {
34+
func ExampleServer() {
3535
// PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.
3636

3737
// Use the constructor function to create the server.
@@ -48,7 +48,7 @@ func ExampleServer_New() {
4848
}
4949
}
5050

51-
func ExampleServer_RequestLogger() {
51+
func ExampleServer_withRequestLogger() {
5252
// PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.
5353

5454
// Create a logger, and assign it to the RequestLogger field of a
@@ -92,7 +92,7 @@ func (h *customHealthCheck) CheckHealth() error {
9292
return nil
9393
}
9494

95-
func ExampleServer_HealthChecks() {
95+
func ExampleServer_withHealthChecks() {
9696
// PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.
9797

9898
// Create a health.Checker from the type we defined for our application.

0 commit comments

Comments
 (0)