Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use go-acc #208

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ lint: ## golangci-lint
.PHONY: test
test: ## go test with race detector and code covarage
$(call print-target)
go test -race -covermode=atomic -coverprofile=coverage.out ./...
go-acc --covermode=atomic --output=coverage.out ./... -- -race
go tool cover -html=coverage.out -o coverage.html

.PHONY: mod-tidy
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ It includes:
- dependency management using [Go Modules](https://github.com/golang/go/wiki/Modules),
- code formatting using [gofumpt](https://github.com/mvdan/gofumpt),
- linting with [golangci-lint](https://github.com/golangci/golangci-lint),
- unit testing with [testify](https://github.com/stretchr/testify), [race detector](https://blog.golang.org/race-detector), code covarage [HTML report](https://blog.golang.org/cover) and [Codecov report](https://codecov.io/),
- unit testing with [testify](https://github.com/stretchr/testify),
[go-acc](https://github.com/ory/go-acc),
[race detector](https://blog.golang.org/race-detector),
code covarage [HTML report](https://blog.golang.org/cover)
and [Codecov report](https://codecov.io/),
- releasing using [GoReleaser](https://github.com/goreleaser/goreleaser),
- dependencies scanning and updating thanks to [Dependabot](https://dependabot.com),
- security code analysis using [CodeQL Action](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning),
Expand Down Expand Up @@ -130,13 +134,6 @@ You can use it to add deb/rpm/snap packages, Homebrew Tap, Scoop App Manifest et
If you are developing a library and you like handcrafted changelog and release notes,
you free to remove any usage of GoReleaser.

### Why the code coverage results are not accurate

By default `go test` records code coverage for the package that is currently tested.
If you want to get more accurate (cross-package) coverage,
then consider using [go-acc](https://github.com/ory/go-acc).
[Read more](https://www.ory.sh/golang-go-code-coverage-accurate/).

## Contributing

Simply create an issue or a pull request.
5 changes: 5 additions & 0 deletions tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.18
require (
github.com/golangci/golangci-lint v1.50.0
github.com/goreleaser/goreleaser v1.11.5
github.com/ory/go-acc v0.2.8
)

require (
Expand Down Expand Up @@ -83,6 +84,7 @@ require (
github.com/caarlos0/log v0.1.6 // indirect
github.com/cavaliergopher/cpio v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/charithe/durationcheck v0.0.9 // indirect
github.com/charmbracelet/lipgloss v0.6.1-0.20220911181249-6304a734e792 // indirect
Expand All @@ -95,6 +97,7 @@ require (
github.com/dghubble/go-twitter v0.0.0-20211115160449-93a8679adecb // indirect
github.com/dghubble/oauth1 v0.7.1 // indirect
github.com/dghubble/sling v1.4.0 // indirect
github.com/dgraph-io/ristretto v0.0.2 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/disgoorg/disgo v0.13.20 // indirect
github.com/disgoorg/log v1.2.0 // indirect
Expand Down Expand Up @@ -211,6 +214,8 @@ require (
github.com/nishanths/exhaustive v0.8.3 // indirect
github.com/nishanths/predeclared v0.2.2 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/ory/viper v1.7.5 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect
Expand Down
Loading