Skip to content

Commit 1c377a3

Browse files
committed
test: Return root module root dir when using go.work
Previously, the helper returned all the output of `go list -m`, and when using go.work, the output contains multiple lines, with the directory of the root module on the first line. Now, the helper returns only the first line.
1 parent 3640635 commit 1c377a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/handlers/generic/lifecycle/ccm/nutanix/handler_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,7 @@ func moduleRootDir() string {
209209
out),
210210
)
211211
}
212-
return strings.TrimSpace(string(out))
212+
modules := strings.Split(string(out), "\n")
213+
rootModule := strings.TrimSpace(modules[0])
214+
return rootModule
213215
}

0 commit comments

Comments
 (0)