Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorWithSource ¶
type ErrorWithSource struct {
// SourceCodeString is the input source code string for the error.
SourceCodeString string
// LineNumber is the (1-indexed) line number of the error, or 0 if unknown.
LineNumber uint64
// ColumnPosition is the (1-indexed) column position of the error, or 0 if
// unknown.
ColumnPosition uint64
// contains filtered or unexported fields
}
ErrorWithSource is an error that includes the source text and position information.
func AsErrorWithSource ¶
func AsErrorWithSource(err error) (*ErrorWithSource, bool)
AsErrorWithSource returns the error as an ErrorWithSource, if applicable.
func NewErrorWithSource ¶
func NewErrorWithSource(err error, sourceCodeString string, oneIndexedLineNumber uint64, oneIndexedColumnPosition uint64) *ErrorWithSource
NewErrorWithSource creates and returns a new ErrorWithSource.
func (*ErrorWithSource) InnerError ¶
func (ews *ErrorWithSource) InnerError() error
InnerError returns the inner, wrapped error.
type SourcePosition ¶
type SourcePosition struct {
// LineNumber is the 1-indexed line number in the input source.
LineNumber int
// ColumnPosition is the 1-indexed column position in the input source.
ColumnPosition int
}
SourcePosition is a position in the input source.
Click to show internal directories.
Click to hide internal directories.