| GoBuild args | go build args (-g: enable debug, %: expand to current file, %:h expand to current package) |
| GoGenerate | |
@ -298,6 +297,7 @@ plugin.
| GoTest -parallel {number} | test current package with parallel number |
| GoTest -b {build_flags} | run `go test` with build flags e.g. `-gcflags=.` |
| GoTest -t yourtags | go test ./... -tags=yourtags, see notes |
| GoTest -F ./... \| awk '{$1=$1};1' \| delta | pipe the test output to awk and then delta/diff-so-fancy to show diff output of go test (e.g. testify) |
| GoTest -a your_args | go test ./... -args=yourargs, see notes |
| GoTest package_path -t yourtags | go test packagepath -tags=yourtags |
| GoTest package_path -t yourtags other_args | go test packagepath -tags=yourtags other_args |
@ -843,10 +843,10 @@ require('go').setup({
dap_retries = 20, -- see dap option max_retries
build_tags = "tag1,tag2", -- set default build tags
textobjects = true, -- enable default text objects through treesittter-text-objects
test_runner = 'go', -- one of {`go`, `richgo`,`dlv`, `ginkgo`, `gotestsum`}
test_runner = 'go', -- one of {`go`, `dlv`, `ginkgo`, `gotestsum`}
verbose_tests = true, -- set to add verbose flag to tests deprecated, see '-v' option
run_in_floaterm = false, -- set to true to run in a float window. :GoTermClose closes the floatterm
-- float term recommend if you use richgo/ginkgo with terminal color
-- float term recommend if you use gotestsum ginkgo with terminal color
floaterm = { -- position
posititon = 'auto', -- one of {`top`, `bottom`, `left`, `right`, `center`, `auto`}
@ -1021,10 +1021,9 @@ issues, e.g. [navigator.lua](https://github.com/ray-x/navigator.lua),
[Nvim-tree](https://github.com/kyazdani42/nvim-tree.lua) and
[Bufferline](https://github.com/akinsho/nvim-bufferline.lua) also introduced lsp diagnostic hooks.
> [!IMPORTANT]
> I will integrate more gopls functions into go.nvim, please make sure you have the latest version installed
> Also, enable gopls experimental features if it is configure somewhere other than go.nvim
> Otherwise, set `lsp_cfg` to `true` in your go.nvim setup to enable gopls setup in go.nvim
> [!IMPORTANT] I will integrate more gopls functions into go.nvim, please make sure you have the latest version
> installed Also, enable gopls experimental features if it is configure somewhere other than go.nvim Otherwise, set
> `lsp_cfg` to `true` in your go.nvim setup to enable gopls setup in go.nvim
<details>
<summary>Gopls default settings in go.nvim</summary>