func (wf *WithFields) assignValues(columns []string, values []interface{}) error {
	if m, n := len(values), len(columns); m < n {
		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
	}
	for i := range columns {
		switch columns[i] {
		case withfields.FieldID:
			value, ok := values[i].(*sql.NullInt64)
			if !ok {
				return fmt.Errorf("unexpected type %T for field id", value)
			}
			wf.ID = int(value.Int64)
		case withfields.FieldExisting:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field existing", values[i])
			} else if value.Valid {
				wf.Existing = value.String
			}
		}
	}
	return nil
}
assignValues assigns the values that were returned from sql.Rows (after scanning)
to the WithFields fields.
package ent
import (
	"fmt"
	"strings"
	"entgo.io/contrib/schemast/internal/mutatetest/ent/withfields"
	"entgo.io/ent/dialect/sql"
)
type WithFields struct {
	config `json:"-"`
	ID int `json:"id,omitempty"`
	Existing string `json:"existing,omitempty"`
}
func (*WithFields) scanValues(columns []string) ([]interface{}, error) {
	values := make([]interface{}, len(columns))
	for i := range columns {
		switch columns[i] {
		case withfields.FieldID:
			values[i] = new(sql.NullInt64)
		case withfields.FieldExisting:
			values[i] = new(sql.NullString)
		default:
			return nil, fmt.Errorf("unexpected column %q for type WithFields", columns[i])
		}
	}
	return values, nil
}