also tell me why these only occurred after the merge and were not blocking before merging the trail/branch
Assistant· claude-opus-5
I'll fetch the CI run details.
Assistant· claude-opus-5
Now the fix — use the package's existing schemeHTTP/schemeHTTPS constants (declared in login.go:25-26):
Assistant· claude-opus-5
User
open a trail for these changes
Assistant· claude-opus-5
Committed. Waiting on mise run test:ci before pushing.
Assistant· claude-opus-5
The commit is in place on fix/goconst-scheme-constants. mise run test:ci is still running — I'll create the trail once it passes.
The two errors (both goconst, both in cmd/entire/cli/plugin_fetch.go):
code
plugin_fetch.go:59:7: string `https` has 3 occurrences, but such constant `schemeHTTPS` already exists
plugin_fetch.go:61:7: string `http` has 3 occurrences, but such constant `schemeHTTP` already exists
login.go:25-26 already declares schemeHTTP/schemeHTTPS for the same package, so the literals just needed to use them. Fixed in the working tree:
plugin_fetch.go:59,61 — case "https": / case "http": → case schemeHTTPS: / case schemeHTTP:
mise run fmt && mise run lint → 0 issues. Package tests for the touched code pass.
Why it only broke after the merge
This is a semantic merge conflict — neither side was wrong on its own, only their sum.
goconst counts occurrences per package, and its threshold is 3. The literals were split across two files that never existed at the same time until the merge:
Commit
plugin_fetch.go
review_target.go
occurrences of "https"
lint
main before merge (6e7985f4e)
2 (lines 59, 124)
absent
2
✅ pass
trail branch head (b989d612c)
absent
1 (line 142)
1
✅ pass
merge (f6fd1159d)
2
1
3
❌ fail
Both parents were genuinely linted and genuinely green — the trail branch head has a successful lint check run, and main's previous push passed too. The timing is the whole story:
The trail branch last merged main at fbbff047 on Aug 10, 08:38.
plugin_fetch.go landed on main at 18f9bcd9d (PR #1422) on Aug 10, 21:42 — about 13 hours later.
So the branch never had plugin_fetch.go in its tree, and main never had review_target.go. Nothing in either diff overlaps, so git merged cleanly, and only the merge commit's package hit 3.
Two things worth noting:
goconst blames the wrong file. It reported plugin_fetch.go, which was unchanged by the merge. The new code was review_target.go. That's expected behavior for a package-wide counter, but it makes the error look like a regression in code nobody touched.
Nothing lints the merge result before it lands..github/workflows/lint.yml checks out github.event.pull_request.head.sha — the branch head, not GitHub's merge ref. The push-to-main run is the first time the merged tree is ever linted, so any package-counting linter (goconst, dupl, maintidx) can only be caught after the fact. Switching the checkout to the default (the PR merge commit) would catch this class before merge; the tradeoff is that the run then depends on main moving underneath the PR.