diff --git a/autoload/go/impl.vim b/autoload/go/impl.vim index 4bbceeb242..d498e7f150 100644 --- a/autoload/go/impl.vim +++ b/autoload/go/impl.vim @@ -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 ==# ''