-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
I propose to add a flag to go test, such as -logabspath, that will print out the absolute path of the location of a call to (*testing.T).Log and friends instead of just the file name.
*testing.T methods that log (via (*testing.T).log) print out the location of the call, truncating the filename to just the basename. This may be helpful to users but it is problematic for tools like the VSCode Go extension. The Go extension's test support uses that location information to attach a log event to the source location. The extension assumes that such calls are made from files in the same package as the test, so this works in that case. However, it fails if those methods are called from a location outside of the test's package (if that location does not also call (*testing.T).Helper(). My proposal would provide an opt-in way for tooling such as the extension to change this behavior.