Documentation
¶
Index ¶
- Variables
- func AnnotateSourceSpan(source *sources.Source, span ast.Span) string
- func LocationErrorf(source *sources.Source, span ast.Span, f string, args ...interface{}) error
- func LocationWarnf(source *sources.Source, span ast.Span, f string, args ...interface{}) error
- type Reporter
- type WriterReporter
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultReporter = WriterReporter{os.Stderr}
DefaultReporter is the default reporter, which writes to stderr.
Functions ¶
func AnnotateSourceSpan ¶
AnnotateSourceSpan annotates a span from a single line in the source code. The output looks like:
(contents) or (other thing) ~~~~~~~~
func LocationErrorf ¶
LocationErrorf adds an error from a specific location.
Types ¶
type Reporter ¶
type Reporter interface {
AddError(error)
}
Reporter is an interface for reporting errors and warnings.
type WriterReporter ¶
WriterReporter is a simple adapter for writing logs to an io.Writer. The default reporter is a WriterReporter(os.Stderr).
func (WriterReporter) AddError ¶
func (w WriterReporter) AddError(err error)
AddError implements Reporter.
Click to show internal directories.
Click to hide internal directories.