packages

package
v0.0.0-...-943ffa6 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 3 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lookup

func Lookup(name string) (any, bool)

Lookup a registered instance by name

func Register

func Register(name string, f any)

Register a package against a name.

If these packages are a single word (contains no '.' or '/' in them) then those packages are global and are accessible in scripts without requiring an import statement.

This allows for a globally defined object similar to a package of functions or constants.

This will panic if name has already been registered.

func RegisterPackage

func RegisterPackage(f any)

RegisterPackage registers a package using its go package name as the name within g-script.

Limitations:

Only one package can be registered per go package. If a second package is registered for the same go package this will panic.

Packages registered with RegisterPackage must be imported manually within a script using the import statement just like in go.

Types

This section is empty.

Jump to

Keyboard shortcuts

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