mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
all: gofmt -w -r 'interface{} -> any' (#2874)
This commit is contained in:
@@ -24,8 +24,8 @@ in the LICENSE file in the root directory of this source tree.
|
||||
{{ end }}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*{{ $.Name }}) scanValues(columns []string) ([]interface{}, error) {
|
||||
values := make([]interface{}, len(columns))
|
||||
func (*{{ $.Name }}) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
{{- range $type, $columns := $ctypes }}
|
||||
@@ -46,7 +46,7 @@ func (*{{ $.Name }}) scanValues(columns []string) ([]interface{}, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the {{ $.Name }} fields.
|
||||
func ({{ $receiver }} *{{ $.Name }}) assignValues(columns []string, values []interface{}) error {
|
||||
func ({{ $receiver }} *{{ $.Name }}) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user