parse

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name string
	Type types.Type
	Tag  reflect.StructTag
}

Field is a settable field of a fixture target. Embedded fields appear as regular fields named after their type.

type Package

type Package struct {
	// Name is the package name (e.g., "model").
	Name string
	// Path is the import path.
	Path string
	// Dir is the absolute directory of the package; empty when unknown.
	Dir string
	// Structs holds the fixture targets, sorted by name.
	Structs []Struct
}

Package is a parsed source package holding the fixture targets.

func Load

func Load(pattern string) (Package, []string, error)

Load loads the package identified by pattern (a relative path or an import path) and extracts the structs eligible for fixture generation. The second return value holds warnings for skipped types.

type Struct

type Struct struct {
	Name string
	// Fields holds the exported fields in definition order.
	Fields []Field
}

Struct is a single fixture target.

Jump to

Keyboard shortcuts

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