https://github.com/pixel365/goverage
Goverage is a JetBrains plugin for GoLand that shows inline test coverage percentages for each function, powered by go tool cover.
https://github.com/pixel365/goverage
go goland goland-plugin golang idea-plugin jetbrains jetbrains-plugin
Last synced: 6 months ago
JSON representation
Goverage is a JetBrains plugin for GoLand that shows inline test coverage percentages for each function, powered by go tool cover.
- Host: GitHub
- URL: https://github.com/pixel365/goverage
- Owner: pixel365
- License: mit
- Created: 2025-07-07T06:03:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-09T15:32:58.000Z (about 1 year ago)
- Last Synced: 2025-10-13T02:41:33.590Z (10 months ago)
- Topics: go, goland, goland-plugin, golang, idea-plugin, jetbrains, jetbrains-plugin
- Language: Kotlin
- Homepage:
- Size: 106 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Goverage – Inline Go Code Coverage Hints
**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.
---
## ✨ Features
- ✅ **File-level coverage**: shown above the `package` line.
- ✅ **Function-level coverage**: shown above each `func` declaration.
- ✅ Parses `coverage.out` generated by `go test -coverpkg=./... -coverprofile=coverage.out`.
- ✅ Updates automatically when the file or coverage profile changes.
---
## 📦 Installation
### ✅ From JetBrains Marketplace
👉 [Install via JetBrains Marketplace](https://plugins.jetbrains.com/plugin/27851-goverage)
1. Open your JetBrains IDE (e.g. GoLand or IntelliJ IDEA).
2. Go to **Settings → Plugins → Marketplace**.
3. Search for **Goverage**, then click **Install**.
4. Restart the IDE if prompted.
---
### 🛠 Manual Installation
1. Clone the repository and build the plugin:
```bash
./gradlew clean buildPlugin
```
2. In your JetBrains IDE:
- Go to **Settings → Plugins → ⚙️ → Install Plugin from Disk**.
- Select the `.zip` file from `build/distributions`.
---
## 🚀 Usage
1. Generate a coverage profile in the root of your Go module:
```bash
go test -coverpkg=./... -coverprofile=coverage.out
```
2. Open any `.go` file in your project.
3. You’ll see inline hints like:
```
File Coverage: 91.75%
Function Coverage: 85.00%
```
## 🛠️ Notes
- 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` and `coverage.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.
---
## 📄 License
[MIT](https://github.com/pixel365/goverage/blob/main/LICENSE)