MCPcopy Create free account
hub / github.com/Shopify/go-lua / ToGoFunction

Method ToGoFunction

lua.go:829–837  ·  view source on GitHub ↗

ToGoFunction converts a value at index into a Go function. That value must be a Go function, otherwise it returns nil. http://www.lua.org/manual/5.2/manual.html#lua_tocfunction

(index int)

Source from the content-addressed store, hash-verified

827//
828// http://www.lua.org/manual/5.2/manual.html#lua_tocfunction
829func (l *State) ToGoFunction(index int) Function {
830 switch v := l.indexToValue(index).(type) {
831 case *goFunction:
832 return v.Function
833 case *goClosure:
834 return v.function
835 }
836 return nil
837}
838
839// ToUserData returns an interface{} of the userdata of the value at index.
840// Otherwise, it returns nil.

Callers

nothing calls this directly

Calls 1

indexToValueMethod · 0.95

Tested by

no test coverage detected