The specification proposal at golang.org/issue/13560 has changed.
This updates the parser implementation for the latest spec
as described at https://golang.org/s/generatedcode:
Generated files are marked by a line of text that matches
the regular expression, in Go syntax:
^// Code generated .* DO NOT EDIT\.$
The .* means the tool can put whatever folderol it wants in there,
but the comment must be a single line and must start with Code generated
and end with DO NOT EDIT., with a period.
The text may appear anywhere in the file.
The new implementation for this spec is simpler. It uses bufio.Reader
and ReadBytes. The performance can be optimized further by using lower
level IO primitives and allocating less, but the first priority is
getting a correct parser out for the latest spec. It can be optimized
later as needed.
The main cause of inefficiency is having to read the entire file,
without being able to stop early, because the new specification
allows the comment to appear anywhere in the file.
GitHub-Pull-Request: https://github.com/shurcooL/go/pull/29