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

gen-accessors: skip Client struct and unexported fields #794

Merged
merged 4 commits into from Dec 2, 2017

Conversation

Projects
None yet
3 participants
@sahildua2305
Collaborator

sahildua2305 commented Nov 23, 2017

Make gen-accessors.go skip certain struct and fields while creating
accessor methods for structs and fields. Basically, now we have two more
blacklists (blacklistStruct and blacklistField) respectively for
blacklisted structs and fields.

So, for every struct, it should first check and skip if the struct
is in blacklist.
Then, for every field, it should first check and skip if the struct
is in blacklist.

Fixes #778

@googlebot googlebot added the cla: yes label Nov 23, 2017

sahildua2305 added some commits Nov 22, 2017

gen-accessors: skip Client struct and unexported fields
Make gen-accessors.go skip certain struct and fields while creating
accessor methods for structs and fields. Basically, now we have two more
blacklists (blacklistStruct and blacklistField) respectively for
blacklisted structs and fields.

So, for every struct, it should first check and skip if the struct
is in blacklist.
Then, for every field, it should first check and skip if the struct
is in blacklist.
gen-accessors: fix list of blacklisted structs and fields
- Remove "service" from list of blacklisted fields because that was a
  mistake in the previous commit.
- Add "service" to list of blacklisted structs because it  would make
  more sense to not generate accessors for its fields.
- Remove all debug printf statements.
Show outdated Hide outdated github/gen-accessors.go Outdated
@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Dec 2, 2017

Member

Looks good so far, thanks @sahildua2305! I'll apply some comment formatting improvements and code simplifications, and then merge.

Member

dmitshur commented Dec 2, 2017

Looks good so far, thanks @sahildua2305! I'll apply some comment formatting improvements and code simplifications, and then merge.

@googlebot

This comment has been minimized.

Show comment
Hide comment
@googlebot

googlebot Dec 2, 2017

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

googlebot commented Dec 2, 2017

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added cla: no and removed cla: yes labels Dec 2, 2017

@dmitshur

LGTM. Thanks again!

@dmitshur dmitshur merged commit fbfee05 into google:master Dec 2, 2017

1 of 2 checks passed

cla/google CLAs are signed, but unable to verify author consent
continuous-integration/travis-ci/pr The Travis CI build passed
Details

nbareil pushed a commit to nbareil/go-github that referenced this pull request May 1, 2018

Remove generated accessors for Client struct and unexported fields. (g…
…oogle#794)

This change makes gen-accessors.go skip the following structs and fields
from consideration when generating accessor methods:

1.	Unexported structs and fields are skipped. They're unexported,
	and shouldn't have accessors.
2.	Client struct is explicitly blacklistd and skipped. It was not meant
	to have accessors, and it doesn't need them.

The generated accessors that are removed were added relatively recently,
and it's not likely they were used since that time.

Resolves google#778.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment