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

Method ToUserData

lua.go:843–848  ·  view source on GitHub ↗

ToUserData returns an interface{} of the userdata of the value at index. Otherwise, it returns nil. http://www.lua.org/manual/5.2/manual.html#lua_touserdata

(index int)

Source from the content-addressed store, hash-verified

841//
842// http://www.lua.org/manual/5.2/manual.html#lua_touserdata
843func (l *State) ToUserData(index int) interface{} {
844 if d, ok := l.indexToValue(index).(*userData); ok {
845 return d.data
846 }
847 return nil
848}
849
850// ToThread converts the value at index to a Lua thread (a State). This
851// value must be a thread, otherwise the return value will be nil.

Callers 3

ioFileFunction · 0.80
readLineFunction · 0.80
TestUserDataFunction · 0.80

Calls 1

indexToValueMethod · 0.95

Tested by 1

TestUserDataFunction · 0.64