mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: adding list func to template engine
Signed-off-by: Alex Snast <alexsn@fb.com>
This commit is contained in:
@@ -59,6 +59,7 @@ var (
|
|||||||
"set": set,
|
"set": set,
|
||||||
"unset": unset,
|
"unset": unset,
|
||||||
"hasKey": hasKey,
|
"hasKey": hasKey,
|
||||||
|
"list": list,
|
||||||
}
|
}
|
||||||
rules = ruleset()
|
rules = ruleset()
|
||||||
acronym = make(map[string]bool)
|
acronym = make(map[string]bool)
|
||||||
@@ -377,3 +378,8 @@ func hasKey(d map[string]interface{}, key string) bool {
|
|||||||
_, ok := d[key]
|
_, ok := d[key]
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// list creates a list from values.
|
||||||
|
func list(v ...interface{}) []interface{} {
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user