Skip to content

Commit

Permalink
Add test and up minor version
Browse files Browse the repository at this point in the history
  • Loading branch information
mitesch committed Aug 26, 2024
1 parent 6ec7004 commit 847ba27
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/go/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "go",
"version": "1.3.0",
"version": "1.3.1",
"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.",
Expand Down
2 changes: 1 addition & 1 deletion src/go/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ if [[ "${TARGET_GO_VERSION}" != "none" ]] && [[ "$(go version 2>/dev/null)" != *
curl -fsSL -o /tmp/go.tar.gz.asc "https://golang.org/dl/go${TARGET_GO_VERSION}.linux-${architecture}.tar.gz.asc"
gpg --verify /tmp/go.tar.gz.asc /tmp/go.tar.gz
echo "Removing existing Go ${TARGET_GOROOT}..."
rm -rf $TARGET_GOROOT/*
rm -rf "${TARGET_GOROOT:?}/"*
echo "Extracting Go ${TARGET_GO_VERSION}..."
tar -xzf /tmp/go.tar.gz -C "${TARGET_GOROOT}" --strip-components=1
rm -rf /tmp/go.tar.gz /tmp/go.tar.gz.asc /tmp/tmp-gnupg
Expand Down
12 changes: 12 additions & 0 deletions test/go/install_go_1_23_over_1_22.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# golangci is a smoke test to ensure the go install directory doesn't have leftover files from 1.22
check "install golangci-lint to verify the go install" bash -c "go install github.com/golangci/golangci-lint/cmd/[email protected]"

# Report result
reportResults
File renamed without changes.
12 changes: 10 additions & 2 deletions test/go/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
}
}
},
"install_go_centos-7": {
"image": "centos:centos7",
"install_go_centos-9": {
"image": "quay.io/centos/centos:stream9",
"features": {
"go": {
"version": "latest",
Expand Down Expand Up @@ -89,5 +89,13 @@
"version": "1.19"
}
}
},
"install_go_1_23_over_1_22": {
"image": "mcr.microsoft.com/devcontainers/go:1.22",
"features": {
"go": {
"version": "1.23"
}
}
}
}

0 comments on commit 847ba27

Please sign in to comment.