cmd/cover: Compilation error when using -covermode=atomic on a file without a newline at the end #59081
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
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?
Recently I started upgrading go-pdfium to the latest version of pdfium (it's a CGO wrapper), I'm also upgrading to the latest Go in the test/coverage matrix.
When I completed the upgrades, I noticed that my
go test -coverprofile=coverage.out -covermode=atomic
command that generates the code coverage is broken in go 1.20, while it did work in 1.19.It resulted in the following error: https://github.com/klippa-app/go-pdfium/actions/runs/4441302163/jobs/7796211682
I later found out that this was related to the file not having a newline at the end, the following commit fixed it:
klippa-app/go-pdfium@788fce4
I don't really know how the file ended up in this state, but since it worked in 1.19, and go build/go test (with -coverprofile but without -covermode=atomic) did still work, I wanted to report it anyway, also because @bcmills said the
cover
implementation changed drastically in 1.20.What did you expect to see?
The result of the code coverage.
What did you see instead?
Error: internal/implementation_cgo/fpdf_formfill_experimental.go:285:2: expected ';', found 'var'
The text was updated successfully, but these errors were encountered: