// SetField sets the value of a field with the given name. It returns an error if
// the field is not defined in the schema, or if the type mismatched the field
// type.
SetField sets the value of a field with the given name. It returns an error if
the field is not defined in the schema, or if the type mismatched the field
type.
// SetField sets the value of a field with the given name . It returns an error if // the field is not defined in the schema or if the type mismatched the field // type .
func (m *FactTypeMutation) SetField(name string, value ent.Value) error {
	switch name {
	case facttype.FieldCreatedAt:
		v, ok := value.(time.Time)
		if !ok {
			return fmt.Errorf("unexpected type %T for field %s", value, name)
		}
		m.SetCreatedAt(v)
		return nil
	case facttype.FieldUpdatedAt:
		v, ok := value.(time.Time)
		if !ok {
			return fmt.Errorf("unexpected type %T for field %s", value, name)
		}
		m.SetUpdatedAt(v)
		return nil
	case facttype.FieldDeletedAt:
		v, ok := value.(time.Time)
		if !ok {
			return fmt.Errorf("unexpected type %T for field %s", value, name)
		}
		m.SetDeletedAt(v)
		return nil
	case facttype.FieldSlug:
		v, ok := value.(string)
		if !ok {
			return fmt.Errorf("unexpected type %T for field %s", value, name)
		}
		m.SetSlug(v)
		return nil
	case facttype.FieldBuiltIn:
		v, ok := value.(bool)
		if !ok {
			return fmt.Errorf("unexpected type %T for field %s", value, name)
		}
		m.SetBuiltIn(v)
		return nil
	case facttype.FieldValidation:
		v, ok := value.(string)
		if !ok {
			return fmt.Errorf("unexpected type %T for field %s", value, name)
		}
		m.SetValidation(v)
		return nil
	}
	return fmt.Errorf("unknown FactType field %s", name)
}
func ( m * FactTypeMutation ) SetField ( name string , value ent . Value ) error { switch name { case facttype . FieldCreatedAt : v , ok := value . ( time . Time ) if ! ok { return fmt . Errorf ( " " , value , name ) } m . SetCreatedAt ( v ) return nil case facttype . FieldUpdatedAt : v , ok := value . ( time . Time ) if ! ok { return fmt . Errorf ( " " , value , name ) } m . SetUpdatedAt ( v ) return nil case facttype . FieldDeletedAt : v , ok := value . ( time . Time ) if ! ok { return fmt . Errorf ( " " , value , name ) } m . SetDeletedAt ( v ) return nil case facttype . FieldSlug : v , ok := value . ( string ) if ! ok { return fmt . Errorf ( " " , value , name ) } m . SetSlug ( v ) return nil case facttype . FieldBuiltIn : v , ok := value . ( bool ) if ! ok { return fmt . Errorf ( " " , value , name ) } m . SetBuiltIn ( v ) return nil case facttype . FieldValidation : v , ok := value . ( string ) if ! ok { return fmt . Errorf ( " " , value , name ) } m . SetValidation ( v ) return nil } return fmt . Errorf ( " " , name ) }
SetField sets the value of a field with the given name.
SetField sets the value of a field with the given name .