From e40231fb60c9dc028c6f1e4a634017c1cc6afc25 Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Tue, 3 Mar 2026 05:42:48 +0000 Subject: [PATCH 01/11] Update Go version to 1.26 in Dockerfiles and documentation --- src/go-postgres/.devcontainer/Dockerfile | 2 +- src/go-postgres/README.md | 2 +- src/go-postgres/devcontainer-template.json | 6 ++++-- src/go/.devcontainer/devcontainer.json | 2 +- src/go/README.md | 2 +- src/go/devcontainer-template.json | 6 ++++-- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/go-postgres/.devcontainer/Dockerfile b/src/go-postgres/.devcontainer/Dockerfile index 3c801df2..0cd7a3ea 100644 --- a/src/go-postgres/.devcontainer/Dockerfile +++ b/src/go-postgres/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/go:2-${templateOption:imageVariant} +FROM mcr.microsoft.com/devcontainers/go:3-${templateOption:imageVariant} # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ diff --git a/src/go-postgres/README.md b/src/go-postgres/README.md index f1aac8ba..ac9bb3da 100644 --- a/src/go-postgres/README.md +++ b/src/go-postgres/README.md @@ -7,7 +7,7 @@ Use and develop Go + Postgres applications. Includes appropriate runtime args, G | Options Id | Description | Type | Default Value | |-----|-----|-----|-----| -| imageVariant | Go version: | string | 1.25-trixie | +| imageVariant | Go version: | string | 1.26-trixie | This template references an image that was [pre-built](https://containers.dev/implementors/reference/#prebuilding) to automatically include needed devcontainer.json metadata. diff --git a/src/go-postgres/devcontainer-template.json b/src/go-postgres/devcontainer-template.json index 759d6d36..08b34afe 100644 --- a/src/go-postgres/devcontainer-template.json +++ b/src/go-postgres/devcontainer-template.json @@ -1,6 +1,6 @@ { "id": "go-postgres", - "version": "5.0.0", + "version": "560.0", "name": "Go & PostgreSQL", "description": "Use and develop Go + Postgres applications. Includes appropriate runtime args, Go, common tools, extensions, and dependencies.", "documentationURL": "https://github.com/devcontainers/templates/tree/main/src/go-postgres", @@ -12,15 +12,17 @@ "description": "Go version:", "proposals": [ "1-trixie", + "1.26-trixie", "1.25-trixie", "1.24-trixie", "1-bookworm", + "1.26-bookworm", "1.25-bookworm", "1.24-bookworm", "1-bullseye", "1.24-bullseye" ], - "default": "1.25-trixie" + "default": "1.26-trixie" } }, "platforms": ["Go"], diff --git a/src/go/.devcontainer/devcontainer.json b/src/go/.devcontainer/devcontainer.json index e3099526..1e638b02 100644 --- a/src/go/.devcontainer/devcontainer.json +++ b/src/go/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "Go", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/go:2-${templateOption:imageVariant}" + "image": "mcr.microsoft.com/devcontainers/go:3-${templateOption:imageVariant}" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/src/go/README.md b/src/go/README.md index 35c83739..77a96d2a 100644 --- a/src/go/README.md +++ b/src/go/README.md @@ -7,7 +7,7 @@ Develop Go based applications. Includes appropriate runtime args, Go, common too | Options Id | Description | Type | Default Value | |-----|-----|-----|-----| -| imageVariant | Go version: | string | 1.25-trixie | +| imageVariant | Go version: | string | 1.26-trixie | This template references an image that was [pre-built](https://containers.dev/implementors/reference/#prebuilding) to automatically include needed devcontainer.json metadata. diff --git a/src/go/devcontainer-template.json b/src/go/devcontainer-template.json index 79c4a1ae..496ece65 100644 --- a/src/go/devcontainer-template.json +++ b/src/go/devcontainer-template.json @@ -1,6 +1,6 @@ { "id": "go", - "version": "5.0.0", + "version": "6.0.0", "name": "Go", "description": "Develop Go based applications. Includes appropriate runtime args, Go, common tools, extensions, and dependencies.", "documentationURL": "https://github.com/devcontainers/templates/tree/main/src/go", @@ -11,14 +11,16 @@ "type": "string", "description": "Go version:", "proposals": [ + "1.26-trixie", "1-trixie", "1.24-trixie", "1.25-trixie", + "1.26-bookworm", "1.25-bookworm", "1.24-bookworm", "1.24-bullseye" ], - "default": "1.25-trixie" + "default": "1.26-trixie" } }, "platforms": ["Go"], From f57ea457581f2278bd72c507fec321fdccc76337 Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Tue, 3 Mar 2026 05:59:14 +0000 Subject: [PATCH 02/11] change in devcontainer configuration --- src/go-postgres/.devcontainer/Dockerfile | 2 +- src/go/.devcontainer/devcontainer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/go-postgres/.devcontainer/Dockerfile b/src/go-postgres/.devcontainer/Dockerfile index 0cd7a3ea..3c801df2 100644 --- a/src/go-postgres/.devcontainer/Dockerfile +++ b/src/go-postgres/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/go:3-${templateOption:imageVariant} +FROM mcr.microsoft.com/devcontainers/go:2-${templateOption:imageVariant} # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ diff --git a/src/go/.devcontainer/devcontainer.json b/src/go/.devcontainer/devcontainer.json index 1e638b02..e3099526 100644 --- a/src/go/.devcontainer/devcontainer.json +++ b/src/go/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "Go", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/go:3-${templateOption:imageVariant}" + "image": "mcr.microsoft.com/devcontainers/go:2-${templateOption:imageVariant}" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, From 77c78aa579423eb01b2f9e0f48d182c4540bd29f Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Tue, 17 Mar 2026 15:13:39 +0530 Subject: [PATCH 03/11] Update Go version in devcontainer template --- src/go-postgres/devcontainer-template.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/go-postgres/devcontainer-template.json b/src/go-postgres/devcontainer-template.json index 08b34afe..e32ff84e 100644 --- a/src/go-postgres/devcontainer-template.json +++ b/src/go-postgres/devcontainer-template.json @@ -1,6 +1,6 @@ { "id": "go-postgres", - "version": "560.0", + "version": "6.0.0", "name": "Go & PostgreSQL", "description": "Use and develop Go + Postgres applications. Includes appropriate runtime args, Go, common tools, extensions, and dependencies.", "documentationURL": "https://github.com/devcontainers/templates/tree/main/src/go-postgres", @@ -11,16 +11,10 @@ "type": "string", "description": "Go version:", "proposals": [ - "1-trixie", "1.26-trixie", "1.25-trixie", - "1.24-trixie", - "1-bookworm", "1.26-bookworm", "1.25-bookworm", - "1.24-bookworm", - "1-bullseye", - "1.24-bullseye" ], "default": "1.26-trixie" } From 8ce18fe8f7b2a1a3264b3b25cc5d58d6b8a5ac23 Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Tue, 17 Mar 2026 15:15:17 +0530 Subject: [PATCH 04/11] Update Go version proposals in devcontainer template Removed outdated Go versions from proposals. --- src/go/devcontainer-template.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/go/devcontainer-template.json b/src/go/devcontainer-template.json index 496ece65..756a7d5a 100644 --- a/src/go/devcontainer-template.json +++ b/src/go/devcontainer-template.json @@ -12,13 +12,9 @@ "description": "Go version:", "proposals": [ "1.26-trixie", - "1-trixie", - "1.24-trixie", "1.25-trixie", "1.26-bookworm", - "1.25-bookworm", - "1.24-bookworm", - "1.24-bullseye" + "1.25-bookworm" ], "default": "1.26-trixie" } From b47470e3cdde7a2ab0d85983b50bfe8cc88d65f6 Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Tue, 17 Mar 2026 09:59:00 +0000 Subject: [PATCH 05/11] Fix formatting --- src/go-postgres/devcontainer-template.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go-postgres/devcontainer-template.json b/src/go-postgres/devcontainer-template.json index e32ff84e..3df128e3 100644 --- a/src/go-postgres/devcontainer-template.json +++ b/src/go-postgres/devcontainer-template.json @@ -14,7 +14,7 @@ "1.26-trixie", "1.25-trixie", "1.26-bookworm", - "1.25-bookworm", + "1.25-bookworm" ], "default": "1.26-trixie" } From e8101121c16e1a0521c8b09f6ab20a294bfa65a0 Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Tue, 24 Mar 2026 10:36:26 +0000 Subject: [PATCH 06/11] debugging --- test/go-postgres/test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/go-postgres/test.sh b/test/go-postgres/test.sh index c94143ec..cfe60ba4 100644 --- a/test/go-postgres/test.sh +++ b/test/go-postgres/test.sh @@ -9,6 +9,17 @@ checkCommon # Run template specific tests checkExtension "golang.Go" +echo "=== DNS diagnostics ===" +echo "--- /etc/resolv.conf ---" +cat /etc/resolv.conf || true +echo "--- getent hosts proxy.golang.org ---" +getent hosts proxy.golang.org || true +echo "--- getent hosts github.com ---" +getent hosts github.com || true +echo "--- curl proxy.golang.org (headers) ---" +curl -I https://proxy.golang.org 2>/dev/null | head -n 5 || true +echo "=======================" + check "lib pq check" go list github.com/lib/pq check "go test program" go run hello.go From 9a7bdf4cc425bd0594fdd7feb2039f29ce772aa3 Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Mon, 6 Apr 2026 05:42:33 +0000 Subject: [PATCH 07/11] Update Go version to 1.26 and improve environment checks in test script --- test/go-postgres/go.mod | 4 ++-- test/go-postgres/test.sh | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/test/go-postgres/go.mod b/test/go-postgres/go.mod index 19b7076c..02b9b65a 100644 --- a/test/go-postgres/go.mod +++ b/test/go-postgres/go.mod @@ -1,5 +1,5 @@ module test-project -go 1.17 +go 1.26 -require github.com/lib/pq v1.10.4 +require github.com/lib/pq v1.10.9 diff --git a/test/go-postgres/test.sh b/test/go-postgres/test.sh index cfe60ba4..59c19e74 100644 --- a/test/go-postgres/test.sh +++ b/test/go-postgres/test.sh @@ -9,16 +9,11 @@ checkCommon # Run template specific tests checkExtension "golang.Go" -echo "=== DNS diagnostics ===" -echo "--- /etc/resolv.conf ---" -cat /etc/resolv.conf || true -echo "--- getent hosts proxy.golang.org ---" -getent hosts proxy.golang.org || true -echo "--- getent hosts github.com ---" -getent hosts github.com || true -echo "--- curl proxy.golang.org (headers) ---" -curl -I https://proxy.golang.org 2>/dev/null | head -n 5 || true -echo "=======================" +echo "=== Go Environment Check ===" +go env GOPROXY +go env GOSUMDB +go version +echo "===============================" check "lib pq check" go list github.com/lib/pq check "go test program" go run hello.go From 193e0b76feaa9e0289bc2b62d36f6b48f9377452 Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Mon, 6 Apr 2026 11:24:00 +0530 Subject: [PATCH 08/11] revert to v1.10.4 --- test/go-postgres/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/go-postgres/go.mod b/test/go-postgres/go.mod index 02b9b65a..ced91243 100644 --- a/test/go-postgres/go.mod +++ b/test/go-postgres/go.mod @@ -2,4 +2,4 @@ module test-project go 1.26 -require github.com/lib/pq v1.10.9 +require github.com/lib/pq v1.10.4 From 09820d596b9df1fe4cf094bb7d9760b3e6256790 Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Mon, 6 Apr 2026 06:15:50 +0000 Subject: [PATCH 09/11] Update Go module dependency and enhance environment checks in test script --- test/go-postgres/test.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/go-postgres/test.sh b/test/go-postgres/test.sh index 59c19e74..ba3f1bbd 100644 --- a/test/go-postgres/test.sh +++ b/test/go-postgres/test.sh @@ -11,12 +11,20 @@ checkExtension "golang.Go" echo "=== Go Environment Check ===" go env GOPROXY -go env GOSUMDB +go env GOSUMDB go version echo "===============================" -check "lib pq check" go list github.com/lib/pq -check "go test program" go run hello.go +# Test with default proxy first, fallback to direct if needed +check "lib pq check" go list github.com/lib/pq || { + echo "Proxy failed, trying direct access as fallback..." + GOPROXY=direct go list github.com/lib/pq +} + +check "go test program" go run hello.go || { + echo "Proxy failed, trying direct access as fallback..." + GOPROXY=direct go run hello.go +} ## Report result reportResults From 95254a915aee1d2b6a72e643d0edfcde7456bdbf Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Mon, 6 Apr 2026 07:03:57 +0000 Subject: [PATCH 10/11] Refactor Docker Compose and test scripts for improved clarity and functionality --- src/go-postgres/.devcontainer/docker-compose.yml | 14 ++++++-------- src/go/.devcontainer/devcontainer.json | 7 +------ test/go-postgres/test.sh | 14 +++----------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/go-postgres/.devcontainer/docker-compose.yml b/src/go-postgres/.devcontainer/docker-compose.yml index 071a9398..cd14711c 100644 --- a/src/go-postgres/.devcontainer/docker-compose.yml +++ b/src/go-postgres/.devcontainer/docker-compose.yml @@ -3,24 +3,24 @@ version: '3.8' volumes: postgres-data: + services: app: - build: + build: context: . dockerfile: Dockerfile env_file: - # Ensure that the variables in .env match the same variables in devcontainer.json - - .env + # Ensure that the variables in .env match the same variables in devcontainer.json + - .env volumes: - ../..:/workspaces:cached - + # Overrides default command so things don't shut down after the process ends. command: sleep infinity # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. network_mode: service:db - # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. # (Adding the "ports" property to this file will not forward from a Codespace.) @@ -28,11 +28,9 @@ services: image: postgres:latest restart: unless-stopped volumes: - - postgres-data:/var/lib/postgresql/data + - postgres-data:/var/lib/postgresql env_file: # Ensure that the variables in .env match the same variables in devcontainer.json - .env - - # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. # (Adding the "ports" property to this file will not forward from a Codespace.) diff --git a/src/go/.devcontainer/devcontainer.json b/src/go/.devcontainer/devcontainer.json index e3099526..288bfa61 100644 --- a/src/go/.devcontainer/devcontainer.json +++ b/src/go/.devcontainer/devcontainer.json @@ -4,19 +4,14 @@ "name": "Go", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/go:2-${templateOption:imageVariant}" - // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "go version", - // Configure tool-specific properties. // "customizations": {}, - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" -} +} \ No newline at end of file diff --git a/test/go-postgres/test.sh b/test/go-postgres/test.sh index ba3f1bbd..59c19e74 100644 --- a/test/go-postgres/test.sh +++ b/test/go-postgres/test.sh @@ -11,20 +11,12 @@ checkExtension "golang.Go" echo "=== Go Environment Check ===" go env GOPROXY -go env GOSUMDB +go env GOSUMDB go version echo "===============================" -# Test with default proxy first, fallback to direct if needed -check "lib pq check" go list github.com/lib/pq || { - echo "Proxy failed, trying direct access as fallback..." - GOPROXY=direct go list github.com/lib/pq -} - -check "go test program" go run hello.go || { - echo "Proxy failed, trying direct access as fallback..." - GOPROXY=direct go run hello.go -} +check "lib pq check" go list github.com/lib/pq +check "go test program" go run hello.go ## Report result reportResults From b06c3adac46c3b16ffc38690df4d0242ca4d7ec5 Mon Sep 17 00:00:00 2001 From: sireeshajonnalagadda Date: Mon, 6 Apr 2026 13:03:38 +0530 Subject: [PATCH 11/11] Fix indentation in docker-compose.yml --- src/go-postgres/.devcontainer/docker-compose.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/go-postgres/.devcontainer/docker-compose.yml b/src/go-postgres/.devcontainer/docker-compose.yml index cd14711c..d8db01b1 100644 --- a/src/go-postgres/.devcontainer/docker-compose.yml +++ b/src/go-postgres/.devcontainer/docker-compose.yml @@ -3,15 +3,14 @@ version: '3.8' volumes: postgres-data: - services: app: build: context: . dockerfile: Dockerfile env_file: - # Ensure that the variables in .env match the same variables in devcontainer.json - - .env + # Ensure that the variables in .env match the same variables in devcontainer.json + - .env volumes: - ../..:/workspaces:cached