From f894aa7fe60a7ad7189ad1f5e2508409a0083059 Mon Sep 17 00:00:00 2001 From: Yash Agrawal Date: Mon, 24 Feb 2025 16:11:27 +0530 Subject: [PATCH 1/5] update helloworld go code samples --- appengine/go11x/helloworld/go.mod | 3 --- appengine/{go11x => go12x}/helloworld/app.yaml | 2 +- appengine/go12x/helloworld/go.mod | 3 +++ appengine/{go11x => go12x}/helloworld/go.sum | 0 appengine/{go11x => go12x}/helloworld/helloworld.go | 0 appengine/{go11x => go12x}/helloworld/helloworld_test.go | 0 appengine_flexible/helloworld/app.yaml | 2 +- appengine_flexible/helloworld/go.mod | 2 +- functions/functionsv2/helloworld/go.mod | 2 +- run/helloworld/Dockerfile | 2 +- run/helloworld/go.mod | 2 +- 11 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 appengine/go11x/helloworld/go.mod rename appengine/{go11x => go12x}/helloworld/app.yaml (97%) create mode 100644 appengine/go12x/helloworld/go.mod rename appengine/{go11x => go12x}/helloworld/go.sum (100%) rename appengine/{go11x => go12x}/helloworld/helloworld.go (100%) rename appengine/{go11x => go12x}/helloworld/helloworld_test.go (100%) diff --git a/appengine/go11x/helloworld/go.mod b/appengine/go11x/helloworld/go.mod deleted file mode 100644 index 8797aa1fc6..0000000000 --- a/appengine/go11x/helloworld/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/GoogleCloudPlatform/appengine/go11x/helloworld - -go 1.22.0 diff --git a/appengine/go11x/helloworld/app.yaml b/appengine/go12x/helloworld/app.yaml similarity index 97% rename from appengine/go11x/helloworld/app.yaml rename to appengine/go12x/helloworld/app.yaml index dd0fb55cb0..2646ed76fe 100644 --- a/appengine/go11x/helloworld/app.yaml +++ b/appengine/go12x/helloworld/app.yaml @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: go122 +runtime: go123 diff --git a/appengine/go12x/helloworld/go.mod b/appengine/go12x/helloworld/go.mod new file mode 100644 index 0000000000..dcfee46a84 --- /dev/null +++ b/appengine/go12x/helloworld/go.mod @@ -0,0 +1,3 @@ +module github.com/GoogleCloudPlatform/appengine/go12x/helloworld + +go 1.23 diff --git a/appengine/go11x/helloworld/go.sum b/appengine/go12x/helloworld/go.sum similarity index 100% rename from appengine/go11x/helloworld/go.sum rename to appengine/go12x/helloworld/go.sum diff --git a/appengine/go11x/helloworld/helloworld.go b/appengine/go12x/helloworld/helloworld.go similarity index 100% rename from appengine/go11x/helloworld/helloworld.go rename to appengine/go12x/helloworld/helloworld.go diff --git a/appengine/go11x/helloworld/helloworld_test.go b/appengine/go12x/helloworld/helloworld_test.go similarity index 100% rename from appengine/go11x/helloworld/helloworld_test.go rename to appengine/go12x/helloworld/helloworld_test.go diff --git a/appengine_flexible/helloworld/app.yaml b/appengine_flexible/helloworld/app.yaml index 7110457587..0e35a0ccd8 100644 --- a/appengine_flexible/helloworld/app.yaml +++ b/appengine_flexible/helloworld/app.yaml @@ -17,7 +17,7 @@ env: flex runtime_config: operating_system: 'ubuntu22' - runtime_version: 1.21 + runtime_version: 1.23 # This sample incurs costs to run on the App Engine flexible environment. # The settings below are to reduce costs during testing and are not appropriate # for production use. For more information, see: diff --git a/appengine_flexible/helloworld/go.mod b/appengine_flexible/helloworld/go.mod index 8bd6f72407..13e8006082 100644 --- a/appengine_flexible/helloworld/go.mod +++ b/appengine_flexible/helloworld/go.mod @@ -1,3 +1,3 @@ module github.com/GoogleCloudPlatform/appengine_flexible/helloworld -go 1.22.0 +go 1.23 diff --git a/functions/functionsv2/helloworld/go.mod b/functions/functionsv2/helloworld/go.mod index aed6f93e91..d73e59ff8e 100644 --- a/functions/functionsv2/helloworld/go.mod +++ b/functions/functionsv2/helloworld/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/golang-samples/functions/functionsv2/helloworld -go 1.22.0 +go 1.23 require github.com/GoogleCloudPlatform/functions-framework-go v1.8.1 diff --git a/run/helloworld/Dockerfile b/run/helloworld/Dockerfile index ce8668a99d..fa99feb195 100644 --- a/run/helloworld/Dockerfile +++ b/run/helloworld/Dockerfile @@ -17,7 +17,7 @@ # Use the official Go image to create a binary. # This is based on Debian and sets the GOPATH to /go. # https://hub.docker.com/_/golang -FROM golang:1.21-bookworm as builder +FROM golang:1.23 as builder # Create and change to the app directory. WORKDIR /app diff --git a/run/helloworld/go.mod b/run/helloworld/go.mod index 56245c2687..c2b1ecdccc 100644 --- a/run/helloworld/go.mod +++ b/run/helloworld/go.mod @@ -1,3 +1,3 @@ module github.com/GoogleCloudPlatform/golang-samples/run/helloworld -go 1.22.0 +go 1.23 From 48ad44fc1b9cb9127a5ae6def2d7f0b322dd5f1c Mon Sep 17 00:00:00 2001 From: Yash Agrawal Date: Wed, 26 Feb 2025 16:10:24 +0530 Subject: [PATCH 2/5] update go.work --- go.work | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go.work b/go.work index e289cefdb3..d0b6f6d543 100644 --- a/go.work +++ b/go.work @@ -1,15 +1,15 @@ -go 1.22.7 +go 1.23 -toolchain go1.23.4 +toolchain go1.23.6 use ( . ./aiplatform ./appengine ./appengine/go11x/cloudsql - ./appengine/go11x/helloworld ./appengine/go11x/tasks/handle_task ./appengine/go11x/warmup + ./appengine/go12x/helloworld ./appengine_flexible/analytics ./appengine_flexible/datastore ./appengine_flexible/go115_and_earlier From 7c79abf192fd54f85dddeaa04b8229f51a6dd49f Mon Sep 17 00:00:00 2001 From: yashag002 Date: Wed, 26 Feb 2025 16:56:17 +0530 Subject: [PATCH 3/5] Update helloworld.go to include product prefixes --- appengine/go12x/helloworld/helloworld.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appengine/go12x/helloworld/helloworld.go b/appengine/go12x/helloworld/helloworld.go index 716d5e80df..19ec744b24 100644 --- a/appengine/go12x/helloworld/helloworld.go +++ b/appengine/go12x/helloworld/helloworld.go @@ -27,12 +27,12 @@ import ( // [END gae_go111_import] -// [START main_func] +// [START appengine_main_func] func main() { http.HandleFunc("/", indexHandler) - // [START setting_port] + // [START appengine_setting_port] port := os.Getenv("PORT") if port == "" { port = "8080" @@ -48,7 +48,7 @@ func main() { // [END main_func] -// [START indexHandler] +// [START appengine_indexHandler] // indexHandler responds to requests with our greeting. func indexHandler(w http.ResponseWriter, r *http.Request) { From 7ea7194e2d751f27bd5eae9147bcf5fb890092d4 Mon Sep 17 00:00:00 2001 From: yashag002 Date: Wed, 26 Feb 2025 17:07:11 +0530 Subject: [PATCH 4/5] Update helloworld.go --- appengine/go12x/helloworld/helloworld.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/appengine/go12x/helloworld/helloworld.go b/appengine/go12x/helloworld/helloworld.go index 19ec744b24..9c4400a5ec 100644 --- a/appengine/go12x/helloworld/helloworld.go +++ b/appengine/go12x/helloworld/helloworld.go @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -// [START gae_go111_app] +// [START gae_go12x_app] // Sample helloworld is an App Engine app. package main -// [START gae_go111_import] +// [START gae_go12x_import] import ( "fmt" "log" @@ -25,14 +25,14 @@ import ( "os" ) -// [END gae_go111_import] +// [END gae_go12x_import] -// [START appengine_main_func] +// [START gae_main_func] func main() { http.HandleFunc("/", indexHandler) - // [START appengine_setting_port] + // [START gae_setting_port] port := os.Getenv("PORT") if port == "" { port = "8080" @@ -43,12 +43,12 @@ func main() { if err := http.ListenAndServe(":"+port, nil); err != nil { log.Fatal(err) } - // [END setting_port] + // [END gae_setting_port] } -// [END main_func] +// [END gae_main_func] -// [START appengine_indexHandler] +// [START gae_indexHandler] // indexHandler responds to requests with our greeting. func indexHandler(w http.ResponseWriter, r *http.Request) { @@ -59,5 +59,5 @@ func indexHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello, World!") } -// [END indexHandler] -// [END gae_go111_app] +// [END gae_indexHandler] +// [END gae_go12x_app] From 028f1bb8b0f2020cf048dc4d75537d55d7cc1b3c Mon Sep 17 00:00:00 2001 From: yashag002 Date: Fri, 28 Feb 2025 05:13:53 +0000 Subject: [PATCH 5/5] update go.mod --- appengine/go12x/helloworld/go.mod | 2 +- appengine_flexible/helloworld/go.mod | 2 +- functions/functionsv2/helloworld/go.mod | 2 +- run/helloworld/go.mod | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appengine/go12x/helloworld/go.mod b/appengine/go12x/helloworld/go.mod index dcfee46a84..82c82cdab1 100644 --- a/appengine/go12x/helloworld/go.mod +++ b/appengine/go12x/helloworld/go.mod @@ -1,3 +1,3 @@ module github.com/GoogleCloudPlatform/appengine/go12x/helloworld -go 1.23 +go 1.23.0 diff --git a/appengine_flexible/helloworld/go.mod b/appengine_flexible/helloworld/go.mod index 13e8006082..8439ef5557 100644 --- a/appengine_flexible/helloworld/go.mod +++ b/appengine_flexible/helloworld/go.mod @@ -1,3 +1,3 @@ module github.com/GoogleCloudPlatform/appengine_flexible/helloworld -go 1.23 +go 1.23.0 diff --git a/functions/functionsv2/helloworld/go.mod b/functions/functionsv2/helloworld/go.mod index d73e59ff8e..919807d16f 100644 --- a/functions/functionsv2/helloworld/go.mod +++ b/functions/functionsv2/helloworld/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/golang-samples/functions/functionsv2/helloworld -go 1.23 +go 1.23.0 require github.com/GoogleCloudPlatform/functions-framework-go v1.8.1 diff --git a/run/helloworld/go.mod b/run/helloworld/go.mod index c2b1ecdccc..aeaa4a8db4 100644 --- a/run/helloworld/go.mod +++ b/run/helloworld/go.mod @@ -1,3 +1,3 @@ module github.com/GoogleCloudPlatform/golang-samples/run/helloworld -go 1.23 +go 1.23.0