We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func (User) Fields() []ent.Field { return []ent.Field{ field.UUID("id", uuid.UUID{}). Unique(). Immutable(). Default(uuid.New). // This works Annotations(entproto.Field(1)), field.String("name"). DefaultFunc(randstr). // This not work. Annotations(entproto.Field(2)), field.Time("created_at"). Immutable(). Default(time.Now). // This not work. Annotations(entproto.Field(2)), } }
This happens because generated code (func (x *XService) createBuilder) calls m.SetXXX(v) even if v is the zero value.
func (x *XService) createBuilder
m.SetXXX(v)
v
Fucntion given by DefaultFunc or Default must be invoked and the result must be set as a field value.
DefaultFunc
Default
Steps:
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Current Behavior 😯
This happens because generated code (
func (x *XService) createBuilder
) callsm.SetXXX(v)
even ifv
is the zero value.Expected Behavior 🤔
Fucntion given by
DefaultFunc
orDefault
must be invoked and the result must be set as a field value.Steps to Reproduce 🕹
Steps:
Your Environment 🌎
The text was updated successfully, but these errors were encountered: