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
{{ message }}
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
With Go, the goimports formatter is not super fast. It can take a second for it to run on a large file — and it's almost always slower than I work. I frequently save and then immediately hit my keyboard shortcut to run the tests, and as a result, I constantly find myself in a situation where the tests are run before imports have been fixed.
For example, I might add a log.Printf() call, save, run tests, which then immediately fail with:
./functions.go:643: undefined: loginlog.Printf
A solution to this would for the test runner to wait with the run until the file is fully saved. I don't know if VSCode has the necessary APIs to even do this, however.
Would it perhaps also make sense that the test runner saves a file first if it's dirty?
With Go, the
goimportsformatter is not super fast. It can take a second for it to run on a large file — and it's almost always slower than I work. I frequently save and then immediately hit my keyboard shortcut to run the tests, and as a result, I constantly find myself in a situation where the tests are run before imports have been fixed.For example, I might add a
log.Printf()call, save, run tests, which then immediately fail with:A solution to this would for the test runner to wait with the run until the file is fully saved. I don't know if VSCode has the necessary APIs to even do this, however.
Would it perhaps also make sense that the test runner saves a file first if it's dirty?