Package diag contains building blocks for formatting and processing diagnostic information.
Complain prints a message to stderr in bold and red, adding a trailing newline.
Complainf is like Complain, but accepts a format string and arguments.
PPrintError pretty-prints an error. It uses the PPrint method if the error implements PPrinter, and uses Complain to print the error message otherwise.
Context is a range of text in a source code. It is typically used for errors that can be associated with a part of the source code, like parse errors and a traceback entry.
NewContext creates a new Context.
PPrint pretty-prints a SourceContext.
PPrintCompact pretty-prints a SourceContext, with no line break between the source position range description and relevant source excerpt.
Error represents an error with context that can be pretty-printed.
Error returns a plain text representation of the error.
PPrint pretty-prints the error.
Range returns the range of the error.
Ranger wraps the Range method.
Ranging represents a range [From, To) within an indexable sequence. Structs can embed Ranging to satisfy the Ranger interface.
Range returns the Ranging itself.