You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow up issue from feedback collected from GopherCon.
/example/ tree
.
├── example_test.go // the test function will call a helper function from foo/internal.go
├── example.go
├── foo
│ └── internal.go // foo/internal.go will call t.Error()
└── internal.go // but this is the file get opened
-- example_test.go --
package example
import (
"helloworld/example/foo"
"testing"
)
func TestFoo(t *testing.T) {
foo.TestHelper(t)
}
-- foo/internal.go --
func TestHelper(t *testing.T) {
t.Errorf("asdas internal")
}
-- internal.go --
package example
// asdasd
// asdasd
// asdasd
// asdasd
// asdasd
// asdasd
// asdasd
// asdasd
// asdasd
Run the test from test explorer, and click the failing test case in test explorer. VSCode-Go will open the example/internal.go instead of the real failure at example/foo/internal.go.
It more confusing if the file example/internal.go does not exist. VSCode will say "file not found".