As of go 1.18 it is possible to use "go.work" files as multimodule workspace save file, equivalent to a "go.mod" file.
I want to know how to use the defined "go.work" file in the command go test.
I tried multiple approaches. When I print the go.work env variables everything seems to work.
How do I use the "go test" command on a "go.work" file?
lets assume i have a directory with two subdirectories with each a go.mod file and two .go source files (file.go and file_test.go) and the main directory with just the go.work file.
go test -v .\go.work
--> not possible
go test ".\ ..."
--> doesn't work as specified, it can't resolve it correctly.
The flag build.experimentalWorkspaceModule
is set to false because it isn't needed anymore. Just go test all
seems to work, but I just want to test my packages, not the whole packages installed.
I dug into the whole documentation, I cant find an example because it seems to be new and not used frequently, the pkg.go.dev doesn't supply info.
Also not here https://go.googlesource.com/tools/+/refs/heads/master/gopls/doc/workspace.md