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
The underlying issue is when testing package A only the files in that package are compiled in testing mode--files ending in _test.go are included in the scope. In your case package test is imported, but common_test.go is not part of the import set because package test is not compiled in test mode.
nb. I say package A rather than package main because this is not specific to package main.
This is working as designed, although perhaps not how you intended. Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go.mod:
main.go:
package main
main_test.go:
test/common_test.go
test/hack.go:
What did you expect to see?
I expected the tests to compile
What did you see instead?
The text was updated successfully, but these errors were encountered: