Documentation
¶
Overview ¶
Package diag holds source positions and diagnostics for the writ policy language. It is deliberately tiny and dependency-free: every other writ package reports through it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasErrors ¶
func HasErrors(ds []Diagnostic) bool
HasErrors reports whether any diagnostic in ds is error-severity.
Types ¶
type Diagnostic ¶
Diagnostic is one reported problem, anchored to a source position.
func Errorf ¶
func Errorf(pos Pos, format string, args ...any) Diagnostic
Errorf builds an error-severity diagnostic.
func Errors ¶
func Errors(ds []Diagnostic) []Diagnostic
Errors returns only the error-severity diagnostics.
func Warnf ¶
func Warnf(pos Pos, format string, args ...any) Diagnostic
Warnf builds a warning-severity diagnostic.
func Warnings ¶
func Warnings(ds []Diagnostic) []Diagnostic
Warnings returns only the warning-severity diagnostics.
func (Diagnostic) String ¶
func (d Diagnostic) String() string
Click to show internal directories.
Click to hide internal directories.