Skip to content

Commit

Permalink
all: update to go 1.24 (#3522)
Browse files Browse the repository at this point in the history
  • Loading branch information
vangent authored Feb 12, 2025
1 parent af15ad4 commit cbd7084
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
os: [ubuntu-latest, macos-latest]
# When updating this, make sure to also update the
# latest_go_version variable in internal/testing/runchecks.sh.
go-version: [1.23.x]
go-version: [1.24.x]
include:
- go-version: 1.22.x
- go-version: 1.23.x
os: ubuntu-latest

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion internal/testing/runchecks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ rootdir="$(pwd)"
# new Go version. Some checks below we only run
# for the latest Go version.
latest_go_version=0
if [[ $(go version) == *go1\.23* ]]; then
if [[ $(go version) == *go1\.24* ]]; then
latest_go_version=1
fi

Expand Down
6 changes: 3 additions & 3 deletions internal/website/content/howto/server/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The Go CDK Server constructor takes an `http.Handler` and an `Options` struct.
The simplest way to start the server is to use `http.DefaultServeMux` and
pass `nil` for the options.

{{< goexample src="gocloud.dev/server.ExampleServer_New" >}}
{{< goexample src="gocloud.dev/server.ExampleServer" >}}

### Adding a request logger

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

{{< goexample src="gocloud.dev/server.ExampleServer_RequestLogger" >}}
{{< goexample src="gocloud.dev/server.ExampleServer_withRequestLogger" >}}

### Adding health checks

Expand Down Expand Up @@ -64,7 +64,7 @@ func (h *customHealthCheck) CheckHealth() error {
}
```

{{< goexample src="gocloud.dev/server.ExampleServer_HealthChecks" >}}
{{< goexample src="gocloud.dev/server.ExampleServer_withHealthChecks" >}}

## Other Usage Samples

Expand Down
20 changes: 10 additions & 10 deletions internal/website/data/examples.json

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

2 changes: 1 addition & 1 deletion pubsub/azuresb/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func Example_openSubscriptionFromURL() {
defer subscription.Shutdown(ctx)
}

func Example_OpenSubscription_inReceiveAndDeleteMode() {
func ExampleOpenSubscription_inReceiveAndDeleteMode() {
ctx := context.Background()

// Change these as needed for your application.
Expand Down
2 changes: 1 addition & 1 deletion pubsub/gcppubsub/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func ExampleOpenSubscription() {
defer subscription.Shutdown(ctx)
}

func ExampleExtendingAckDeadline() {
func Example_extendingAckDeadline() {
ctx := context.Background()

// Construct a *pubsub.Subscription, in this example using a URL.
Expand Down
2 changes: 1 addition & 1 deletion pubsub/natspubsub/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func ExampleOpenSubscription() {
defer subscription.Shutdown(ctx)
}

func ExampleOpenQueueSubscription() {
func ExampleOpenSubscription_queue() {
// PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.
// PRAGMA: On gocloud.dev, hide lines until the next blank line.
ctx := context.Background()
Expand Down
4 changes: 2 additions & 2 deletions pubsub/natspubsub/nats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func TestInteropWithDirectNATS(t *testing.T) {
}
m, err := nsub.NextMsgWithContext(ctx)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
if !bytes.Equal(m.Data, body) {
t.Fatalf("Data did not match. %q vs %q\n", m.Data, body)
Expand Down Expand Up @@ -291,7 +291,7 @@ func TestInteropWithDirectNATSV2(t *testing.T) {
}
m, err := nsub.NextMsgWithContext(ctx)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
if !bytes.Equal(m.Data, body) {
t.Fatalf("Data did not match. %q vs %q\n", m.Data, body)
Expand Down
6 changes: 3 additions & 3 deletions server/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"gocloud.dev/server/requestlog"
)

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

// Use the constructor function to create the server.
Expand All @@ -48,7 +48,7 @@ func ExampleServer_New() {
}
}

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

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

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

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

0 comments on commit cbd7084

Please sign in to comment.