-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: panic during 'go mod tidy' if a line ends with an empty comment #35737
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
Change https://golang.org/cl/208273 mentions this issue: |
@bcmills I've started working on this, I have a reproducer script in the main repo and a proposed fix in x/mod. I haven't used gerrit in a while though, let me know if I do anything wrong 🙈 |
This was reported in golang/go#35737. Change-Id: I67383fbf668adea1c22feb7f8d25cd1652edcea5 Reviewed-on: https://go-review.googlesource.com/c/mod/+/208273 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Change https://golang.org/cl/208671 mentions this issue: |
When we add an "indirect" token to a line with an empty comment (only whitespace after //), we should replace the comment text. In CL 208273, we inserted "indirect;". The isIndirect predicate returns false for "// indirect;" because there's only one word. When modload.WriteGoMod is called multiple times (as it is in 'go mod tidy'), this caused us to write "// indirect; indirect". Updates golang/go#35737 Change-Id: Ic2531a61ab15df7a0d4462ea3b1d25753d06d1d1 Reviewed-on: https://go-review.googlesource.com/c/mod/+/208671 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Change https://golang.org/cl/208977 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
module awesomeProject11
Run go mod tidy on the following example:
What did you expect to see?
I expect it work without failing.
What did you see instead?
I get:
I think the problem is absence parentheses:
It should probably be:
The text was updated successfully, but these errors were encountered: