-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go generate unexpected EOF error when comment lacks newline at EOF #32607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is working as designed. Why do you think it is a bug? |
Where is that expectation documented? I don't see that it's a necessary or useful requirement, and it's confusing to encounter in the wild. I have a small patch to fix this ready (once I sort out CLA concerns with my employer). When an EOF is encountered, the generate comment has been read into a buffer. All it needs is a '\n' appended to it to parse and exec, but the current implementation returns |
I forgot to mention when I filed this issue, I'm not the first person to run into this. See #18066. |
Let's just define |
(If you want to send a very short doc change, we can consider it.) |
The only documentation I'm aware of is here: https://golang.org/pkg/cmd/go/internal/generate/ As someone who supports multiple generators for a number of other developers, this is an error I'm likely to be dealing with again. My users are unlikely to be viewing the godocs for that internal package. In my opinion, if I suppose this issue doesn't matter. It's small and the fix is trivial and I'll post it up for review as soon as my employer allows me to. |
I think you are misreading #1178.
|
Ah, my mistake. I guess my colleague who encountered this must not have integrated |
What version of Go are you using (
go version
)?What did you do?
The text was updated successfully, but these errors were encountered: