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
My concern here is that func (e *Event) Str(key, val string) *Event does not explicitly state that e is modified in-place. It only state it adds the field key... and it returns *Event. So this approach based on undocumented behavior of func (e *Event) Str.... Q: Can one day the behavior be changed, therefor this code stop working?
2.
Hi!
Which approach is the right one?
1.
My concern here is that
func (e *Event) Str(key, val string) *Event
does not explicitly state thate
is modified in-place. It only state itadds the field key...
and it returns*Event
. So this approach based on undocumented behavior offunc (e *Event) Str...
. Q: Can one day the behavior be changed, therefor this code stop working?2.
This approach is more robust, imo. But less readable. Should one always use this approach?
The text was updated successfully, but these errors were encountered: