Discover Packages
github.com/alexjx/gopher-lua-libs
runtime
package
Version:
v0.1.6
Opens a new window with list of versions in this module.
Published: May 6, 2022
License: BSD-3-Clause
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
runtime
Usage
local runtime = require("runtime")
if not(runtime.goos() == "linux") then error("not linux") end
if not(runtime.goarch() == "amd64") then error("not amd64") end
Expand ▾
Collapse ▴
Documentation
¶
Rendered for
linux/amd64
windows/amd64
darwin/amd64
js/wasm
Package runtime implements golang runtime functionality for lua.
runtime.goos(), runtime.goarch()
state := lua.NewState()
Preload(state)
inspect.Preload(state)
source := `
local runtime = require("runtime")
print(runtime.goos())
print(runtime.goarch())
`
if err := state.DoString(source); err != nil {
log.Fatal(err.Error())
}
Output:
linux
amd64
GOARCH lua runtime.goarch() return string
GOOS lua runtime.goos() return string
Loader is the module loader function.
Preload adds runtime to the given Lua state's package.preload table. After it
has been preloaded, it can be loaded using require:
local runtime = require("runtime")
Source Files
¶
Click to show internal directories.
Click to hide internal directories.