Proposal:
What if there be some settings which allow automatically start
GoBuild on save ".go" file and GoTes on save "_test.go" file.
I would be happy about it.
You can already add this yourself with an autocmd; for example:
" Build/Test on save.
augroup auto_go
autocmd!
autocmd BufWritePost *.go :GoBuild
autocmd BufWritePost *_test.go :GoTest
augroup end
In addition, I think you can use gometalinter to run tests too (let g:go_metalinter_autosave_enabled = ['test', 'vet', 'golint']? Didn't test).
g:go_metalinter_autosave_enabled ['vet', 'golint', 'test']
doesn't work for me
Did you read the documentation? I have no idea if that is a valid setting, but from memory I believe something like that should work (I could be mistaken!)
Either way, the autocmd should work for you.
Hi @korjavin
There is no autobuild by default, you can use the command that @Carpetsmoker provided. Also the following indeed works for me
let g:go_metalinter_autosave_enabled = ['vet', 'golint', 'test']
In your case the = is missing (not sure if that is related). Thanks for the feedback.
Most helpful comment
You can already add this yourself with an
autocmd; for example:In addition, I think you can use gometalinter to run tests too (
let g:go_metalinter_autosave_enabled = ['test', 'vet', 'golint']? Didn't test).