Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: /dev/null is not supported with go build #567

Merged
merged 1 commit into from
Oct 18, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion autoload/go/cmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ function! go#cmd#Build(bang, ...)
let old_gopath = $GOPATH
let $GOPATH = go#path#Detect()

let l:tmpname = tempname()

if v:shell_error
let &makeprg = "go build . errors"
else
" :make expands '%' and '#' wildcards, so they must also be escaped
let goargs = go#util#Shelljoin(map(copy(a:000), "expand(v:val)"), 1)
let gofiles = go#util#Shelljoin(go#tool#Files(), 1)
let &makeprg = "go build -o /dev/null " . goargs . ' ' . gofiles
let &makeprg = "go build -o " . l:tmpname . ' ' . goargs . ' ' . gofiles
endif

echon "vim-go: " | echohl Identifier | echon "building ..."| echohl None
Expand All @@ -45,6 +47,7 @@ function! go#cmd#Build(bang, ...)
redraws! | echon "vim-go: " | echohl Function | echon "[build] SUCCESS"| echohl None
endif

call delete(l:tmpname)
let &makeprg = default_makeprg
let $GOPATH = old_gopath
endfunction
Expand Down