ToInteger converts the Lua value at index into a signed integer. The Lua value must be a number, or a string convertible to a number. If the number is not an integer, it is truncated in some non-specified way. If the operation failed, the second return value will be false. http://www.lua.org/manu
(index int)
| 767 | // |
| 768 | // http://www.lua.org/manual/5.2/manual.html#lua_tointegerx |
| 769 | func (l *State) ToInteger(index int) (int, bool) { |
| 770 | if n, ok := l.toNumber(l.indexToValue(index)); ok { |
| 771 | return int(n), true |
| 772 | } |
| 773 | return 0, false |
| 774 | } |
| 775 | |
| 776 | // ToUnsigned converts the Lua value at index to a Go uint. The Lua value |
| 777 | // must be a number or a string convertible to a number. |
no test coverage detected