Skip to content

Goverage is a JetBrains plugin for GoLand that shows inline test coverage percentages for each function, powered by go tool cover.

License

Notifications You must be signed in to change notification settings

pixel365/goverage

Repository files navigation

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

  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:

    ./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:

    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

About

Goverage is a JetBrains plugin for GoLand that shows inline test coverage percentages for each function, powered by go tool cover.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published