MCPcopy Index your code
hub / github.com/Shopify/go-lua / ToBoolean

Method ToBoolean

lua.go:1411–1411  ·  view source on GitHub ↗

ToBoolean converts the Lua value at index to a Go boolean. Like all tests in Lua, the only false values are false booleans and nil. Otherwise, all other Lua values evaluate to true. To accept only actual boolean values, use the test IsBoolean. http://www.lua.org/manual/5.2/manual.html#lua_toboolea

(index int)

Source from the content-addressed store, hash-verified

1409//
1410// http://www.lua.org/manual/5.2/manual.html#lua_toboolean
1411func (l *State) ToBoolean(index int) bool { return !isFalse(l.indexToValue(index)) }
1412
1413// Table pushes onto the stack the value table[top], where table is the
1414// value at index, and top is the value at the top of the stack. This

Callers 9

TestToBooleanOutOfRangeFunction · 0.95
base.goFile · 0.80
findHelperFunction · 0.80
LessMethod · 0.80
readLineFunction · 0.80
noEnvFunction · 0.80
PackageOpenFunction · 0.80
ToStringMetaFunction · 0.80
os.goFile · 0.80

Calls 2

indexToValueMethod · 0.95
isFalseFunction · 0.85

Tested by 1

TestToBooleanOutOfRangeFunction · 0.76