Documentation ¶
Index ¶
- Constants
- func ComputeLineAndColumn(text string) (lineCount int, columnCount, lastLineStart int)
- func PrintErrorToStderr(osArgs []string, text string)
- type Log
- func (log Log) AddError(source *Source, loc ast.Loc, text string)
- func (log Log) AddRangeError(source *Source, r ast.Range, text string)
- func (log Log) AddRangeWarning(source *Source, r ast.Range, text string)
- func (log Log) AddWarning(source *Source, loc ast.Loc, text string)
- func (log Log) Done() []Msg
- func (log Log) HasErrors() bool
- type LogLevel
- type Msg
- type MsgDetail
- type MsgKind
- type Source
- type StderrColor
- type StderrOptions
- type TerminalInfo
Constants ¶
View Source
const SupportsColorEscapes = true
Variables ¶
This section is empty.
Functions ¶
func ComputeLineAndColumn ¶
func PrintErrorToStderr ¶ added in v0.5.0
Types ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func NewDeferLog ¶
func NewDeferLog() Log
func NewStderrLog ¶
func NewStderrLog(options StderrOptions) Log
func (Log) AddRangeWarning ¶
type Msg ¶
func (Msg) String ¶
func (msg Msg) String(options StderrOptions, terminalInfo TerminalInfo) string
type Source ¶
type Source struct { Index uint32 // This is a platform-dependent path that includes environment-specific things // such as Windows backslash path separators and potentially the user's home // directory. Only use this for passing to syscalls for reading and writing to // the file system. Do not include this in any output data. AbsolutePath string // This is a mostly platform-independent path. It's relative to the current // working directory and always uses standard path separators. Use this for // referencing a file in all output data. These paths still use the original // case of the path so they may still work differently on file systems that // are case-insensitive vs. case-sensitive. PrettyPath string Contents string }
type StderrColor ¶
type StderrColor uint8
const ( ColorIfTerminal StderrColor = iota ColorNever ColorAlways )
type StderrOptions ¶
type StderrOptions struct { IncludeSource bool ErrorLimit int Color StderrColor LogLevel LogLevel }
type TerminalInfo ¶
func GetTerminalInfo ¶ added in v0.3.0
func GetTerminalInfo(file *os.File) (info TerminalInfo)
Click to show internal directories.
Click to hide internal directories.