|
|
|
@ -4,9 +4,9 @@ local api = vim.api
|
|
|
|
|
local utils = require("go.utils")
|
|
|
|
|
local log = utils.log
|
|
|
|
|
local max_len = _GO_NVIM_CFG.max_line_len or 120
|
|
|
|
|
local goimport = _GO_NVIM_CFG.goimport ~= nil and _GO_NVIM_CFG.goimport or "gofumports"
|
|
|
|
|
local gofmt = _GO_NVIM_CFG.gofmt ~= nil and _GO_NVIM_CFG.gofmt or "gofumpt"
|
|
|
|
|
local gofmt_args = _GO_NVIM_CFG.gofmt_args and _GO_NVIM_CFG.gofmt_args
|
|
|
|
|
local goimport = _GO_NVIM_CFG.goimport or "gofumports"
|
|
|
|
|
local gofmt = _GO_NVIM_CFG.gofmt or "gofumpt"
|
|
|
|
|
local gofmt_args = _GO_NVIM_CFG.gofmt_args
|
|
|
|
|
or {"--max-len=" .. tostring(max_len), "--base-formatter=" .. gofmt}
|
|
|
|
|
|
|
|
|
|
local goimport_args = _GO_NVIM_CFG.goimport_args
|
|
|
|
@ -115,8 +115,8 @@ M.goimport = function(...)
|
|
|
|
|
if args and _GO_NVIM_CFG.goimport == 'goimports' then
|
|
|
|
|
run(args, true, 'goimports')
|
|
|
|
|
else
|
|
|
|
|
utils.copy_array(goimport_args, a)
|
|
|
|
|
run({}, true)
|
|
|
|
|
-- utils.copy_array(goimport_args, a)
|
|
|
|
|
run(goimport_args, true)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|