openlib

command
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

openlib shows how to write your own library that installs like a built-in one. The standard libraries register via methods on the state (L.OpenString, L.OpenMath, …); from an embedding package you write the exact same pattern as a free function taking *LState — build a module table, fill it with Go functions and constants, and install it as a global. (For `require("x")` integration instead, see the customlib example's Requiref/Preload.)

The payoff: a custom library is how you expose Go's standard library — here a few strings helpers Lua's string library does not have.

Jump to

Keyboard shortcuts

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