[mirror] Make your go dev experience better github.com/olexsmir/gopher.nvim
neovim golang

feat(gotests): add generate all tests

docs(gotests): add generate all tests

Changed files
+18
lua
plugin
+7
README.md
··· 3 3 Minimalistic plugin for Go development in Neovim written in Lua. 4 4 5 5 It's not an LSP tool, the main goal of this plugin add go tooling support in neovim. 6 + 6 7 ## Install 7 8 8 9 Pre-dependency: [go](https://github.com/golang/go) (tested on 1.17 and 1.18) ··· 84 85 85 86 ```vim 86 87 :GoTestAdd 88 + ``` 89 + 90 + Generate all tests for all functions/methods in current file 91 + 92 + ```vim 93 + :GoTestsAll 87 94 ``` 88 95 89 96 7. Run `go generate` command
+9
lua/gopher/gotests.lua
··· 45 45 add_test(cmd_args) 46 46 end 47 47 48 + function M.all_tests(parallel) 49 + local cmd_args = { "-all" } 50 + if parallel then 51 + table.insert(cmd_args, "-parallel") 52 + end 53 + 54 + add_test(cmd_args) 55 + end 56 + 48 57 return M
+1
lua/gopher/init.lua
··· 10 10 gopher.impl = require "gopher.impl" 11 11 gopher.generate = require "gopher.gogenerate" 12 12 gopher.test_add = gotests.one_test 13 + gopher.tests_all = gotests.all_tests 13 14 14 15 return gopher
+1
plugin/gopher.vim
··· 1 1 command! -nargs=* GoTagAdd :lua require"gopher".tags_add(<f-args>) 2 2 command! -nargs=* GoTagRm :lua require"gopher".tags_rm(<f-args>) 3 3 command! -nargs=* GoTestAdd :lua require"gopher".test_add(<f-args>) 4 + command! -nargs=* GoTestsAll :lua require"gopher".tests_all(<f-args>) 4 5 command! -nargs=* GoMod :lua require"gopher".mod(<f-args>) 5 6 command! -nargs=* GoGet :lua require"gopher".get(<f-args>) 6 7 command! -nargs=* GoImpl :lua require"gopher".impl(<f-args>)