You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regarding the WithFunc, it was added just for more flexibility should a field value depends on context or anything else.
YAGNI. Can you give a specific example of a problem it solves? I can give an example of a problem it introduces: you've now got a way to get into an infinite loop without really realising it.
fields.WithFunc("foo", func(ctx context.Context) interface{} {
returnutil.getValueOfFoo(ctx)
}).Onto(ctx)
// somewhere else, some utility package etcfuncgetValueOfFoo(ctx context.Context) string {
log.From(ctx).Info("getting value of foo") // infinite recursion herereturn"bar"
}
YAGNI. Can you give a specific example of a problem it solves? I can give an example of a problem it introduces: you've now got a way to get into an infinite loop without really realising it.
Originally posted by @jamesrom in #18 (comment)
The text was updated successfully, but these errors were encountered: