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

Method Register

lua.go:1222–1225  ·  view source on GitHub ↗

Register sets the Go function f as the new value of global name. If name was already defined, it is overwritten. http://www.lua.org/manual/5.2/manual.html#lua_register

(name string, f Function)

Source from the content-addressed store, hash-verified

1220//
1221// http://www.lua.org/manual/5.2/manual.html#lua_register
1222func (l *State) Register(name string, f Function) {
1223 l.PushGoFunction(f)
1224 l.SetGlobal(name)
1225}
1226
1227func (l *State) setErrorObject(err error, oldTop int) {
1228 switch err {

Callers 1

Calls 2

PushGoFunctionMethod · 0.95
SetGlobalMethod · 0.95

Tested by 1