mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
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>