Discover Packages
github.com/vadv/gopher-lua-libs
runtime
package
Version:
v0.0.9
Opens a new window with list of versions in this module.
Published: Jul 2, 2020
License: BSD-3-Clause
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 5
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.