Closed greenpipig closed 1 year ago
This looks strange indeed.
My first idea is that the function BranchCovTest is in the test code. By default, gobco doesn't instrument any code in *_test.go
.
If that's not the cause, please run gobco in verbose mode and keep the temporary files. Maybe you get some hints from there.
If that doesn't help either, please provide a self-contained runnable example so I can reproduce the problem on my own computer.
I tried to reproduce the problem you described:
BranchCovTest
goes into main.go
TestBranchCovTest
goes into main_test.go
gobco
$ gobco
ok gobco-24 2.833s
Branch coverage: 8/12
main.go:6:6: condition "node > 50" was 2 times false but never true
main.go:7:6: condition "node == 0" was 2 times false but never true
main.go:8:6: condition "node < 0" was 2 times false but never true
main.go:13:5: condition "node == 3" was 2 times false but never true
Feedback timeout.
use gobco cannot work
go-version: echo $GOROOT /go/go1.16
origin func:
test func:
output: