Documentation ¶
Index ¶
- func Method(value reflect.Value, name string) reflect.Value
- func ResolveField(data interface{}, field string) (value interface{}, exists bool)
- func ResolveFinal(value interface{}) interface{}
- func ToBytes(data interface{}) []byte
- func ToFloat(data interface{}) (float64, bool)
- func ToInt(data interface{}) (int, bool)
- func ToLength(input interface{}) (int, bool)
- func ToString(data interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveField ¶
Resolves the value of field within data
func ResolveFinal ¶
func ResolveFinal(value interface{}) interface{}
This is necessary in the case where the value references a struct directly:
template := "{{ user }}"" data := map[string]interface{}{"user": &User{"Leto"}},
Without this step, the above would result in a value which points to the User we need to resolve this a step further and get the value of "User" (which will either me the output of its String() method, or %v)
Of course, we only want this final resolution once we need the value. If we call this too early, say in Resolve above, we won't be able to build nested paths
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.