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
This could be solved either by replacing var bind jet.VarMap with bind := make(jet.VarMap) or by checking if bind is nil (and makeing it if not) in Render right after if len(layout) > 0 {.
I would send a pull request, but I'm not sure if it matters to you which way it is fixed. I would think it would be much clearer to put it in jetVarMap and get rid of the other calls to make there, but I guess there was a reason to not do that in the first place.
The work around is for the caller of Render to just specify an empty jet.VarMap or fiber.Map but that is not obvious and panicing from forgetting is not great.
The text was updated successfully, but these errors were encountered:
The issue is that in
jetVarMap
it assumes that a nilbinding
should result in a niljet.VarMap
.template/jet/jet.go
Lines 233 to 237 in c4b2c7e
But if a layout is specified, it is then used to set a function and panics:
template/jet/jet.go
Lines 219 to 229 in c4b2c7e
This could be solved either by replacing
var bind jet.VarMap
withbind := make(jet.VarMap)
or by checking ifbind
is nil (andmake
ing it if not) inRender
right afterif len(layout) > 0 {
.Or in Render
I would send a pull request, but I'm not sure if it matters to you which way it is fixed. I would think it would be much clearer to put it in jetVarMap and get rid of the other calls to
make
there, but I guess there was a reason to not do that in the first place.The work around is for the caller of
Render
to just specify an emptyjet.VarMap
orfiber.Map
but that is not obvious andpanic
ing from forgetting is not great.The text was updated successfully, but these errors were encountered: