errata

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package errata is the declared overlay of defects in the OMG-published material this project reads: what the published text says, the clause that makes it wrong, and what the oracles read instead. The published bytes on disk are never rewritten; corrections live only here.

Index

Constants

View Source
const IssuesPath = "docs/project/omg-issues.md"

IssuesPath is the page every entry must be documented in.

Variables

This section is empty.

Functions

func Apply

func Apply(entry Entry, content []byte) ([]byte, error)

Apply returns content with the entry's correction substituted. It fails unless the declared line still reads as published, so a re-vendored corpus is a hard error rather than a silently skipped correction.

Types

type Entry

type Entry struct {
	// ID is the entry's stable internal label, as the oracles report it.
	ID string
	// Heading titles the docs/project/omg-issues.md section documenting the
	// defect, without its `### ` marker.
	Heading string
	// Path is the defective file, relative to the repository root.
	Path string
	// Line is the 1-based line the entry covers.
	Line int
	// AsPublished is the published line, verbatim.
	AsPublished string
	// Corrected replaces AsPublished when non-empty. Empty means documented
	// without a correction: nothing is substituted, and the defect stands.
	Corrected string
	// Citation is the specification clause the published text violates.
	Citation string
	// Derivation states in one line why that clause is violated.
	Derivation string
}

Entry is one defect in published material. The span is one whole line: AsPublished is that line's exact bytes without its terminator, which is what lets a re-vendored corpus invalidate the entry instead of silently rotting it.

func Registry

func Registry() []Entry

Registry is the declared errata, in report order.

func (Entry) Corrects

func (e Entry) Corrects() bool

Corrects reports whether the entry substitutes text.

func (Entry) Validate

func (e Entry) Validate() error

Validate reports why an entry may not be accepted.

type Overlay

type Overlay struct {
	// contains filtered or unexported fields
}

Overlay is a registry indexed by file, ready to apply.

func Load

func Load() (*Overlay, error)

Load returns the declared registry as an overlay.

func New

func New(entries []Entry) (*Overlay, error)

New validates entries and indexes them by path.

func (*Overlay) Corrections

func (o *Overlay) Corrections() []Entry

Corrections returns the entries that substitute text.

func (*Overlay) Documented

func (o *Overlay) Documented() []Entry

Documented returns the entries documented without a correction.

func (*Overlay) Entries

func (o *Overlay) Entries() []Entry

Entries returns every declared entry.

func (*Overlay) Materialize

func (o *Overlay) Materialize(repo, dir, dst string) (map[string]Entry, error)

Materialize copies the corpus root at repo/dir into dst and applies every correction inside it, leaving the published tree untouched. It returns the applied entries, keyed by the path relative to the root.

func (*Overlay) Under

func (o *Overlay) Under(dir string) map[string]Entry

Under returns the correcting entries whose file lies under a repository path, keyed by the path relative to it.

Jump to

Keyboard shortcuts

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