Documentation ¶
Index ¶
- func CopyMap(m map[string]interface{}) map[string]interface{}
- func CopySlice(s []interface{}) []interface{}
- func FuncMap(t *template.Template) template.FuncMap
- func HasMajorChanges(l, r map[string]interface{}) bool
- func IsNotZero(v interface{}) bool
- func IsZero(v interface{}) bool
- func ParseTime(text string) (t time.Time, err error)
- func Sort(maps []map[string]interface{}, sortBy []string) []map[string]interface{}
- type MultiErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopySlice ¶ added in v0.7.0
func CopySlice(s []interface{}) []interface{}
CopySlice creates a deep copy of a slice.
func FuncMap ¶
FuncMap exports a set of functions in template.FuncMap format: - tmpl: execute a sub-template by name. Sub-templates are chosen from t namespace - tmplExec: execute a template text - tmplFile: execute a template stored in a file
func HasMajorChanges ¶ added in v0.7.0
HasMajorChanges is true if differences between l and r are deemed as significant. Importance of differences is measured field-by-field using a LCS-like distance. It is enough for one field to get less than 80% of similar runes to result in a true answer. Any field from l lacking in r or present in r but lacking in l is not seen as a significant change.
func IsNotZero ¶ added in v0.7.0
func IsNotZero(v interface{}) bool
IsNotZero checks whether the provided interface is not the zero value.
func IsZero ¶
func IsZero(v interface{}) bool
IsZero checks whether the provided interface is the zero value.
Types ¶
type MultiErrors ¶
type MultiErrors []error
MultiErrors represents a collection of errors.
func (*MultiErrors) Add ¶
func (c *MultiErrors) Add(err error)
Add adds a new error to the errors collection.
func (*MultiErrors) Addf ¶ added in v0.7.0
func (c *MultiErrors) Addf(format string, a ...interface{})
Addf adds a new error to errors collection using fmt.Errorf format.
func (*MultiErrors) Err ¶
func (c *MultiErrors) Err() error
Err returns nil if the errors collection is empty or nil, it returns itself otherwise.
func (*MultiErrors) Error ¶
func (c *MultiErrors) Error() (s string)
Error concatenates all errors in the collection. It allows to satisfy error interface.