1
0
Fork 0
mirror of synced 2024-05-28 13:01:12 -04:00
ultimate-vim/sources_non_forked/ale/autoload/ale/fixers/gofmt.vim
2020-12-04 22:15:32 +01:00

17 lines
513 B
VimL

" Author: aliou <code@aliou.me>
" Description: Integration of gofmt with ALE.
call ale#Set('go_gofmt_executable', 'gofmt')
call ale#Set('go_gofmt_options', '')
function! ale#fixers#gofmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'go_gofmt_executable')
let l:options = ale#Var(a:buffer, 'go_gofmt_options')
let l:env = ale#go#EnvString(a:buffer)
return {
\ 'command': l:env . ale#Escape(l:executable)
\ . (empty(l:options) ? '' : ' ' . l:options)
\}
endfunction