This plugin allows you to run go tests automatically on save.
use({
"BrianGreenhill/gotest",
config = function()
require("gotest").setup()
end
})
The plugin creates the following autocommands
:GoTestOnSave
registers a test command to autorun based on the current buffer. To be run from a test file.:GoTestLineDiag
To be run on the diagnostic line. It will show a window with the test output
Inspired by TJ Devries' video on integrated test results in nvim. Sponsor him here