Skip to content

Commit 336ef3b

Browse files
Update hack/api-lint-diff/run.sh
Co-authored-by: Todd Short <tmshort@users.noreply.github.com>
1 parent cf3eedf commit 336ef3b

1 file changed

Lines changed: 6 additions & 26 deletions

File tree

hack/api-lint-diff/run.sh

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -196,32 +196,12 @@ check_linter_support() {
196196

197197
# Find golangci-lint binary
198198
find_golangci_lint() {
199-
# Check if Variables.mk exists and extract golangci-lint path
200-
if [[ -f ".bingo/Variables.mk" ]]; then
201-
# Extract version from GOLANGCI_LINT variable
202-
# Format: GOLANGCI_LINT := $(GOBIN)/golangci-lint-v2.7.2
203-
local version
204-
version=$(grep '^GOLANGCI_LINT' .bingo/Variables.mk | sed -E 's/.*golangci-lint-(v[0-9]+\.[0-9]+\.[0-9]+).*/\1/')
205-
206-
if [[ -n "${version}" ]]; then
207-
# Use go env to get the actual GOBIN/GOPATH
208-
local gobin
209-
gobin=$(go env GOBIN)
210-
211-
# If GOBIN is empty, use GOPATH/bin
212-
if [[ -z "${gobin}" ]]; then
213-
local gopath
214-
gopath=$(go env GOPATH)
215-
# Take first entry if GOPATH has multiple paths (colon-separated)
216-
gobin="${gopath%%:*}/bin"
217-
fi
218-
219-
# Check if the versioned binary exists
220-
local bingo_path="${gobin}/golangci-lint-${version}"
221-
if [[ -f "${bingo_path}" ]]; then
222-
echo "${bingo_path}"
223-
return 0
224-
fi
199+
# Check if variables.env exists and extract golangci-lint path
200+
if [[ -f ".bingo/variables.env" ]]; then
201+
source .bingo/variables.env
202+
if [[ -n "${GOLANGCI_LINT}" && -f "${GOLANGCI_LINT}" ]]; then
203+
echo "${GOLANGCI_LINT}"
204+
return 0
225205
fi
226206
fi
227207

0 commit comments

Comments
 (0)