Documentation ¶
Overview ¶
Package diag contains building blocks for formatting and processing diagnostic information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
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.
func NewContext ¶
NewContext creates a new Context.
func (*Context) ShowCompact ¶ added in v0.14.0
ShowCompact shows a SourceContext, with no line break between the source position range description and relevant source excerpt.
type Error ¶
Error represents an error with context that can be showed.
type Ranger ¶
type Ranger interface { // Range returns the range associated with the value. Range() Ranging }
Ranger wraps the Range method.
type Ranging ¶
Ranging represents a range [From, To) within an indexable sequence. Structs can embed Ranging to satisfy the Ranger interface.
func MixedRanging ¶ added in v0.14.0
MixedRanging returns a Ranging from the start position of a to the end position of b.
func PointRanging ¶ added in v0.14.0
PointRanging returns a zero-width Ranging at the given point.