add go coverage
parent
b6ddf37d2f
commit
b9c51411df
|
@ -1,5 +1,18 @@
|
||||||
# [testing](https://golang.org/pkg/testing/)
|
# [testing](https://golang.org/pkg/testing/)
|
||||||
|
|
||||||
|
## Coverage
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Write a coverage profile
|
||||||
|
go test -coverprofile=coverage.out ./...
|
||||||
|
|
||||||
|
# Coverage
|
||||||
|
go tool cover -func=coverage.out
|
||||||
|
|
||||||
|
# Coverage with HTML
|
||||||
|
go tool cover -html=coverage.out
|
||||||
|
```
|
||||||
|
|
||||||
## Benchmark
|
## Benchmark
|
||||||
|
|
||||||
Any benchmark should be careful to prevent **compiler optimization**.
|
Any benchmark should be careful to prevent **compiler optimization**.
|
||||||
|
|
Loading…
Reference in New Issue