-
Notifications
You must be signed in to change notification settings - Fork 204
Open
Description
// balabala....
if l.IsTable(-1) {
var m = map[string]string{}
l.PushNil()
for l.Next(-2) {
key, _ := l.ToString(-2)
value, _ := l.ToString(-1)
l.Pop(1)
m[key] = value
}
l.Pop(2)
return m
}
// balabala....
table
is ok, but array
will panic.
add some debug log tables.go:215
func arrayIndex(k value) int {
if n, ok := k.(float64); ok {
fmt.Println("array_index", k, n)
} else {
t := reflect.TypeOf(k)
fmt.Println("array_index", t, k)
}
if n, ok := k.(float64); ok {
if i := int(n); float64(i) == n {
return i
}
}
return -1
}
it is a string
type.
array_index <nil> <nil>
array_index string 1
array_index string 1
Metadata
Metadata
Assignees
Labels
No labels