Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Funcs = map[string]interface{}{ "default": jet.Func(func(a jet.Arguments) reflect.Value { a.RequireNumOfArguments("default", 2, 2) arg0 := a.Get(0) ctx := a.Runtime().Context() if ctx.Kind() == reflect.Ptr { ctx = ctx.Elem() } switch ctx.Kind() { case reflect.Map: if r := ctx.MapIndex(arg0); r.IsValid() { return r } case reflect.Struct: if r := ctx.FieldByName(arg0.String()); r.IsValid() { return r } } ret := a.Runtime().Resolve(arg0.String()) if ret.Kind() != reflect.Invalid { return ret } return a.Get(1) }), "isZero": isZero, "trimPrefix": strings.TrimPrefix, "trimSuffix": strings.TrimSuffix, "join": strings.Join, "format": fmt.Sprintf, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.