marefr / symlink-go-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vscode-go extension with test on save and symbolic links

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:

  1. Setup symbolic links
cd ./b
./dev.sh
  1. a/pkg/extensions should now include content from b/src/pkg/extensions as symbolic links

  2. Open "a" directory in vs code

cd ..
code ./a
  1. Open pkg/extensions/something/something_test.go
  2. Save the file
  3. 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'
  1. Open a terminal in vs code (current directory should be the workspace, <repo>/a)
  2. 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
  1. Remove symbolic links
cd ./b
./undev.sh

About


Languages

Language:Shell 57.7%Language:Go 42.3%