1
0
mirror of https://github.com/golang/go synced 2024-11-24 00:50:10 -07:00
The Go programming language
Go to file
Rob Pike dd26fc3822 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 #9143.
Fixes #9196.

LGTM=rsc, dominik.honnef
R=rsc, cespare, minux, dominik.honnef
CC=golang-codereviews
https://golang.org/cl/182970043
2014-12-05 09:15:38 +09:00
api unicode: strconv: regexp: Upgrade to Unicode 7.0.0. 2014-08-18 20:26:10 +02:00
doc spec: add comment marker for consistency. 2014-12-04 09:29:29 +11:00
include liblink: require DATA lines to be ordered by offset, with no overlap 2014-10-14 23:25:12 -04:00
lib lib/time: update to ICANN time zone database 2014j 2014-12-03 20:07:48 -08:00
misc undo CL 176900044 / 561398621ba7 2014-11-17 14:21:29 +11:00
src cmd/go: avoid use of bufio.Scanner in generate 2014-12-05 09:15:38 +09:00
test runtime: fix sudog leak 2014-11-16 16:44:45 -05:00
.hgignore .hgignore: delete some dregs 2014-09-25 17:30:12 -07:00
.hgtags tag go1.4rc2 2014-12-02 14:39:23 +11:00
AUTHORS A+C: add another email address for Emil Hessman 2014-11-12 10:01:23 -08:00
CONTRIBUTORS C: add Nick Cooper (Google CLA). 2014-11-14 17:03:17 +11:00
favicon.ico
LICENSE
PATENTS
README README: Fix installation instructions 2013-11-20 13:47:37 -08:00
robots.txt

This is the source code repository for the Go programming language.  

For documentation about how to install and use Go,
visit http://golang.org/ or load doc/install-source.html
in your web browser.

After installing Go, you can view a nicely formatted
doc/install-source.html by running godoc --http=:6060
and then visiting http://localhost:6060/doc/install/source.

Unless otherwise noted, the Go source files are distributed
under the BSD-style license found in the LICENSE file.

--

Binary Distribution Notes

If you have just untarred a binary Go distribution, you need to set
the environment variable $GOROOT to the full path of the go
directory (the one containing this README).  You can omit the
variable if you unpack it into /usr/local/go, or if you rebuild
from sources by running all.bash (see doc/install.html).
You should also add the Go binary directory $GOROOT/bin
to your shell's path.

For example, if you extracted the tar file into $HOME/go, you might
put the following in your .profile:

    export GOROOT=$HOME/go
    export PATH=$PATH:$GOROOT/bin

See doc/install.html for more details.