entc/gen: adding list func to template engine

Signed-off-by: Alex Snast <alexsn@fb.com>
This commit is contained in:
Alex Snast
2020-01-30 20:00:15 +01:00
parent e6ba06441b
commit 15ee3d889f

View File

@@ -59,6 +59,7 @@ var (
"set": set,
"unset": unset,
"hasKey": hasKey,
"list": list,
}
rules = ruleset()
acronym = make(map[string]bool)
@@ -377,3 +378,8 @@ func hasKey(d map[string]interface{}, key string) bool {
_, ok := d[key]
return ok
}
// list creates a list from values.
func list(v ...interface{}) []interface{} {
return v
}