go: cmd/cover: panic: overlapping edits
Hello all with the latest RC if i run tests all is ok, if I run them with coverage I run into this error:
cover poc/all_test
panic: overlapping edits: [4371,4375)->"", [4372,4372)->"_cover_atomic_.AddUint32(&GoCover_2_646536633930623366336461.Count[26], 1);"
goroutine 1 [running]:
cmd/internal/edit.(*Buffer).Bytes(0xc0421223c0, 0xc0420421e0, 0x63b4a0, 0xc0420ee580)
C:/workdir/go/src/cmd/internal/edit/edit.go:79 +0x51c
main.annotate(0xc042044060, 0x53)
C:/workdir/go/src/cmd/cover/cover.go:332 +0x46f
main.main()
C:/workdir/go/src/cmd/cover/cover.go:88 +0x187 ```
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (7 by maintainers)
Thanks. The problem only arises because your main.go file has not been through gofmt. If I run gofmt on the file, the problem disappears.
The problem is specifically
}else{
. If I change that to} else{
(adding a space after the}
, as gofmt does) then the problem does not occur.main.go:
main_test.go:
go test -cover