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 exclude-private option #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ascarter
Copy link

Added flag -exclude-private to chose to filter any symbols that are not public when building the tag file. This is very useful for building a tag file for the Go standard library or a third party API.

@jstemmer
Copy link
Owner

jstemmer commented Aug 3, 2015

Instead of checking p.excludeTag everywhere, you could replace all the p.tags = append(p.tags, tag) instances with a function p.add(tag) that adds a tag to the tags slice when it shouldn't be excluded.

continue
}
// Repeat each test - once with all symbols and once without private symbols
for _, excludePrivate := range []bool{false, true} {
Copy link
Owner

Choose a reason for hiding this comment

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

You could also just add an extra file in tests/, add a excludePrivate as a field in the testCases struct for this specific option and then test if the correct (exported only) tags are returned.

I understand why you'd want to do it this way, as this will check all the different types of tags in all the testfiles. However, I think I'd prefer not to treat this option as a special case compared to the other tests. What do you think?

Copy link
Author

Choose a reason for hiding this comment

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

Good point - was attempting to avoid redundancy but you are right - that it isn't a special case. Will change the tests.

Added flag `-exclude-private` to chose to filter any symbols that are not public when building the tag file. This is very useful for building a tag file for the Go standard library or a third party API.
@ascarter
Copy link
Author

ascarter commented Aug 5, 2015

Made requested changes and squashed commits

@ascarter
Copy link
Author

ascarter commented Oct 5, 2015

@jstemmer Just wanted to remind you that this is ready to go.

@jstemmer
Copy link
Owner

@ascarter a quick update: I'm in the middle of changing jobs (and moving to another country), so I haven't had time to check on my github projects. I should have a laptop and some time soon. I appreciate the time and effort you put into these PR's, sorry to keep you waiting.

@ascarter
Copy link
Author

@jstemmer - any chance you might be able to merge the two pending PR's I submitted? Would love to have this in there instead of managing my own fork.

Thanks!

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.

None yet

2 participants