Editor support for gooze, the Go
mutation-testing tool. goozels adds autocompletion, hovers, live error-checking,
and one-click mutation runs to your editor — for both //gooze:ignore comments in
your Go code and your gooze.yaml config file.
It works by sitting in front of gopls (the standard Go language server), so you
keep all your normal Go features and simply get gooze ones on top.
In your .go files
-
Autocomplete the mutagen names in a
//gooze:ignorecomment:x := a + b //gooze:ignore ari⌶ → arithmetic, …
-
Hover a mutagen name to see what it does.
-
A warning squiggle if you mistype one:
y := a - b //gooze:ignore bogus ⚠ unknown gooze mutagen "bogus"
-
▶ gooze run, gooze list, and 📊 gooze report buttons (code lenses) at the top of every Go file — run mutation testing or open the report without leaving the editor.
-
Report results, in your editor. After a run, goozels reads gooze's reports and shows each file's mutation score at the top — e.g. "gooze: 2/10 mutants survived — score 80%" — and marks the approximate spots where mutants survived.
In your gooze.yaml
- Autocomplete config keys (
output,run.parallel,log.level, …) and their allowed values. - Hover a key to see its type, meaning, and default.
- Live validation: unknown keys and bad values (e.g.
log.level: loud) are flagged as you type.
The mutagens you can reference in //gooze:ignore are: arithmetic, boolean,
numbers, comparison, logical, unary, branch, statement, loop.
An empty //gooze:ignore skips them all.
- Go (to install goozels) — https://go.dev/dl/
- gopls — the Go language server:
go install golang.org/x/tools/gopls@latest - gooze — only needed for the run / list buttons:
go install gooze.dev/pkg/gooze@latest
goozels finds gopls and gooze on your PATH automatically.
go install gooze.dev/pkg/goozels/cmd/goozels@latestThis puts a goozels binary in your Go bin directory (usually ~/go/bin — make
sure it's on your PATH). Check it:
goozels --helpPick your editor — each guide is a couple of lines of config:
| Editor | Guide |
|---|---|
| VS Code | editors/vscode/README.md — easiest: add "go.alternateTools": { "gopls": "goozels" } to settings |
| Neovim | editors/neovim.md |
| GoLand / IntelliJ | editors/jetbrains.md |
| Other LSP editors | Launch goozels over stdio wherever you'd launch gopls, and also attach it to gooze.yaml files. |
goozels replaces gopls in your editor (it runs gopls for you behind the scenes). You don't need to configure gopls separately, and you shouldn't run both for the same files.
Open the examples in testdata/:
testdata/example.go— put your cursor after//gooze:ignoreand trigger completion; hover the mutagen names; notice the warning on the intentionally-wrongbogus.testdata/gooze.yaml— add a new key and let it complete; changelog.levelto something invalid and watch it get flagged.
goozels needs no configuration, but you can point it at specific binaries:
| Flag | Environment variable | Default | Purpose |
|---|---|---|---|
--gopls PATH |
GOOZELS_GOPLS |
gopls on PATH |
The Go language server to run behind goozels |
--gooze PATH |
GOOZELS_GOOZE |
gooze on PATH |
The gooze binary used by the run / list buttons |
- No Go features at all — goozels couldn't start
gopls. Make suregoplsis installed and on yourPATH, or setGOOZELS_GOPLSto its full path. - The ▶ run / list buttons do nothing / error —
goozeisn't installed or on yourPATH. Install it (see Requirements) or setGOOZELS_GOOZE. - No report scores appear — run mutation testing first (the ▶ gooze run
button or
gooze run ./...). goozels reads the.gooze-reports/directory in your workspace root. The per-line "surviving mutant" markers are approximate: gooze doesn't record exact line positions in its reports, so the file-level score is exact but the in-line markers are a best-effort hint. - Doubled completions in GoLand — GoLand has its own Go engine, so it shows both. See the note in the JetBrains guide.
goozels: command not found— your Go bin directory isn't onPATH. Addexport PATH="$PATH:$(go env GOPATH)/bin"to your shell profile.
MIT.
Contributing or curious how it works? See CONTRIBUTING.md.