MCPcopy Create free account
hub / github.com/kataras/iris / initSet

Method initSet

view/jet.go:271–290  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

269}
270
271func (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
292type (
293 // JetRuntimeVars is a type alias for `jet.VarMap`.

Callers 1

ParseTemplateMethod · 0.95

Calls 1

IsNoOpFSFunction · 0.92

Tested by

no test coverage detected