Skip to content

Commit

Permalink
refactor(api)!: mave tags and gotests api into their sub tables
Browse files Browse the repository at this point in the history
  • Loading branch information
olexsmir committed Feb 24, 2024
1 parent ebb10e9 commit 28e1f56
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
16 changes: 10 additions & 6 deletions lua/gopher/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ gopher.impl = require("gopher.impl").impl
gopher.iferr = require("gopher.iferr").iferr
gopher.comment = require "gopher.comment"

gopher.tags_add = tags.add
gopher.tags_rm = tags.remove

gopher.test_add = tests.func_test
gopher.test_exported = tests.all_exported_tests
gopher.tests_all = tests.all_tests
gopher.tags = {
add = tags.add,
rm = tags.remove,
}

gopher.test = {
add = tests.func_test,
exported = tests.all_exported_tests,
all = tests.all_tests,
}

gopher.get = function(...)
gocmd("get", { ... })
Expand Down
10 changes: 5 additions & 5 deletions plugin/gopher.vim
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
command! -nargs=* GoTagAdd :lua require"gopher".tags_add(<f-args>)
command! -nargs=* GoTagRm :lua require"gopher".tags_rm(<f-args>)
command! GoTestAdd :lua require"gopher".test_add()
command! GoTestsAll :lua require"gopher".tests_all()
command! GoTestsExp :lua require"gopher".test_exported()
command! -nargs=* GoTagAdd :lua require"gopher".tags.add(<f-args>)
command! -nargs=* GoTagRm :lua require"gopher".tags.rm(<f-args>)
command! GoTestAdd :lua require"gopher".test.add()
command! GoTestsAll :lua require"gopher".test.all()
command! GoTestsExp :lua require"gopher".test.exported()
command! -nargs=* GoMod :lua require"gopher".mod(<f-args>)
command! -nargs=* GoGet :lua require"gopher".get(<f-args>)
command! -nargs=* GoWork :lua require"gopher".work(<f-args>)
Expand Down

0 comments on commit 28e1f56

Please sign in to comment.