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

Make various anonymous fields named #2419

Merged
merged 1 commit into from
Apr 6, 2017
Merged

Make various anonymous fields named #2419

merged 1 commit into from
Apr 6, 2017

Conversation

bboreham
Copy link
Collaborator

@bboreham bboreham commented Apr 1, 2017

Anonymous fields make any methods on the inner object visible on the outer, so they should only be used when the outer is-a inner.

I wanted to make this change after spending several hours puzzled why the code ended up in a particular method that didn't have anything to do with what it was being called upon.

To create this PR I looked at every struct in the Scope codebase, apart from unit tests. There are very few anonymous fields overall, with some such as Mutex correctly used. In a couple of cases I gave the benefit of the doubt.

Anonymous fields make any methods on the inner object visible on the
outer, so they should only be used when the outer is-a inner.
@2opremio 2opremio merged commit a404d82 into master Apr 6, 2017
@2opremio 2opremio deleted the name-unnamed branch April 6, 2017 12:16
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