9 type SourceRange struct {
14 type SourcePos struct {
15 Line, Column, Byte int
18 // StartString returns a string representation of the start of the range,
19 // including the filename and the line and column numbers.
20 func (r SourceRange) StartString() string {
21 filename := r.Filename
23 // We'll try to relative-ize our filename here so it's less verbose
24 // in the common case of being in the current working directory. If not,
25 // we'll just show the full path.
28 relFn, err := filepath.Rel(wd, filename)
34 return fmt.Sprintf("%s:%d,%d", filename, r.Start.Line, r.Start.Column)