Skip to content

Commit 427f42f

Browse files
Copilotchefgs
andauthored
Fix Go download for short GO_VERSION values
Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/9b0c799a-f3ea-4137-ae78-1b58c5743fb7 Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
1 parent 6115213 commit 427f42f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ RUN if [ "$INSTALL_JS" = "true" ]; then \
102102

103103
# Install Go if requested
104104
RUN if [ "$INSTALL_GO" = "true" ]; then \
105-
curl -OL https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz \
106-
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \
107-
&& rm go${GO_VERSION}.linux-amd64.tar.gz \
105+
GO_DOWNLOAD_VERSION="${GO_VERSION}" \
106+
&& case "${GO_DOWNLOAD_VERSION}" in *.*.*) ;; *.*) GO_DOWNLOAD_VERSION="${GO_DOWNLOAD_VERSION}.0" ;; esac \
107+
&& curl -fsSLO "https://go.dev/dl/go${GO_DOWNLOAD_VERSION}.linux-amd64.tar.gz" \
108+
&& tar -C /usr/local -xzf "go${GO_DOWNLOAD_VERSION}.linux-amd64.tar.gz" \
109+
&& rm "go${GO_DOWNLOAD_VERSION}.linux-amd64.tar.gz" \
108110
&& echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/bash.bashrc \
109111
&& echo "export PATH=$PATH:/root/go/bin" >> /etc/bash.bashrc \
110112
&& /usr/local/go/bin/go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; \

0 commit comments

Comments
 (0)