()
| 269 | } |
| 270 | |
| 271 | func (s *JetEngine) initSet() { |
| 272 | s.mu.Lock() |
| 273 | if s.Set == nil { |
| 274 | var opts = []jet.Option{ |
| 275 | jet.WithDelims(s.left, s.right), |
| 276 | } |
| 277 | if s.developmentMode && !context.IsNoOpFS(s.fs) { |
| 278 | // this check is made to avoid jet's fs lookup on noOp fs (nil passed by the developer). |
| 279 | // This can be produced when nil fs passed |
| 280 | // and only `ParseTemplate` is used. |
| 281 | opts = append(opts, jet.InDevelopmentMode()) |
| 282 | } |
| 283 | |
| 284 | s.Set = jet.NewSet(s.loader, opts...) |
| 285 | for key, value := range s.vars { |
| 286 | s.Set.AddGlobal(key, value) |
| 287 | } |
| 288 | } |
| 289 | s.mu.Unlock() |
| 290 | } |
| 291 | |
| 292 | type ( |
| 293 | // JetRuntimeVars is a type alias for `jet.VarMap`. |
no test coverage detected