goimports fixer doesn't work for vendored libraries

In Go you can "vendor" packages by putting them in the `vendor/`
directory for a project. Adding the `-srcdir` argument makes `goimports`
pick up these packages, in addition to what you have in GOPATH.

Without this, `goimports` is not very useful, since most projects vendor
their packages.
This commit is contained in:
Martin Tournoij
2017-12-06 13:04:31 +00:00
parent 7d932a239c
commit 92f20b0e51
2 changed files with 3 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ function! ale#fixers#goimports#Fix(buffer) abort
return {
\ 'command': ale#Escape(l:executable)
\ . ' -l -w'
\ . ' -l -w -srcdir %s'
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' %t',
\ 'read_temporary_file': 1,