summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorMartin Tournoij <martin@arp242.net>2017-12-06 13:04:31 +0000
committerMartin Tournoij <martin@arp242.net>2017-12-08 12:49:02 +0000
commit92f20b0e516526294fb933bd5640a1f5f1c0671a (patch)
tree540e2c2746133557693a7558f58907c8e27e89c1 /autoload
parent7d932a239c0d4db4d19a39b410283fdfc72b7f3e (diff)
downloadale-92f20b0e516526294fb933bd5640a1f5f1c0671a.zip
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.
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fixers/goimports.vim2
1 files changed, 1 insertions, 1 deletions
diff --git a/autoload/ale/fixers/goimports.vim b/autoload/ale/fixers/goimports.vim
index f5695136..783d0206 100644
--- a/autoload/ale/fixers/goimports.vim
+++ b/autoload/ale/fixers/goimports.vim
@@ -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,