function

WalkPlacements

WalkPlacements calls visit for every field placement beneath a resource's fields, with the placement's absolute path segments, without creating placement views. shared reports a field of a block definition, whose own Path and ID are definition-relative; PlacementFieldID derives its placement ID from the segments. visit reports whether to visit the field's descendants. A complete walk is proportional to placements, so use it only for work that is inherently per placement, and prune it; segments is reused between calls.

Arguments

ArgumentTypeDescription
fields[]FieldThe fields value.
visitfunc(segments []string, field Field, shared bool) boolThe visit value.

Full signature

func WalkPlacements( fields []Field, visit func(segments []string, field Field, shared bool) bool, )

Source schema/embedded.go:163

Related types

  • Field

    The resolved contract for one field.