1
0
Fork 0

Remove github.com/satori/go.uuid.

This commit is contained in:
Ludovic Fernandez 2019-04-05 12:44:03 +02:00 committed by Traefiker Bot
parent e1d097ea20
commit 2e19e45aa4
25 changed files with 1027 additions and 365 deletions

View file

@ -27,10 +27,12 @@ func pluck(key string, d ...map[string]interface{}) []interface{} {
return res
}
func keys(dict map[string]interface{}) []string {
func keys(dicts ...map[string]interface{}) []string {
k := []string{}
for key := range dict {
k = append(k, key)
for _, dict := range dicts {
for key := range dict {
k = append(k, key)
}
}
return k
}
@ -75,10 +77,31 @@ func dict(v ...interface{}) map[string]interface{} {
return dict
}
func merge(dst map[string]interface{}, src map[string]interface{}) interface{} {
if err := mergo.Merge(&dst, src); err != nil {
// Swallow errors inside of a template.
return ""
func merge(dst map[string]interface{}, srcs ...map[string]interface{}) interface{} {
for _, src := range srcs {
if err := mergo.Merge(&dst, src); err != nil {
// Swallow errors inside of a template.
return ""
}
}
return dst
}
func mergeOverwrite(dst map[string]interface{}, srcs ...map[string]interface{}) interface{} {
for _, src := range srcs {
if err := mergo.MergeWithOverwrite(&dst, src); err != nil {
// Swallow errors inside of a template.
return ""
}
}
return dst
}
func values(dict map[string]interface{}) []interface{} {
values := []interface{}{}
for _, value := range dict {
values = append(values, value)
}
return values
}