Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

panic: index out of range when try to .cols("xxx", "xxx", "xxx").find(&map[int64]*xxx) #1396

@silver-chard

Description

@silver-chard

return convertAssign(dst, pk[0])

in session_find.go:259 ~ 271

containerValueSetFunc = func(newValue *reflect.Value, pk core.PK) error {
	keyValue := reflect.New(keyType)
	err := convertPKToValue(table, keyValue.Interface(), pk)
	if err != nil {
		return err
	}
	if isPointer {
		containerValue.SetMapIndex(keyValue.Elem(), newValue.Elem().Addr())
	} else {
		containerValue.SetMapIndex(keyValue.Elem(), newValue.Elem())
	}
	return nil
}	

session_find.go:306 containerValueSetFunc(&newValue, nil) . pk will be nil.
but in convertPKToValue. return convertAssign(dst, pk[0])
so ... nil[0] ....

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions