MCPcopy Index your code
hub / github.com/yuin/gopher-lua / ToChannel

Method ToChannel

state.go:2280–2285  ·  view source on GitHub ↗

Converts the Lua value at the given acceptable index to the chan LValue.

(n int)

Source from the content-addressed store, hash-verified

2278
2279// Converts the Lua value at the given acceptable index to the chan LValue.
2280func (ls *LState) ToChannel(n int) chan LValue {
2281 if lv, ok := ls.Get(n).(LChannel); ok {
2282 return (chan LValue)(lv)
2283 }
2284 return nil
2285}
2286
2287// RemoveCallerFrame removes the stack frame above the current stack frame. This is useful in tail calls. It returns
2288// the new current frame.

Callers 1

TestToChannelFunction · 0.45

Calls 1

GetMethod · 0.95

Tested by 1

TestToChannelFunction · 0.36