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 new g:go_addtags_skip_unexported option #2660

Merged
merged 5 commits into from
Feb 8, 2020
Merged

Conversation

igrmk
Copy link
Contributor

@igrmk igrmk commented Jan 18, 2020

Tool gomodifytags now has -skip-private option for adding tags only to public fields

This PR mirrors this option in vim config

For example you may have following struct

type Struct struct {
    Public  int
    private int
}

Currently GoAddTags command would add these tags

type Struct struct {
    Public  int `json:"public"`
    private int `json:"private"`
}

With new option it would add

type Struct struct {
    Public  int `json:"public"`
    private int
}

@igrmk igrmk force-pushed the skip-private branch 2 times, most recently from 8417354 to d3a2549 Compare January 18, 2020 17:47
@bhcleek
Copy link
Collaborator

bhcleek commented Jan 18, 2020

Given that :GoAddTags can take a range of line to operate on, what's the value in adding this configuration option that will apply to every invocation?

@igrmk
Copy link
Contributor Author

igrmk commented Jan 18, 2020

I personally never need tags for private fields. So it is just much simpler for me. I don't need to select a range with this option

@bhcleek
Copy link
Collaborator

bhcleek commented Jan 31, 2020

The flag name for gomodifytags has changed. Would you be willing to update this PR similarly?

@igrmk
Copy link
Contributor Author

igrmk commented Jan 31, 2020

PR is updated according to new flag name

@bhcleek
Copy link
Collaborator

bhcleek commented Feb 4, 2020

Thanks @igrmk

Do you mind if I rebase and push a fix for a couple of nitpicks to your branch before I merge?

@igrmk
Copy link
Contributor Author

igrmk commented Feb 4, 2020

Please go ahead! Thanks @bhcleek

@bhcleek
Copy link
Collaborator

bhcleek commented Feb 8, 2020

Thanks for contributing @igrmk !

@bhcleek bhcleek merged commit ccb265a into fatih:master Feb 8, 2020
@bhcleek bhcleek changed the title Add new g:go_addtags_skip_private option Add new g:go_addtags_skip_unexported option Feb 8, 2020
bhcleek added a commit that referenced this pull request Feb 8, 2020
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