Test repo for reproducing issue regarding the vscode-go extension with test on save feature enabled when saved package/file is a symbolic link.
Settings:
{
"search.followSymlinks": true,
"search.useIgnoreFiles": false,
"go.testOnSave": true
}
Reproduction steps:
- Setup symbolic links
cd ./b
./dev.sh
-
a/pkg/extensions should now include content from b/src/pkg/extensions as symbolic links
-
Open "a" directory in vs code
cd ..
code ./a
- Open
pkg/extensions/something/something_test.go
- Save the file
- Output window show the failure when running tests
Running tool: /usr/local/go/bin/go test github.com/marefr/symlink-go-test/a/pkg/extensions/something
no required module provides package github.com/marefr/symlink-go-test/a/pkg/extensions/something: go.mod file not found in current directory or any parent directory; see 'go help modules'
- Open a terminal in vs code (current directory should be the workspace,
<repo>/a
) - Paste command from output window above and run test to see that it works as expected
~/go/src/github.com/marefr/symlink-go-test/a
❯ /usr/local/go/bin/go test github.com/marefr/symlink-go-test/a/pkg/extensions/something
ok github.com/marefr/symlink-go-test/a/pkg/extensions/something 0.003s
- Remove symbolic links
cd ./b
./undev.sh