]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/cover: error out if a requested source file contains a newline
authorBryan C. Mills <bcmills@google.com>
Mon, 15 May 2023 15:49:56 +0000 (11:49 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 7 Jun 2023 16:54:28 +0000 (16:54 +0000)
commit3d78c735fc7d213e23383b9744297bd5251dc0e3
tree7b24d3ae5b075e452a95b96b907ce954f17f0285
parentc48228312e7fdd9580078f58f5f4a287ce1185d5
cmd/cover: error out if a requested source file contains a newline

cmd/cover uses '//line' directives to map instrumented source files
back to the original source file and line numbers.
Line directives have no way to escape newline characters, so cmd/cover
must not be used with source file paths that contain such characters.

Updates #60167.

Change-Id: I6dc039392d59fc3a5a6121ef6ca97b0ab0da5288
Reviewed-on: https://go-review.googlesource.com/c/go/+/501577
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/cover/cover.go
src/cmd/cover/cover_test.go