Skip to content

Commit

Permalink
add support for goimports -srcdir in Format
Browse files Browse the repository at this point in the history
"goimports -srcdir" fixes problems with vendoring.
  • Loading branch information
mhamrle committed Feb 22, 2016
1 parent 065d714 commit 8b62f20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions autoload/go/fmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ function! go#fmt#Format(withGoimport)
if a:withGoimport != 1
let command = command . g:go_fmt_options
endif
if fmt_command == "goimports"
let command = command . '-srcdir ' . fnameescape(expand("%:p:h"))
endif

" execute our command...
let out = system(command . " " . l:tmpname)
Expand Down

0 comments on commit 8b62f20

Please sign in to comment.