From abad9cbbe921e1c15df0f8829aea56d009e486f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D7=A0=CF=85=CE=B1=CE=B7=20=D7=A0=CF=85=CE=B1=CE=B7=D1=95?= =?UTF-8?q?=CF=83=CE=B7?= Date: Fri, 10 Apr 2026 23:26:54 -0700 Subject: [PATCH] fix(go): exclude node_modules from test and coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit npm packages like flatted ship .go files that cause go test and go list to include them. Filter node_modules from the package list used by unit and unit-cov recipes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- go.just | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/go.just b/go.just index b57f51d..1a2d4b7 100644 --- a/go.just +++ b/go.just @@ -78,11 +78,15 @@ run *args: go run {{ main_package }} {{ args }} # --- Test --- +# go_packages lists all Go packages excluding node_modules (which may +# contain vendored .go files from npm packages like flatted). + +go_packages := "$(go list ./... | grep -v /node_modules/)" # Test packages [group('test')] unit: - go test {{ os_tags }} -parallel 5 -race -v ./... + go test {{ os_tags }} -parallel 5 -race -v {{ go_packages }} # Run integration tests (requires running service) unit-int: @@ -92,7 +96,7 @@ unit-int: [group('test')] unit-cov: _cov-deps mkdir -p {{ coverage_dir }} - go test {{ os_tags }} -race -coverprofile={{ coverage_dir }}/cover.out -v $(go list ./...) + go test {{ os_tags }} -race -coverprofile={{ coverage_dir }}/cover.out -v {{ go_packages }} grep -v -f .coverignore {{ coverage_dir }}/cover.out > {{ coverage_dir }}/cover.tmp && mv {{ coverage_dir }}/cover.tmp {{ coverage_dir }}/cover.out go tool github.com/boumenot/gocover-cobertura < {{ coverage_dir }}/cover.out > {{ coverage_dir }}/cobertura.xml go tool cover -func={{ coverage_dir }}/cover.out