From 44444f280ca9e080626d3c5d6b052fd638bd6ac2 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Sun, 21 Jun 2026 23:28:30 +0000 Subject: [PATCH 1/6] Resolve Go lint tools from GOBIN run-go-tests now looks for go-critic, staticcheck, and errcheck in GOBIN, matching where go install places binaries when GOBIN is configured by the development shell. --- dev-scripts/run-go-tests | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev-scripts/run-go-tests b/dev-scripts/run-go-tests index 7039eb71..13978763 100755 --- a/dev-scripts/run-go-tests +++ b/dev-scripts/run-go-tests @@ -45,7 +45,7 @@ fi go vet ./... # Install go-critic if it's not present. -GOCRITIC_PATH="$(go env GOPATH)/bin/go-critic" +GOCRITIC_PATH="$(go env GOBIN)/go-critic" readonly GOCRITIC_PATH readonly GOCRITIC_VERSION="v0.14.3" if [[ ! -f "${GOCRITIC_PATH}" ]]; then @@ -55,7 +55,7 @@ fi "${GOCRITIC_PATH}" check -enable=returnAfterHttpError ./... # Install staticcheck if it's not present. -STATICCHECK_PATH="$(go env GOPATH)/bin/staticcheck" +STATICCHECK_PATH="$(go env GOBIN)/staticcheck" readonly STATICCHECK_PATH readonly STATICCHECK_VERSION="v0.6.1" if [[ ! -f "${STATICCHECK_PATH}" ]]; then @@ -64,7 +64,7 @@ fi "${STATICCHECK_PATH}" ./... # Install errcheck if it's not present. -ERRCHECK_PATH="$(go env GOPATH)/bin/errcheck" +ERRCHECK_PATH="$(go env GOBIN)/errcheck" readonly ERRCHECK_PATH readonly ERRCHECK_VERSION="v1.10.0" if [[ ! -f "${ERRCHECK_PATH}" ]]; then From 9d3be8dae7ec5ec5230565b85ee5cce75f97a17c Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Sun, 21 Jun 2026 23:34:45 +0000 Subject: [PATCH 2/6] Support Go lint tools without GOBIN run-go-tests now falls back to GOPATH/bin when GOBIN is unset, matching go install behavior in CI environments that do not configure GOBIN. --- dev-scripts/run-go-tests | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dev-scripts/run-go-tests b/dev-scripts/run-go-tests index 13978763..02a59714 100755 --- a/dev-scripts/run-go-tests +++ b/dev-scripts/run-go-tests @@ -44,8 +44,14 @@ fi go vet ./... +GO_BIN_DIR="$(go env GOBIN)" +if [[ -z "${GO_BIN_DIR}" ]]; then + GO_BIN_DIR="$(go env GOPATH)/bin" +fi +readonly GO_BIN_DIR + # Install go-critic if it's not present. -GOCRITIC_PATH="$(go env GOBIN)/go-critic" +GOCRITIC_PATH="${GO_BIN_DIR}/go-critic" readonly GOCRITIC_PATH readonly GOCRITIC_VERSION="v0.14.3" if [[ ! -f "${GOCRITIC_PATH}" ]]; then @@ -55,7 +61,7 @@ fi "${GOCRITIC_PATH}" check -enable=returnAfterHttpError ./... # Install staticcheck if it's not present. -STATICCHECK_PATH="$(go env GOBIN)/staticcheck" +STATICCHECK_PATH="${GO_BIN_DIR}/staticcheck" readonly STATICCHECK_PATH readonly STATICCHECK_VERSION="v0.6.1" if [[ ! -f "${STATICCHECK_PATH}" ]]; then @@ -64,7 +70,7 @@ fi "${STATICCHECK_PATH}" ./... # Install errcheck if it's not present. -ERRCHECK_PATH="$(go env GOBIN)/errcheck" +ERRCHECK_PATH="${GO_BIN_DIR}/errcheck" readonly ERRCHECK_PATH readonly ERRCHECK_VERSION="v1.10.0" if [[ ! -f "${ERRCHECK_PATH}" ]]; then From 088a14de48acdbf9e3ef10849649453ed2d33646 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Sun, 21 Jun 2026 19:35:10 -0400 Subject: [PATCH 3/6] Fix GOBIN path --- dev-scripts/run-go-tests | 1 + 1 file changed, 1 insertion(+) diff --git a/dev-scripts/run-go-tests b/dev-scripts/run-go-tests index 02a59714..1b940862 100755 --- a/dev-scripts/run-go-tests +++ b/dev-scripts/run-go-tests @@ -44,6 +44,7 @@ fi go vet ./... +# Workaround for compatibility with Nix and CircleCI environments. GO_BIN_DIR="$(go env GOBIN)" if [[ -z "${GO_BIN_DIR}" ]]; then GO_BIN_DIR="$(go env GOPATH)/bin" From 29c204e7a800e2301bf34801f88b9f9ef660a23e Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Sun, 21 Jun 2026 23:37:22 +0000 Subject: [PATCH 4/6] Assign GOBIN fallback directly run-go-tests now exports GOBIN when Go leaves it unset, so go install and the lint tool paths resolve to the same directory without a separate helper variable. --- dev-scripts/run-go-tests | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dev-scripts/run-go-tests b/dev-scripts/run-go-tests index 1b940862..1a3aab68 100755 --- a/dev-scripts/run-go-tests +++ b/dev-scripts/run-go-tests @@ -44,15 +44,13 @@ fi go vet ./... -# Workaround for compatibility with Nix and CircleCI environments. -GO_BIN_DIR="$(go env GOBIN)" -if [[ -z "${GO_BIN_DIR}" ]]; then - GO_BIN_DIR="$(go env GOPATH)/bin" +# Set GOBIN when Go would otherwise install binaries under GOPATH/bin. +if [[ -z "$(go env GOBIN)" ]]; then + export GOBIN="$(go env GOPATH)/bin" fi -readonly GO_BIN_DIR # Install go-critic if it's not present. -GOCRITIC_PATH="${GO_BIN_DIR}/go-critic" +GOCRITIC_PATH="$(go env GOBIN)/go-critic" readonly GOCRITIC_PATH readonly GOCRITIC_VERSION="v0.14.3" if [[ ! -f "${GOCRITIC_PATH}" ]]; then @@ -62,7 +60,7 @@ fi "${GOCRITIC_PATH}" check -enable=returnAfterHttpError ./... # Install staticcheck if it's not present. -STATICCHECK_PATH="${GO_BIN_DIR}/staticcheck" +STATICCHECK_PATH="$(go env GOBIN)/staticcheck" readonly STATICCHECK_PATH readonly STATICCHECK_VERSION="v0.6.1" if [[ ! -f "${STATICCHECK_PATH}" ]]; then @@ -71,7 +69,7 @@ fi "${STATICCHECK_PATH}" ./... # Install errcheck if it's not present. -ERRCHECK_PATH="${GO_BIN_DIR}/errcheck" +ERRCHECK_PATH="$(go env GOBIN)/errcheck" readonly ERRCHECK_PATH readonly ERRCHECK_VERSION="v1.10.0" if [[ ! -f "${ERRCHECK_PATH}" ]]; then From 87080242c984f26bce0efa1d4fbebdaa4e6df0ed Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Sun, 21 Jun 2026 19:38:17 -0400 Subject: [PATCH 5/6] work in progress --- dev-scripts/run-go-tests | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev-scripts/run-go-tests b/dev-scripts/run-go-tests index 1a3aab68..96f3c19f 100755 --- a/dev-scripts/run-go-tests +++ b/dev-scripts/run-go-tests @@ -44,7 +44,8 @@ fi go vet ./... -# Set GOBIN when Go would otherwise install binaries under GOPATH/bin. +# Set GOBIN when Go would otherwise install binaries under GOPATH/bin. We need +# this to work under both Nix and CircleCI. if [[ -z "$(go env GOBIN)" ]]; then export GOBIN="$(go env GOPATH)/bin" fi From 7c691a566afc4ec65e3cef2e2ce900cf244a53ad Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Sun, 21 Jun 2026 19:40:04 -0400 Subject: [PATCH 6/6] work in progress --- dev-scripts/run-go-tests | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev-scripts/run-go-tests b/dev-scripts/run-go-tests index 96f3c19f..1c9282ed 100755 --- a/dev-scripts/run-go-tests +++ b/dev-scripts/run-go-tests @@ -47,7 +47,8 @@ go vet ./... # Set GOBIN when Go would otherwise install binaries under GOPATH/bin. We need # this to work under both Nix and CircleCI. if [[ -z "$(go env GOBIN)" ]]; then - export GOBIN="$(go env GOPATH)/bin" + GOBIN="$(go env GOPATH)/bin" + export GOBIN fi # Install go-critic if it's not present.