This plugin requires nvim-treesitter with the Go parser installed:
require('nvim-treesitter').install({ "go" })return {
"vcraescu/gotest.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter" },
cmd = { "GoTestNearest", "GoTestRetry" },
opts = {}
}{
output = {
focus = {
fail = true, -- focus test results on fail
success = false, -- focus test results on success
},
height = 15, -- height of the quickfix pane
show = {
fail = true,
success = true,
},
},
timeout = 30, -- test run timeout in seconds
disable_test_cache = false, -- disable go test cache
diagnostics = {
enabled = true, -- show diagnostics
},
}Run the test nearest to the cursor:
:GoTestNearest
Rerun the last test command:
:GoTestRetry