diff --git a/autoload/go/lint.vim b/autoload/go/lint.vim index f68b30b779..5f3e2cf5da 100644 --- a/autoload/go/lint.vim +++ b/autoload/go/lint.vim @@ -6,6 +6,10 @@ if !exists("g:go_metalinter_enabled") let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck'] endif +if !exists("g:go_metalinter_deadline") + let g:go_metalinter_deadline = "5s" +endif + if !exists("g:go_golint_bin") let g:go_golint_bin = "golint" endif @@ -37,6 +41,8 @@ function! go#lint#Gometa(...) abort let meta_command .= " --enable=".linter endfor + " deadline + let meta_command .= " --deadline=" . g:go_metalinter_deadline let meta_command .= " " . goargs else diff --git a/doc/vim-go.txt b/doc/vim-go.txt index 0754f68ba5..185a74b5d6 100644 --- a/doc/vim-go.txt +++ b/doc/vim-go.txt @@ -845,7 +845,14 @@ an advanced settings and is for users who want to have a complete control over of how `gometalinter` should be executed. By default it's empty. > let g:go_metalinter_command = "" +< + *'g:go_metalinter_deadline'* +Overrides the maximum time the linters have to complete By default it's 5 +seconds. +> + let g:go_metalinter_deadline = "5s" +< =============================================================================== TROUBLESHOOTING *go-troubleshooting*