Skip to content

Commit

Permalink
fix: included -tags to go list command from go_test_args if provided
Browse files Browse the repository at this point in the history
  • Loading branch information
augbed authored and augbed committed Sep 1, 2024
1 parent baa2cf4 commit acfd64f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/neotest-golang/lib/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ function M.golist_data(cwd)
"-json",
"./...",
}

-- if we have tags in go test args
-- we need to add them to list command for it to be able to list properly
for _, go_test_arg in ipairs(options.get().go_test_args) do
if string.match(go_test_arg, "^-tags=") then
table.insert(go_list_command, 3, go_test_arg)
end
end

local go_list_command_concat = table.concat(go_list_command, " ")
logger.debug("Running Go list: " .. go_list_command_concat .. " in " .. cwd)
local output = vim
Expand Down

0 comments on commit acfd64f

Please sign in to comment.