generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(go): Add scenario for no golangci-lint
- Loading branch information
1 parent
ead9ec2
commit dfe774c
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
checkNotInstalled() { | ||
local message="$1" | ||
local command="$2" | ||
|
||
if ! command -v "$command" >/dev/null 2>&1; then | ||
echo "✅ $message" | ||
else | ||
echo "❌ $message" | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Optional: Import test library | ||
# shellcheck disable=SC1091 | ||
source dev-container-features-test-lib | ||
|
||
# go | ||
check "version" go version | ||
|
||
# golangci-lint | ||
checkNotInstalled "golangci-lint is not installed" golangci-lint | ||
|
||
# Report result | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters