Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultFailureFields are the default FailureFields. DefaultFailureFields = []FailureField{ FailureFieldFilename, FailureFieldLine, FailureFieldColumn, FailureFieldMessage, } )
Functions ¶
func SortFailures ¶
func SortFailures(failures []*Failure)
SortFailures sorts the Failures, by filename, line, column, id, message.
Types ¶
type Failure ¶
type Failure struct { Filename string `json:"filename,omitempty"` Line int `json:"line,omitempty"` Column int `json:"column,omitempty"` LintID string `json:"lint_id,omitempty"` Message string `json:"message,omitempty"` }
Failure is a failure with a position in text.
func NewFailuref ¶
func NewFailuref(position scanner.Position, lintID string, format string, args ...interface{}) *Failure
NewFailuref is a helper that returns a new Failure.
func (*Failure) Fprintln ¶
func (f *Failure) Fprintln(writer FailureWriter, fields ...FailureField) error
Fprintln prints the Failure to the writer with the given ordered fields.
type FailureField ¶
type FailureField int
FailureField references a field of a Failure.
const ( // FailureFieldFilename references the Filename field of a Failure. FailureFieldFilename FailureField = iota // FailureFieldLine references the Line field of a Failure. FailureFieldLine // FailureFieldColumn references the Column field of a Failure. FailureFieldColumn // FailureFieldID references the ID field of a Failure. FailureFieldID // FailureFieldMessage references the Message field of a Failure. FailureFieldMessage )
func ParseColonSeparatedFailureFields ¶
func ParseColonSeparatedFailureFields(s string) ([]FailureField, error)
ParseColonSeparatedFailureFields parses FailureFields from the given string. FailureFields are expected to be colon-separated in the given string. Input is case-insensitive. If the string is empty, DefaultFailureFields will be returned.
func ParseFailureField ¶
func ParseFailureField(s string) (FailureField, error)
ParseFailureField parses the FailureField from the given string.
Input is case-insensitive.
Click to show internal directories.
Click to hide internal directories.