all repos

gopher.nvim @ c1de269ef42d16f64745d2e8afb6fdbb8096f855

Minimalistic plugin for Go development

gopher.nvim/lua/gopher/gomod.lua(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local Job = require "plenary.job"

return function(...)
  local args = { ... }
  local cmd_args = vim.list_extend({ "mod" }, args)

  Job
    :new({
      command = "go",
      args = cmd_args,
      on_exit = function(_, retval)
        if retval ~= 0 then
          print("command exited with code " .. retval)
          return
        else
          print "command runs successfully"
        end
      end,
    })
    :start()
end