feat: now back sendind real new cursor

This commit is contained in:
Iron_Felix 2025-11-22 02:04:40 +03:00
parent af0492cdf1
commit e16adcf6cd
2 changed files with 22 additions and 6 deletions

View file

@ -38,7 +38,7 @@ func ParseCursorInto(sortBy, cursorStr string, target any) error {
// 3. Get reflect value of target (must be ptr to struct)
v := reflect.ValueOf(target)
if v.Kind() != reflect.Ptr || v.IsNil() {
if v.Kind() != reflect.Pointer || v.IsNil() {
return fmt.Errorf("target must be non-nil pointer to struct")
}
v = v.Elem()
@ -56,7 +56,7 @@ func ParseCursorInto(sortBy, cursorStr string, target any) error {
vv := reflect.ValueOf(value)
// Case: field is *T, value is T → wrap in pointer
if ft.Kind() == reflect.Ptr {
if ft.Kind() == reflect.Pointer {
elemType := ft.Elem()
if vv.Type().AssignableTo(elemType) {
ptr := reflect.New(elemType)
@ -143,7 +143,7 @@ func extractInt64(m map[string]any, key string) (int64, error) {
return 0, fmt.Errorf("%q must be integer", key)
}
func extractString(m map[string]interface{}, key string) (string, error) {
func extractString(m map[string]any, key string) (string, error) {
v, ok := m[key]
if !ok {
return "", fmt.Errorf("missing %q", key)