Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Go: coverage profile is never matched, so every site is reported uncovered and the run exits 0

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@vducong is already working on this.

Since Oct 26, 2026.

  • #7 by @vducong — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, python
Domain
tooling

Research direction

Start in target/coverage/go/coverage.out handling and the coverage.covered_lines / _suffix_rank / _lookup functions the issue names. Reproduce with the given Go module repro, then add a candidate that strips the module path from go.mod off profile keys (or adds a root-relative path candidate). Done: Go profiles match on a covered module, mutants are killed, and the exit code reflects killed mutants.

Written by the indexing model from the issue text.

Description

On a Go module, mutator reports every site as uncovered and exits 0, even when the tests cover the line. With --no-coverage the same sites run.

Repro (mutator a5a0cb8, crapper 6fd92c4, go 1.25.8, macOS)

go.mod: module example.com/demo

calc/calc.go:

package calc

func Max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

calc/calc_test.go:

package calc

import "testing"

func TestMax(t *testing.T) {
	if Max(2, 1) != 2 || Max(1, 2) != 2 {
		t.Fatal("wrong max")
	}
}
$ ../mutator/mutator calc/calc.go
Max      example.com/demo/calc       0         0          1      1    n/a
$ echo $?
0
$ ../mutator/mutator --no-coverage calc/calc.go
Max      example.com/demo/calc       0         1          0      1   0.0%

crapper reads the same profile correctly (Max example.com/demo/calc 2 100.0% 2.0).

Cause, as far as I can tell

target/coverage/go/coverage.out names the file by import path, example.com/demo/calc/calc.go. coverage.covered_lines looks it up by absolute path, /…/mutrepro/calc/calc.go. _suffix_rank only matches when one path is a suffix of the other, and these two share only the tail calc/calc.go, so _lookup returns None and every line counts as uncovered.

Why it matters

Exit 0 means every executed mutant was killed. Used as a gate on a Go project, mutator passes without running a mutant.

Possible fix

Strip the module path from go.mod off Go profile keys before matching, or add the root-relative path to the lookup candidates.

Dominant language
Python
Stars
55
Forks
7
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from unclebob/mutator

All issues in unclebob/mutator

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.