-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Remove all Context.Global* methods #410
Conversation
and change the behavior of the non-Global variants to always search up the context lineage. Closes #385
lineage := []*Context{} | ||
cur := c | ||
|
||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like you could shrink this up by doing something like:
for cur := c; cur != nil; cur = cur.parentContext {
lineage = append(lineage, cur)
}
👏 I'm super happy to see this. Do you think you could add a couple of tests testing:
❤️ |
setFlags map[string]bool | ||
globalSetFlags map[string]bool | ||
parentContext *Context | ||
App *App |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 This reduced signature feels much better.
Beautiful. |
and change the behavior of the non-Global variants to always search up the
context lineage.
Closes #385