Files
zeekayandHanzo Dev a5c5cc019e Go 1.27.1, and the code it can say more simply
Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers; omitzero is not applied, since it changes what the JSON says.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-16 22:42:15 -07:00

38 lines
778 B
Go

package binder
import "github.com/yuin/gopher-lua"
// Push function result wrapper
type Push struct {
context *Context
}
// String pushes sting function result
func (p *Push) String(s string) {
p.context.state.Push(lua.LString(s))
p.context.increase()
}
// Number pushes sting function result
func (p *Push) Number(n float64) {
p.context.state.Push(lua.LNumber(n))
p.context.increase()
}
// Bool pushes bool function result
func (p *Push) Bool(b bool) {
p.context.state.Push(lua.LBool(b))
p.context.increase()
}
// Data pushes UserData function result
func (p *Push) Data(d any, t string) {
ud := p.context.state.NewUserData()
ud.Value = d
p.context.state.SetMetatable(ud, p.context.state.GetTypeMetatable(t))
p.context.state.Push(ud)
p.context.increase()
}