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

Add build tags 'g:go_build_tags' for gogetdoc #1702

Closed
wants to merge 1 commit into from
Closed

Add build tags 'g:go_build_tags' for gogetdoc #1702

wants to merge 1 commit into from

Conversation

larryzju
Copy link

@larryzju larryzju commented Mar 4, 2018

Specify build tags for gogetdoc command, with the g:go_build_tags setting.

@codecov-io
Copy link

Codecov Report

Merging #1702 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1702      +/-   ##
==========================================
- Coverage   19.73%   19.72%   -0.01%     
==========================================
  Files          57       57              
  Lines        4748     4750       +2     
==========================================
  Hits          937      937              
- Misses       3811     3813       +2
Flag Coverage Δ
#nvim 15.07% <0%> (-0.01%) ⬇️
#vim74 17.28% <0%> (-0.01%) ⬇️
#vim80 18.65% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
autoload/go/doc.vim 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c6a186...30a0731. Read the comment docs.

@@ -148,6 +148,11 @@ function! s:gogetdoc(json) abort
let pos = shellescape(fname.':#'.offset)

let cmd += ["-pos", pos]

if exists('g:go_build_tags')
let cmd += ["-tags", get(g:, 'go_build_tags')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test that this will work with multiple build tags? I'm, not 100% sure, but I think you need to do:

['-tags', go#util#Shellescape(get(g:, 'go_build_tags'))]

So that g:go_build_tags='foo bar' will be:

gogetdoc -tags 'foo bar' someident

Instead of:

gogetdoc -tags foo bar someIdent

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right, sorry for that changes. I had read the doc about build constraints again.
And I saw your commit #1705. That's much better. Thanks for your advice.

@larryzju larryzju closed this Mar 5, 2018
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.

3 participants