mirror of https://github.com/dense-analysis/ale
Use stdin/stdout to communicate with gofmt
This commit is contained in:
parent
b91c6c2edd
commit
96ec33e6d6
|
@ -11,9 +11,6 @@ function! ale#fixers#gofmt#Fix(buffer) abort
|
||||||
|
|
||||||
return {
|
return {
|
||||||
\ 'command': l:env . ale#Escape(l:executable)
|
\ 'command': l:env . ale#Escape(l:executable)
|
||||||
\ . ' -l -w'
|
|
||||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||||
\ . ' %t',
|
|
||||||
\ 'read_temporary_file': 1,
|
|
||||||
\}
|
\}
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
@ -21,10 +21,7 @@ Execute(The gofmt callback should return the correct default values):
|
||||||
|
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ {
|
\ {
|
||||||
\ 'read_temporary_file': 1,
|
\ 'command': ale#Escape('xxxinvalid'),
|
||||||
\ 'command': ale#Escape('xxxinvalid')
|
|
||||||
\ . ' -l -w'
|
|
||||||
\ . ' %t',
|
|
||||||
\ },
|
\ },
|
||||||
\ ale#fixers#gofmt#Fix(bufnr(''))
|
\ ale#fixers#gofmt#Fix(bufnr(''))
|
||||||
|
|
||||||
|
@ -35,11 +32,8 @@ Execute(The gofmt callback should include custom gofmt options):
|
||||||
|
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ {
|
\ {
|
||||||
\ 'read_temporary_file': 1,
|
|
||||||
\ 'command': ale#Escape('xxxinvalid')
|
\ 'command': ale#Escape('xxxinvalid')
|
||||||
\ . ' -l -w'
|
\ . ' ' . g:ale_go_gofmt_options,
|
||||||
\ . ' ' . g:ale_go_gofmt_options
|
|
||||||
\ . ' %t',
|
|
||||||
\ },
|
\ },
|
||||||
\ ale#fixers#gofmt#Fix(bufnr(''))
|
\ ale#fixers#gofmt#Fix(bufnr(''))
|
||||||
|
|
||||||
|
@ -50,9 +44,7 @@ Execute(The gofmt callback should support Go environment variables):
|
||||||
|
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ {
|
\ {
|
||||||
\ 'read_temporary_file': 1,
|
|
||||||
\ 'command': ale#Env('GO111MODULE', 'off')
|
\ 'command': ale#Env('GO111MODULE', 'off')
|
||||||
\ . ale#Escape('xxxinvalid') . ' -l -w'
|
\ . ale#Escape('xxxinvalid')
|
||||||
\ . ' %t',
|
|
||||||
\ },
|
\ },
|
||||||
\ ale#fixers#gofmt#Fix(bufnr(''))
|
\ ale#fixers#gofmt#Fix(bufnr(''))
|
||||||
|
|
Loading…
Reference in New Issue