entc/gen: temporary workaround for runtime.tmpl (#387)

* entc/gen: temporary workaround for runtime.tmpl

* ci: golangci version
This commit is contained in:
Ariel Mashraki
2020-03-16 10:04:31 +02:00
committed by GitHub
parent 7988d3084d
commit 9cff230d34
17 changed files with 188 additions and 162 deletions

View File

@@ -19,11 +19,13 @@ import (
// to their package variables.
func init() {
groupFields := schema.Group{}.Fields()
_ = groupFields
// groupDescName is the schema descriptor for name field.
groupDescName := groupFields[0].Descriptor()
// group.NameValidator is a validator for the "name" field. It is called by the builders before save.
group.NameValidator = groupDescName.Validators[0].(func(string) error)
userFields := schema.User{}.Fields()
_ = userFields
// userDescAge is the schema descriptor for age field.
userDescAge := userFields[0].Descriptor()
// user.AgeValidator is a validator for the "age" field. It is called by the builders before save.