Versions in this module Expand all Collapse all v0 v0.4.0 Mar 4, 2022 Changes in this version + func Cause(err error) string + func Color(ctx context.Context) aurora.Aurora + func DisplayError(ctx context.Context, w io.Writer, spans []*SpanError, err error, ...) + func FormatPos(pos lexer.Position) string + func Levenshtein(s1, s2 []rune) int + func Offset(pos lexer.Position, offset int, line int) lexer.Position + func Suggestion(value string, candidates []string) string + func WithColor(ctx context.Context, color aurora.Aurora) context.Context + func WithError(err error, pos, end lexer.Position, opts ...Option) error + type Error struct + Diagnostics []error + Err error + func (e *Error) Error() string + func (e *Error) Unwrap() error + type Option func(*SpanError) + func Spanf(t Type, start, end lexer.Position, format string, a ...interface{}) Option + type PrettyInfo struct + NumContext int + type PrettyOption func(*PrettyInfo) + func WithNumContext(num int) PrettyOption + type Span struct + End lexer.Position + Message string + Start lexer.Position + Type Type + type SpanError struct + End lexer.Position + Err error + Pos lexer.Position + Spans []Span + func SourcesToSpans(ctx context.Context, srcs []*errdefs.Source, err error) (spans []*SpanError) + func Spans(err error) (spans []*SpanError) + func (se *SpanError) Error() string + func (se *SpanError) Pretty(ctx context.Context, opts ...PrettyOption) string + func (se *SpanError) Unwrap() error + type Type int + const Primary + const Secondary