retiring richgo, use gotestsum instead

pull/457/head
ray-x 3 weeks ago
parent ae078b8da4
commit d5e2b8cdd8

@ -276,11 +276,13 @@ end
go.set_test_runner = function(runner)
-- richgo, go test, richgo, dlv, ginkgo
local runners = { 'richgo', 'go', 'richgo', 'ginkgo' } -- dlv
for _, v in pairs(runners) do
if v == runner then
_GO_NVIM_CFG.test_runner = runner
return
end
if runner == 'richgo' then
vim.notify('richgo is deprecated, use gotestsum', vim.log.levels.WARN)
runner = 'gotestsum'
end
if vim.tbl_contains(runners, runner) then
_GO_NVIM_CFG.test_runner = runner
return
end
vim.notify('runner not supported ' .. runner, vim.log.levels.ERROR)
end

@ -110,13 +110,6 @@ function M.get_test_path()
return '.' .. sep .. relative_path
end
local function richgo(cmd)
if cmd[1] == 'go' and vfn.executable('richgo') == 1 then
cmd[1] = 'richgo'
end
return cmd
end
local function get_test_filebufnr()
local fn = vfn.expand('%')
trace(fn)
@ -271,9 +264,7 @@ local function run_test(path, args)
log(cmd, args)
local run_in_floaterm = _GO_NVIM_CFG.run_in_floaterm or optarg['F']
if run_in_floaterm then
install('richgo')
local term = require('go.term').run
cmd = richgo(cmd)
log(cmd)
term({ cmd = cmd, autoclose = false })
return cmd
@ -489,9 +480,7 @@ local function run_tests_with_ts_node(args, func_node, tblcase_ns)
if run_in_floaterm then
utils.log(cmd)
install('richgo')
local term = require('go.term').run
cmd = richgo(cmd)
term({ cmd = cmd, autoclose = false })
return
end
@ -648,9 +637,7 @@ M.test_file = function(...)
table.insert(cmd_args, tests) -- shell script | is a pipe
if optarg['F'] or _GO_NVIM_CFG.run_in_floaterm then
install('richgo')
local term = require('go.term').run
cmd_args = richgo(cmd_args)
local cmd_args_str = table.concat(cmd_args, ' ')
log(cmd_args)
term({ cmd = cmd_args_str, autoclose = false })

Loading…
Cancel
Save