This commit is contained in:
parent
b7fdd56a8b
commit
adfcd4b60c
2 changed files with 4 additions and 2 deletions
|
@ -59,7 +59,7 @@ func (e *FileError) Path() string {
|
||||||
return e.file.Path
|
return e.file.Path
|
||||||
}
|
}
|
||||||
|
|
||||||
return relative
|
return filepath.ToSlash(relative)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unwrap returns the wrapped error.
|
// Unwrap returns the wrapped error.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package errors_test
|
package errors_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -37,7 +38,8 @@ func test(t *testing.T, path string) *errors.FileError {
|
||||||
Tokens: tokens,
|
Tokens: tokens,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := errors.New(io.EOF, file, 11)
|
main := token.Position(bytes.Index(contents, []byte("main()")))
|
||||||
|
err := errors.New(io.EOF, file, main)
|
||||||
assert.NotNil(t, err)
|
assert.NotNil(t, err)
|
||||||
|
|
||||||
line, column := err.LineColumn()
|
line, column := err.LineColumn()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue