mirror of
https://github.com/golang/go.git
synced 2024-09-29 22:37:06 +00:00
go/scanner: better panic diagnostic
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5787045
This commit is contained in:
parent
a2f0397121
commit
5827dd052c
@ -109,7 +109,7 @@ const (
|
||||
func (s *Scanner) Init(file *token.File, src []byte, err ErrorHandler, mode Mode) {
|
||||
// Explicitly initialize all fields since a scanner may be reused.
|
||||
if file.Size() != len(src) {
|
||||
panic("file size does not match src len")
|
||||
panic(fmt.Sprintf("file size (%d) does not match src len (%d)", file.Size(), len(src)))
|
||||
}
|
||||
s.file = file
|
||||
s.dir, _ = filepath.Split(file.Name())
|
||||
|
Loading…
Reference in New Issue
Block a user