From eba43290baaba363ac950ff305b5cf1beacb4958 Mon Sep 17 00:00:00 2001 From: Jamie Holdstock Date: Wed, 23 Nov 2022 17:56:40 +0800 Subject: [PATCH] contrib: Enable run_tests.sh to work with go.work. The script `run_tests.sh` does not work if a go.work file is present in the project root. This is because when a `go.work` file is present, `go list -m` returns the names of all modules in the workspace rather than just the parent module in the root directory. Removing the `-m` flag fixes this. --- run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 91cae00ac7..db5ac296aa 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -17,7 +17,7 @@ set -ex go version # run tests on all modules -ROOTPATH=$(go list -m) +ROOTPATH=$(go list) ROOTPATHPATTERN=$(echo $ROOTPATH | sed 's/\\/\\\\/g' | sed 's/\//\\\//g') MODPATHS=$(go list -m all | grep "^$ROOTPATHPATTERN" | cut -d' ' -f1) for module in $MODPATHS; do