Skip to content

Commit

Permalink
GoImpl: support relative (vendor) imports
Browse files Browse the repository at this point in the history
  * attempt to use `-dir` argument from josharian/impl#18 if `impl`
    fails.
  * backwards compatible with previous `impl` versions.
  • Loading branch information
boz committed Jun 7, 2017
1 parent bf9cdc2 commit 0b32585
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions autoload/go/impl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ function! go#impl#Impl(...) abort

let result = go#util#System(printf("%s '%s' '%s'", binpath, recv, iface))
if go#util#ShellError() != 0
call go#util#EchoError(result)
return
call go#util#EchoWarning("impl failed. trying with package path")

let s:dirname = fnameescape(expand('%:p:h'))
let result = go#util#System(printf("%s -dir '%s' '%s' '%s'", binpath, s:dirname, recv, iface))
if go#util#ShellError() != 0
call go#util#EchoError(result)
return
end
endif

if result ==# ''
Expand Down

0 comments on commit 0b32585

Please sign in to comment.