func (state *State) Errorf(format string, args ...interface{}) int {
	return state.errorf(format, args...)
}
Errorf raises an error.

The error message format is given by fmt plus any extra arguments, following
the same rules of lua_pushfstring. It also adds at the beginning of the message
the file name and the line number where the error occurred, if this information
is available.

This function never returns, but it is an idiom to use it in Go
functions as return state.Errorf(fmt, args).

See https://www.lua.org/manual/5.3/manual.html#luaL_error
package lua
import (
	"fmt"
	"io"
	"syscall"
)
func (state *State) ArgCheck(cond bool, arg int, msg string) {
	if !cond {
		state.ArgError(arg, msg)
	}
}
func (state *State) ArgError(arg int, msg string) int {
	return state.Errorf("bad argument #%d (%s)", arg, msg)
}
func (state *State) FileResult(err error, filename string) int {
	if err == nil {
		state.Push(true)
		return 1
	}
	state.Push(nil)
	if errStr := err.Error(); filename != "" {
		state.Push(fmt.Sprintf("%s: %s", filename, errStr))
	} else {
		state.Push(errStr)
	}
	if errno, ok := err.(syscall.Errno); ok {
		state.Push(int(errno))
	} else {
		state.Push(0)
	}
	return 3
}
func (state *State) ExecFrom(r io.Reader) error {
	return state.ExecChunk("?", r, BinaryMode|TextMode)
}
func (state *State) ExecText(text string) error {
	return state.ExecChunk("?", text, BinaryMode|TextMode)
}
func (state *State) ExecFile(file string) error {
	return state.ExecChunk(file, nil, BinaryMode|TextMode)
}
func (state *State) LoadFrom(r io.Reader) error {
	return state.LoadChunk("?", r, BinaryMode|TextMode)
}
func (state *State) LoadText(text string) error {
	return state.LoadChunk("?", text, BinaryMode|TextMode)
}
func (state *State) LoadFile(file string) error {
	return state.LoadChunk(file, nil, BinaryMode|TextMode)
}
func (state *State) NewMetaTable(name string) bool {
	if mt := state.GetMetaTable(name); mt != NilType && mt != NoneType {
		return false
	}
	state.Pop()
	state.NewTableSize(0, 2)
	state.Push(name)
	state.SetField(-2, "__name")  
	state.PushIndex(-1)
	state.SetField(RegistryIndex, name)  
	return true
}
func (state *State) GetSubTable(index int, field string) bool {
	if state.GetField(index, field) == TableType {
		return true  
	}
	state.Pop()                    
	index = state.AbsIndex(index)  
	state.NewTable()               
	state.PushIndex(-1)            
	state.SetField(index, field)   
	return false
}
func (state *State) GetMetaField(index int, event string) Type {
	meta := state.metafield(state.get(index), event)
	if !IsNone(meta) {
		state.Push(meta)
	}
	return meta.Type()
}
func (state *State) GetMetaTable(name string) Type {
	return state.GetField(RegistryIndex, name)
}
func (state *State) SetMetaTable(name string) {
	state.GetMetaTable(name)
	state.SetMetaTableAt(-2)
}
func (state *State) CallMeta(index int, event string) bool {
	val := state.get(index)
	if meta := state.metafield(val, event); !IsNone(meta) {
		if cls, ok := meta.(*Closure); ok {
			state.frame().push(cls)
			state.frame().push(val)
			state.Call(1, 1)
			return true
		}
	}
	return false
}
func (state *State) TypeAt(index int) Type {
	if state.isValid(index) {
		return state.get(index).Type()
	}
	return NoneType
}
func (state *State) Where(level int) {
	state.Push("")
}