go/src/go/scanner/errors.go

type Error

// Error implements the error interface.
func (e Error) Error() string {}

type ErrorList

// Add adds an [Error] with given position and error message to an [ErrorList].
func (p *ErrorList) Add(pos token.Position, msg string) {}

// Reset resets an [ErrorList] to no errors.
func (p *ErrorList) Reset() {}

// [ErrorList] implements the sort Interface.
func (p ErrorList) Len() int      {}

func (p ErrorList) Swap(i, j int) {}

func (p ErrorList) Less(i, j int) bool {}

// Sort sorts an [ErrorList]. *[Error] entries are sorted by position,
// other errors are sorted by error message, and before any *[Error]
// entry.
func (p ErrorList) Sort() {}

// RemoveMultiples sorts an [ErrorList] and removes all but the first error per line.
func (p *ErrorList) RemoveMultiples() {}

// An [ErrorList] implements the error interface.
func (p ErrorList) Error() string {}

// Err returns an error equivalent to this error list.
// If the list is empty, Err returns nil.
func (p ErrorList) Err() error {}

// PrintError is a utility function that prints a list of errors to w,
// one error per line, if the err parameter is an [ErrorList]. Otherwise
// it prints the err string.
func PrintError(w io.Writer, err error) {}