treewalk

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDepth = 128

Variables

This section is empty.

Functions

func ClampDepth

func ClampDepth(in, def, maximum int) int

ClampDepth resolves a requested depth: in <= 0 yields def; a positive max caps the result; max <= 0 leaves the upper end unbounded.

func RelativeTo

func RelativeTo(source, root string) string

Make an absolute source path relative to the compile root.

func Walk

func Walk[T any](
	children map[string][]*store.Node,
	root *store.Node,
	maxDepth int,
	fn func(n, parent *store.Node, depth int, descend func() []T) T,
) T

Walk visits root and its descendants.

Types

This section is empty.

Jump to

Keyboard shortcuts

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