From 7f76ce43afbe533ba5501559dba957bdbd3fe6ef Mon Sep 17 00:00:00 2001 From: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com> Date: Sun, 22 Feb 2026 13:51:56 +0000 Subject: [PATCH 1/2] Fix: Remove temporary Go tools directory --- src/go/install.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/go/install.sh b/src/go/install.sh index 85fea5dc4..7843f1b97 100755 --- a/src/go/install.sh +++ b/src/go/install.sh @@ -301,10 +301,11 @@ GO_TOOLS="\ if [ "${INSTALL_GO_TOOLS}" = "true" ]; then echo "Installing common Go tools..." export PATH=${TARGET_GOROOT}/bin:${PATH} - mkdir -p /tmp/gotools /usr/local/etc/vscode-dev-containers ${TARGET_GOPATH}/bin - cd /tmp/gotools export GOPATH=/tmp/gotools - export GOCACHE=/tmp/gotools/cache + export GOCACHE=${GOPATH}/cache + + mkdir -p ${GOPATH} /usr/local/etc/vscode-dev-containers ${TARGET_GOPATH}/bin + cd ${GOPATH} # Use go get for versions of go under 1.16 go_install_command=install @@ -316,10 +317,9 @@ if [ "${INSTALL_GO_TOOLS}" = "true" ]; then (echo "${GO_TOOLS}" | xargs -n 1 go ${go_install_command} -v )2>&1 | tee -a /usr/local/etc/vscode-dev-containers/go.log - # Move Go tools into path and clean up - if [ -d /tmp/gotools/bin ]; then - mv /tmp/gotools/bin/* ${TARGET_GOPATH}/bin/ - rm -rf /tmp/gotools + # Move Go tools into path + if [ -d "${GOPATH}/bin" ]; then + mv ${GOPATH}/bin/* ${TARGET_GOPATH}/bin/ fi # Install golangci-lint from precompiled binares @@ -332,6 +332,9 @@ if [ "${INSTALL_GO_TOOLS}" = "true" ]; then curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \ sh -s -- -b "${TARGET_GOPATH}/bin" "v${GOLANGCILINT_VERSION}" fi + + # Remove Go tools temp directory + rm -rf ${GOPATH} fi From 1343f7e597a4e17f0aa64cfcf244515adc5f0bf4 Mon Sep 17 00:00:00 2001 From: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com> Date: Sat, 28 Feb 2026 04:44:03 +0000 Subject: [PATCH 2/2] Bump go version & Fixed variable expansion --- src/go/devcontainer-feature.json | 2 +- src/go/install.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/go/devcontainer-feature.json b/src/go/devcontainer-feature.json index f98e65a7f..8872d6374 100644 --- a/src/go/devcontainer-feature.json +++ b/src/go/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "go", - "version": "1.3.2", + "version": "1.3.3", "name": "Go", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/go", "description": "Installs Go and common Go utilities. Auto-detects latest version and installs needed dependencies.", diff --git a/src/go/install.sh b/src/go/install.sh index 7843f1b97..4286c08a8 100755 --- a/src/go/install.sh +++ b/src/go/install.sh @@ -302,10 +302,10 @@ if [ "${INSTALL_GO_TOOLS}" = "true" ]; then echo "Installing common Go tools..." export PATH=${TARGET_GOROOT}/bin:${PATH} export GOPATH=/tmp/gotools - export GOCACHE=${GOPATH}/cache + export GOCACHE="${GOPATH}/cache" - mkdir -p ${GOPATH} /usr/local/etc/vscode-dev-containers ${TARGET_GOPATH}/bin - cd ${GOPATH} + mkdir -p "${GOPATH}" /usr/local/etc/vscode-dev-containers "${TARGET_GOPATH}/bin" + cd "${GOPATH}" # Use go get for versions of go under 1.16 go_install_command=install @@ -319,7 +319,7 @@ if [ "${INSTALL_GO_TOOLS}" = "true" ]; then # Move Go tools into path if [ -d "${GOPATH}/bin" ]; then - mv ${GOPATH}/bin/* ${TARGET_GOPATH}/bin/ + mv "${GOPATH}/bin"/* "${TARGET_GOPATH}/bin/" fi # Install golangci-lint from precompiled binares @@ -334,7 +334,7 @@ if [ "${INSTALL_GO_TOOLS}" = "true" ]; then fi # Remove Go tools temp directory - rm -rf ${GOPATH} + rm -rf "${GOPATH}" fi