-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·39 lines (31 loc) · 1021 Bytes
/
Copy pathtest.sh
File metadata and controls
executable file
·39 lines (31 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
set -e
GREEN="\033[0;32m"
CYAN="\033[0;36m"
RESET="\033[0m"
cd "$(dirname "$0")"
echo -e
if [ -x ~/go/bin/govulncheck ]; then
echo -e "${CYAN}Running local govulncheck...${RESET}"
~/go/bin/govulncheck ./...
elif command -v govulncheck &>/dev/null; then
echo -e "${CYAN}Running system govulncheck...${RESET}"
govulncheck ./...
else
echo "Skipping govulncheck: not found" ; sleep 3
fi
echo -e "${CYAN}Running go vet...${RESET}"
go vet ./...
echo -e "${CYAN}Running go test...${RESET}"
go test -v -race ./...
if [ -x ~/go/bin/golangci-lint ]; then
echo -e "${CYAN}Running local golangci-lint...${RESET}"
~/go/bin/golangci-lint run ./...
elif command -v golangci-lint &>/dev/null; then
echo -e "${CYAN}Running system golangci-lint...${RESET}"
golangci-lint run ./...
else
echo -e "${CYAN}Skipping golangci-lint (not installed)${RESET}"
echo " Install: https://golangci-lint.run/welcome/install/"
fi
echo -e "\n🎉 All checks ${GREEN}passed!${RESET}"