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

#1142: go_metalinter_deadline applies in async mode now #1146

Merged
merged 1 commit into from
Jan 7, 2017
Merged

#1142: go_metalinter_deadline applies in async mode now #1146

merged 1 commit into from
Jan 7, 2017

Conversation

horgh
Copy link
Contributor

@horgh horgh commented Dec 18, 2016

This change is for issue #1142.

Previous to this change, the option g:go_metalinter_deadline would only
be respected when calling gometalinter if we called it synchronously.

This change removes the default value of g:go_metalinter_deadline of 5
seconds.

For async mode: We pass in a --deadline option now only if we've defined
g:go_metalinter_deadline. For sync mode: We always pass in a --deadline
value. If g:go_metalinter_deadline is not set, we pass in 5 seconds.

Please note that gometalinter itself has a default deadline of 5 seconds
if no deadline is passed to it, so in either case the default of 5
seconds will apply.

This change is for issue #1142.

Previous to this change, the option g:go_metalinter_deadline would only
be respected when calling gometalinter if we called it synchronously.

This change removes the default value of g:go_metalinter_deadline of 5
seconds.

For async mode: We pass in a --deadline option now only if we've defined
g:go_metalinter_deadline. For sync mode: We always pass in a --deadline
value. If g:go_metalinter_deadline is not set, we pass in 5 seconds.

Please note that gometalinter itself has a default deadline of 5 seconds
if no deadline is passed to it, so in either case the default of 5
seconds will apply.
@horgh
Copy link
Contributor Author

horgh commented Dec 18, 2016

I should mention: I did look at the doc/vim-go.txt and it looks like the information about this option is still valid.

I tried to follow the approach you requested in the issue I opened. However as you can see, I found that gometalinter has a deadline of 5s even if no --deadline is specified. It may make sense to simply apply the same logic for async and sync mode (always pass in a deadline). Since in either case the default will still be 5 seconds, just in the async case we do not specify it at all.

I tested this:

In async mode:

  • If no deadline configured, none was passed in.
  • If a deadline is configured, it is passed in.

In sync mode:

  • If no deadline configured, 5s was passed in.
  • If a deadline is configured, it was passed in.

Please let me know if you see anything I should change.

Thanks again!

@fatih fatih merged commit 41f5fd1 into fatih:master Jan 7, 2017
@fatih
Copy link
Owner

fatih commented Jan 7, 2017

Thanks @horgh for the contribution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants