Skip to content

Commit

Permalink
docs: update docs by mentioning setting delve build tags
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil committed Sep 7, 2024
1 parent 2f07c72 commit ae5c44f
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,33 @@ feature... 🙈

If you need to set build tags (like e.g. `-tags debug` or `-tags "tag1 tag2"`),
you need to provide these arguments both in the `go_test_args` and
`go_list_args` adapter options.
`go_list_args` adapter options. If you want to be able to debug, you also need
to set `dap_go_opts`. Full example:

> !TIP
```lua
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,
},
}
```

> [!TIP]
>
> Depending on how you have Neovim setup, you can define this on a per-project
> basis by placing a `.lazy.lua` with overrides in the project. This requires
Expand Down

0 comments on commit ae5c44f

Please sign in to comment.