Goverage is a JetBrains IDE plugin that displays inline code coverage for Go files based on the go test -coverprofile
report.
It supports GoLand, IntelliJ IDEA Ultimate, and any JetBrains IDE with the Go plugin.
- ✅ File-level coverage: shown above the
package
line. - ✅ Function-level coverage: shown above each
func
declaration. - ✅ Parses
coverage.out
generated bygo test -coverpkg=./... -coverprofile=coverage.out
. - ✅ Updates automatically when the file or coverage profile changes.
👉 Install via JetBrains Marketplace
- Open your JetBrains IDE (e.g. GoLand or IntelliJ IDEA).
- Go to Settings → Plugins → Marketplace.
- Search for Goverage, then click Install.
- Restart the IDE if prompted.
-
Clone the repository and build the plugin:
./gradlew clean buildPlugin
-
In your JetBrains IDE:
- Go to Settings → Plugins → ⚙️ → Install Plugin from Disk.
- Select the
.zip
file frombuild/distributions
.
-
Generate a coverage profile in the root of your Go module:
go test -coverpkg=./... -coverprofile=coverage.out
-
Open any
.go
file in your project. -
You’ll see inline hints like:
File Coverage: 91.75% Function Coverage: 85.00%
- Coverage is resolved using the path format found in
coverage.out
, typically like:
github.com/your/module/pkg/file.go
- The plugin reads the
go.mod
file to determine the module name. - Only works with monorepos if
go test
andcoverage.out
are executed per-module. - Coverage is computed based on Go’s
coverprofile
format, which counts covered statements, not lines. - Integration tests might not hit every code path, even if the file is used indirectly.
- Some files may appear with partial coverage if branches or conditions are not fully executed.