-
Notifications
You must be signed in to change notification settings - Fork 56
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
added partial helper #72
Conversation
partial_helper.go
Outdated
help.Context.data[k] = v | ||
} | ||
|
||
pf, ok := help.Context.data["partialFeeder"].(func(string) (string, error)) |
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.
Type check against PartialFeeder here
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.
Can I just use below here?
var pf PartialFeeder
I think it is just func(string) (string, error)
so if the interface data["partialFeeder"]
not match, it will not ok
anyway.
I’ll test this in a few hours when my day officially starts. :) Can you write or test or two? |
Oh, I also think the same thing and I like test as much as buffalo (and your test kits) :-) |
partial_helper.go
Outdated
help.Context.data[k] = v | ||
} | ||
|
||
pf, ok := help.Context.data["partialFeeder"].(func(string) (string, error)) |
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.
pf, ok := help.Context.data["partialFeeder"].(func(string) (string, error)) | |
pf, ok := help.Context.data["partialFeeder"].(PartialFeeder) |
Hi @markbates, and all buffalo lovers
I added plush's own partial helper. It does not directly affect any of applications using plush because of it just add new things. But for buffalo, the order to fill
data
/helper
is important since it can be overrided by one of them. (Please consider minor version changing if needed.)For references:
It related to issue "context not passed when
partial
used withinfor
loop" (gobuffalo/buffalo#1406) and should be merged before PR for buffalo (gobuffalo/buffalo#1411) which depends on this change.