Closed yyfyfyang closed 6 days ago
go test -coverprofile=coverage.out 在执行go test的时候获取测试覆盖率的时候测试程序会崩溃,我mac使用的是apple m1芯片
go test -coverprofile=coverage.out
unexpected fault address 0x10168b678 fatal error: fault [signal SIGBUS: bus error code=0x1 addr=0x10168b678 pc=0x10168b678] goroutine 35 gp=0x140002c96c0 m=0 mp=0x101fb0940 [running]: runtime.throw({0x1016a3d8a?, 0x14000130a20?})
或许试试xgo test -coverprofile=coverage.out 同样支持mock,但是兼容性更好,功能更多。 https://github.com/xhd2015/xgo
xgo test -coverprofile=coverage.out
@yyfyfyang apple m1芯片的问题没有完全解决
go test -coverprofile=coverage.out
在执行go test的时候获取测试覆盖率的时候测试程序会崩溃,我mac使用的是apple m1芯片