Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
optimized go#package#Paths
  • Loading branch information
unknown authored and unknown committed Jun 27, 2014
1 parent f82c485 commit 83b80a7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions autoload/go/package.vim
Expand Up @@ -31,13 +31,15 @@ endif
function! go#package#Paths()
let dirs = []

if executable('go')
let goroot = substitute(system('go env GOROOT'), '\n', '', 'g')
if v:shell_error
echomsg '''go env GOROOT'' failed'
endif
else
if exists('$GOROOT')
let goroot = $GOROOT
else
if executable('go')
let goroot = substitute(system('go env GOROOT'), '\n', '', 'g')
if v:shell_error
echomsg '''go env GOROOT'' failed'
endif
endif
endif

if len(goroot) != 0 && isdirectory(goroot)
Expand Down

0 comments on commit 83b80a7

Please sign in to comment.