From 882f504a38984a5c607aaaafa9457541aacd7231 Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Tue, 23 May 2023 12:57:05 +0200 Subject: [PATCH] Update dev-tools to support Go Workspace This commit updates the dev-tool code to support Go Workspace. --- dev-tools/mage/gotool/go.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev-tools/mage/gotool/go.go b/dev-tools/mage/gotool/go.go index b7a833cf..829cf896 100644 --- a/dev-tools/mage/gotool/go.go +++ b/dev-tools/mage/gotool/go.go @@ -58,7 +58,9 @@ var Test goTest = runGoTest // GetModuleName returns the name of the module. func GetModuleName() (string, error) { - lines, err := getLines(callGo(nil, "list", "-m")) + // `go list -buildvcs=false -f '{{.Module}}'` produces the same output as `go list -m` + // and it works with go workspace + lines, err := getLines(callGo(nil, "list", "-buildvcs=false", "-f", "{{.Module}}")) if err != nil { return "", err }