Documentation
¶
Overview ¶
Example custom-libs adds a user-authored library to pooled States via Config.ExtraLibs — without restating the sandbox defaults. ExtraLibs run after the default libs (and after load/loadfile/dofile are stripped), so the sandbox stays intact while scripts gain the custom API. Each entry runs once per pooled State, on the goroutine that owns it, so shared Go state a lib closes over must be goroutine-safe (here a read-only allowlist map).
Click to show internal directories.
Click to hide internal directories.