runtime

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: BSD-3-Clause Imports: 2 Imported by: 3

README

runtime GoDoc

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

Documentation

Overview

Package runtime implements golang runtime functionality for lua.

Example (Package)

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

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GOARCH

func GOARCH(L *lua.LState) int

GOARCH lua runtime.goarch() return string

func GOOS

func GOOS(L *lua.LState) int

GOOS lua runtime.goos() return string

func Loader

func Loader(L *lua.LState) int

Loader is the module loader function.

func Preload

func Preload(L *lua.LState)

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")

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL