Closed ttbug closed 1 year ago
Most likely you have other format tools hooked into BufWritePre As currently goimport is async by default if you set it to use gopls. Autocommand from other setups may overwrite the buffer.
Most likely you have other format tools hooked into BufWritePre As currently goimport is async by default if you set it to use gopls. Autocommand from other setups may overwrite the buffer.
I have carefully reviewed my settings and indeed, such an issue existed. After making modifications, the problem has been resolved. Thank you very much.
local format_sync_grp = vim.api.nvim_create_augroup("GoImport", {}) vim.api.nvim_create_autocmd("BufWritePre", { pattern = "*.go", callback = function() require('go.format').goimport() end, group = format_sync_grp, })
when update to commit c61f9371cdaaec40cccf0783ff968bee83df5bda, could not save go file,write command is not working remove goimport config upon or rollback to last commit,format and import on write command works well.