File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -196,32 +196,12 @@ check_linter_support() {
196196
197197# Find golangci-lint binary
198198find_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
You can’t perform that action at this time.
0 commit comments