Description

Next pops a key from the stack and pushes a key-value pair from the table at index, while the table has next elements. If there are no more elements, nothing is pushed on the stack and Next returns false.

A typical traversal looks like this:

// Table is on top of the stack (index -1).
l.PushNil() // Add nil entry on stack (need 2 free slots).
for l.Next(-2) {
	key := lua.CheckString(l, -2)
	val := lua.CheckString(l, -1)
	l.Pop(1) // Remove val, but need key for the next iter.
}

http://www.lua.org/manual/5.2/manual.html#lua_next

Next is referenced in 3 repositories

github.com/Shopify/go-lua github.com/Shopify/goluago

...