Welvet examples
57. stub/introspection
Part: VIII Β· Stubs
Package: github.com/openfluke/welvet/stub/introspection
Status: partial β π§
When
Scaffold / experimental stub stub/introspection (may be partial).
Where
import "github.com/openfluke/welvet/stub/introspection"
cd 57-stub-introspection && source ../env.sh && go run .
Why
UIs and FFI need to list Grid methods without hardcoding every export.
What
GetMethods, GetMethodsJSON, GetMethodSignature.
Sample output (captured)
9 <nil>
Live capture from go run ./cmd/runall on local ../../welvet (exit 0).
Source
Copied from the Welvet feature book examples (openfluke.github.io/welvet/examples/57-stub-introspection).
main.go
Download source βpackage main
import (
"fmt"
"github.com/openfluke/welvet/architecture"
"github.com/openfluke/welvet/stub/introspection"
)
func main() {
g := architecture.NewGrid(1, 1, 1, 1)
methods, err := introspection.GetMethods(g)
fmt.Println(len(methods), err)
}