-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modfile: remove trailing newline from comment tokens
In v0.2.0, the go.mod lexer removed trailing LF bytes from comment tokens. This regressed in v0.3.0. Documentation on Comment.Token says the trailing newline should not be included. This CL fixes the lexer to strip trailing newlines again. It will now strip both LF and CRLF newlines. It also includes a test to ensure comments are attached at the right place in the syntax tree with the right content. Fixes golang/go#39913 Change-Id: I7fba0ed3c85f0a3c23fefc6b7fecfe6df7777aea Reviewed-on: https://go-review.googlesource.com/c/mod/+/240557 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
- Loading branch information
Jay Conrod
committed
Jul 6, 2020
1 parent
0b26df4
commit 89ce4c7
Showing
2 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters