Documentation
¶
Overview ¶
Package errata is the declared overlay of defects in OMG-published material, and the entries for the bundled standard library; published bytes are never rewritten.
Index ¶
Constants ¶
const IssuesPath = "docs/project/omg-issues.md"
IssuesPath is the page every entry must be documented in.
const LibraryRoot = "internal/workspace/libs/stdlib"
LibraryRoot is the repository path of the bundled standard library, whose files are OMG-published material too. Entries under it are keyed for LibrarySource by the path a libs.Source lists them under.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
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.
func ApplyAll ¶
ApplyAll is Apply for every entry of one file: each line is checked against its entry as published before any is substituted.
func SortedPaths ¶
SortedPaths returns the keys of an Under result in order.
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 LibraryEntries ¶
func LibraryEntries() []Entry
LibraryEntries are the declared errata of the bundled standard library, in report order.
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
Overlay is a registry indexed by file, ready to apply.
func New ¶
New validates entries and indexes them by path; each must lie under one of the published roots, the repository paths holding OMG-published material.
func (*Overlay) Corrections ¶
Corrections returns the entries that substitute text.
func (*Overlay) Documented ¶
Documented returns the entries documented without a correction.
func (*Overlay) EntriesUnder ¶
EntriesUnder is Under for every entry, the documented-only ones included, so a reader can verify each declared line and not only substitute the corrected.
func (*Overlay) LibrarySource ¶
LibrarySource serves the bundled standard library as published, with the corrections declared under LibraryRoot applied to the files they name. The published source is only ever read; a file whose declared line, corrected or documented only, no longer reads as published fails to load rather than loading unverified.