fredrikaverpil / neotest-golang

Reliable Neotest adapter for running Go tests in Neovim.
MIT License
139 stars 17 forks source link

feat: use build flags for delve in dap-go config #178

Closed fredrikaverpil closed 2 months ago

fredrikaverpil commented 2 months ago

Why?

Build tags are not propagated to the internal dap-go config.

What?

This adds support for passing build flags to delve:

return {
  {
    "nvim-neotest/neotest",
    config = function()
      require("neotest").setup({
        adapters = {
          require("neotest-golang")({
            go_test_args = { "-count=1", "-tags=integration" },
            go_list_args = { "-tags=integration" },
            dap_go_opts = {
              delve = {
                build_flags = { "-tags=integration" },
              },
            },
          }),
        },
      })
    end,
  },
}