diff options
author | Rob Pike <r@golang.org> | 2014-12-05 09:15:38 +0900 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2014-12-05 09:15:38 +0900 |
commit | 5223a2c9fbc6a2633a77586dbfec379e584c779e (patch) | |
tree | 9d12e10bf795acfa19577d541b57c89439e9f635 /src/runtime/defs_netbsd.go | |
parent | 8208a8b2f9a29cabb4dff8aff17fbb739b6e8471 (diff) | |
download | go-5223a2c9fbc6a2633a77586dbfec379e584c779e.tar.gz |
cmd/go: avoid use of bufio.Scanner in generate
Scanner can't handle stupid long lines and there are
reports of stupid long lines in production.
Note the issue isn't long "//go:generate" lines, but
any long line in any Go source file.
To be fair, if you're going to have a stupid long line
it's not a bad bet you'll want to run it through go
generate, because it's some embeddable asset that
has been machine generated. (One could ask why
that generation process didn't add a newline or two,
but we should cope anyway.)
Rewrite the file scanner in "go generate" so it can
handle arbitrarily long lines, and only stores in memory
those lines that start "//go:generate".
Also: Adjust the documentation to make clear that it
does not parse the file.
Fixes issue 9143.
Fixes issue 9196.
LGTM=rsc, dominik.honnef
R=rsc, cespare, minux, dominik.honnef
CC=golang-codereviews
https://codereview.appspot.com/182970043
Diffstat (limited to 'src/runtime/defs_netbsd.go')
0 files changed, 0 insertions, 0 deletions