Skip to content

Commit 204e566

Browse files
author
Richard Johnson
committed
Merge pull request #4 from hoffoo/master
Use environment's $GOPATH if set
2 parents a8f4f7c + 8866629 commit 204e566

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/golang.vim

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ au CursorMoved <buffer> call s:GetGolangMessage()
7575
if exists('golang_goroot')
7676
let $GOROOT=golang_goroot
7777
endif
78-
let $GOPATH=substitute(expand("%:p:h"),"\\(.*\\)/src.*","\\1",'g')
78+
if empty($GOPATH)
79+
let $GOPATH=substitute(expand("%:p:h"),"\\(.*\\)/src.*","\\1",'g')
80+
endif
7981
let $PATHESCAPED=substitute(expand("%:p:h"),"\/","\\\\/",'g')
8082
CompilerSet makeprg=cd\ %:p:h;\ $GOROOT/bin/go\ build\ 2>&1\\\|sed\ -e\ \'s\/^\\(.*\\)\.go/$PATHESCAPED\\/\\1.go\/g\'
8183
CompilerSet efm=%f:%l:%m

0 commit comments

Comments
 (0)