1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
package writer
import (
"fmt"
"github.com/reviewdog/errorformat"
)
var testErrs = []*errorformat.Entry{
{Filename: "path/to/file1", Lnum: 1, EndLnum: 2, Col: 14, EndCol: 15, Text: "hello", Type: 'W'},
{Filename: "path/to/file1", Lnum: 2, Col: 14, Text: "vim", Type: 'I'},
{Filename: "file2", Lnum: 2, Col: 14, Text: "emacs", Type: 'E', Nr: 1},
{Filename: "file2", Lnum: 14, Col: 1, Text: "neovim", Type: 'E', Nr: 14},
}
func init() {
for _, e := range testErrs {
e.Lines = append(e.Lines, fmt.Sprintf("%s:%d:%d:[%s] %s",
e.Filename, e.Lnum, e.Col, string(e.Type), e.Text))
}
}
|