Repository: google/go-cloud
Pull request #3467 (2024-08-13 20:23:46)

all: update to go version 1.23


Patch:
diff --git a/aws/aws.go b/aws/aws.go
index 55dc3864..21d4ec5a 100644
--- a/aws/aws.go
+++ b/aws/aws.go
@@ -148,15 +148,14 @@ func NewSessionFromURLParams(q url.Values) (*session.Session, url.Values, error)
 //
 // "awssdk=v1" will force V1.
 // "awssdk=v2" will force V2.
-// No "awssdk" parameter (or any other value) will return the default, currently V1.
-// Note that the default may change in the future.
+// No "awssdk" parameter (or any other value) will return the default, currently V2.
 func UseV2(q url.Values) bool {
 	if values, ok := q["awssdk"]; ok {
-		if values[0] == "v2" || values[0] == "V2" {
-			return true
+		if values[0] == "v1" || values[0] == "V1" {
+			return false
 		}
 	}
-	return false
+	return true
 }
 
 // NewDefaultV2Config returns a aws.Config for AWS SDK v2, using the default options.


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 014dc75e..c17e9a33 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -24,13 +24,10 @@ jobs:
         os: [ubuntu-latest, macos-latest]
         # When updating this, make sure to also update the
         # latest_go_version variable in internal/testing/runchecks.sh.
-        # Restore previous version when go 1.23 is out; go 1.22
-        # purposefully broke some backwards compatibility that breaks
-        # the golden tests, so I've disabled them for now.
-        go-version: [1.22.x]
-          #include:
-          #- go-version: 1.21.x
-          #os: ubuntu-latest
+        go-version: [1.23.x]
+        include:
+          - go-version: 1.22.x
+            os: ubuntu-latest
 
     runs-on: ${{ matrix.os }}
     steps:
diff --git a/aws/aws_test.go b/aws/aws_test.go
index 3a3d602d..5d04dae7 100644
--- a/aws/aws_test.go
+++ b/aws/aws_test.go
@@ -108,14 +108,17 @@ func TestUseV2(t *testing.T) {
 		{
 			name:  "No overrides",
 			query: url.Values{},
+			want:  true,
 		},
 		{
 			name:  "unused param",
 			query: url.Values{"foo": {"bar"}},
+			want:  true,
 		},
 		{
 			name:  "force v1",
 			query: url.Values{"awssdk": {"v1"}},
+			want:  false,
 		},
 		{
 			name:  "force v1 cap",
diff --git a/blob/s3blob/s3blob_test.go b/blob/s3blob/s3blob_test.go
index d23d1a4c..f5a81267 100644
--- a/blob/s3blob/s3blob_test.go
+++ b/blob/s3blob/s3blob_test.go
@@ -469,9 +469,9 @@ func TestOpenBucketFromURL(t *testing.T) {
 		// OK, setting region.
 		{"s3://mybucket?region=us-west1", false},
 		// OK, setting profile.
-		{"s3://mybucket?profile=main", false},
+		{"s3://mybucket?awssdk=v1&profile=main", false},
 		// OK, setting both profile and region.
-		{"s3://mybucket?profile=main&region=us-west-1", false},
+		{"s3://mybucket?awssdk=v1&profile=main&region=us-west-1", false},
 		// OK, use V2.
 		{"s3://mybucket?awssdk=v2", false},
 		// OK, use KMS Server Side Encryption
diff --git a/internal/testing/runchecks.sh b/internal/testing/runchecks.sh
index 73f71358..49ab714b 100755
--- a/internal/testing/runchecks.sh
+++ b/internal/testing/runchecks.sh
@@ -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\.22* ]]; then
+if [[ $(go version) == *go1\.23* ]]; then
   latest_go_version=1
 fi