Documentation ¶
Index ¶
- func PrintError(w io.Writer, err error)
- type Error
- type ErrorList
- func (p *ErrorList) Add(pos loc.Position, msg string)
- func (p ErrorList) Err() error
- func (p ErrorList) Error() string
- func (p ErrorList) Len() int
- func (p ErrorList) Less(i, j int) bool
- func (p *ErrorList) List() []*Error
- func (p *ErrorList) RemoveMultiples()
- func (p *ErrorList) Reset()
- func (p ErrorList) Sort()
- func (p ErrorList) Swap(i, j int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintError ¶
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.
Types ¶
type Error ¶
In an ErrorList, an error is represented by an *Error. The position Pos, if valid, points to the beginning of the offending token, and the error condition is described by Msg.
type ErrorList ¶
type ErrorList []*Error
ErrorList is a list of *Errors. The zero value for an ErrorList is an empty ErrorList ready to use.
func (ErrorList) Err ¶
Err returns an error equivalent to this error list. If the list is empty, Err returns nil.
func (*ErrorList) RemoveMultiples ¶
func (p *ErrorList) RemoveMultiples()
RemoveMultiples sorts an ErrorList and removes all but the first error per line.
Click to show internal directories.
Click to hide internal directories.