Help us shape the future of Go! Take the 2026 Go Developer Survey

structindex

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package structindex builds the struct-name → owning-framework registry shared by the frameworks (purego) and libraries (cgo) pipeline loaders. Both derived the same map with the same conflict-resolution and typedef-backfill rules; this is the single implementation.

SCOPE — shared: the single struct-ownership index for both the frameworks (purego) and libraries (cgo) pipeline loaders.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(frameworks []*mpm.FrameworkMeta, structIndex, typedefIndex map[string]string)

Build populates structIndex (struct name → owning framework) from frameworks, then backfills clean typedef-alias names using typedefIndex. Both maps are mutated in place.

Ownership rules:

  • Only a struct with at least one field can own a name; opaque (zero-field) C types must stay unsafe.Pointer, not resolve to a typed Go struct.
  • A field-bearing definition replaces a prior zero-field placeholder.
  • When two frameworks both define the struct with fields, the lexicographically-smallest framework name wins, for deterministic output.

Typedef backfill: for a struct stored under an underscore-prefixed tag (the C idiom `typedef struct _NSRange NSRange;`), the clean public typedef name is registered to the same owner, so the mapper resolves "NSRange" directly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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