The comment of Process() implies src can be nil, but it didn't handle nil src correctly before because parse() doesn't expect nil src. Passing []byte(nil) to parser.ParseFile() results in error and parse() tries to parse again by modifying src if src is statement list. This problem isn't related with cmd/goimports because goimports doesn't pass []byte(nil) to Process() as src. Fixes golang/go#19676 Change-Id: Idbaa6646c3907690763eabc798860c56bb9963d4 Reviewed-on: https://go-review.googlesource.com/38613 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> |
||
|---|---|---|
| .. | ||
| fastwalk.go | ||
| fastwalk_dirent_fileno.go | ||
| fastwalk_dirent_ino.go | ||
| fastwalk_portable.go | ||
| fastwalk_test.go | ||
| fastwalk_unix.go | ||
| fix.go | ||
| fix_test.go | ||
| imports.go | ||
| mkindex.go | ||
| mkstdlib.go | ||
| sortimports.go | ||
| zstdlib.go | ||