Created
August 29, 2021 21:32
-
-
Save ocidenttal/dd5f6e6c14cf6fe9e5beced3e61014e4 to your computer and use it in GitHub Desktop.
This solves the error message raised by coc.nvim with gopls language server when the imports are already organized.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" instead of this | |
" (this will send error messages to your vim/neovim everytime you save a .go file | |
" and the imports are already organized) | |
autocmd! BufWritePre *.go :call CocAction('runCommand', 'editor.action.organizeImport') | |
" use the `silent` command before `call` | |
autocmd BufWritePre *.go :silent call CocAction('runCommand', 'editor.action.organizeImport') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment