Currently, these lines of code is not enough to run GoFmt on save which runs golines which formats long lines of code.
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
require('go.format').goimport()
end,
group = format_sync_grp,
})
require('go').setup({
max_line_len = 80, -- max line length in golines format, Target maximum line length for golines
})
Currently, these lines of code is not enough to run GoFmt on save which runs
golines
which formats long lines of code.How is it possible to run
GoFmt
command on save?