Skip to content

Commit

Permalink
fix!: broken 'go list' report on some systems (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
miduddin authored Aug 17, 2024
1 parent cfaf82e commit 26d937f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lua/neotest-golang/lib/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ function M.golist_data(cwd)
}
local go_list_command_concat = table.concat(go_list_command, " ")
logger.debug("Running Go list: " .. go_list_command_concat .. " in " .. cwd)
local output =
vim.fn.system("cd " .. cwd .. " && " .. go_list_command_concat, " ")
logger.info({ "Go list output: ", output })
local output = vim
.system(go_list_command, { cwd = cwd, text = true })
:wait().stdout or ""
if output == "" then
logger.error({ "Execution of 'go list' failed, output:", output })
end
return json.decode_from_string(output)
end

Expand Down

0 comments on commit 26d937f

Please sign in to comment.