mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Reviewed By: alexsn Differential Revision: D16884402 fbshipit-source-id: 216bbf875251b0cbdd61e312ad763b439cab7813
41 lines
647 B
Cheetah
41 lines
647 B
Cheetah
{{ define "main" }}
|
|
// Code generated by 'entc generate'. DO NOT EDIT.
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
"bytes"
|
|
{{ template "imports" }}
|
|
|
|
{{ printf "%q" .Package }}
|
|
)
|
|
|
|
{{ $base := base .Package}}
|
|
|
|
var schemas = []ent.Interface{
|
|
{{ range $_, $name := .Names }}
|
|
{{- $base }}.{{- printf "%s{}" $name }},
|
|
{{ end -}}
|
|
}
|
|
|
|
func main() {
|
|
var lines [][]byte
|
|
for _, schema := range schemas {
|
|
b, err := MarshalSchema(schema)
|
|
if err != nil {
|
|
fail(err)
|
|
}
|
|
lines = append(lines, b)
|
|
}
|
|
os.Stdout.Write(bytes.Join(lines, []byte("\n")))
|
|
}
|
|
|
|
func fail(err error) {
|
|
os.Stderr.WriteString(err.Error())
|
|
os.Exit(1)
|
|
}
|
|
|
|
{{ template "schema" }}
|
|
|
|
{{ end }}
|