Summary
hugo/helpers.go contains four unexported functions that are never called anywhere in the hugo module:
extractImageLinks (helpers.go:14)
downloadImages (helpers.go:28)
replaceImageLinks (helpers.go:60)
downloadImageAsBytes (helpers.go:75)
All four have zero call sites (verified by grep across hugo/**/*.go, excluding their own definitions). They appear to be image-link rewriting helpers that were never wired into an exported module function (last touched in 309376b feat: fix/update-hugo-img-rewrites).
Why it isn't already failing lint
The repo's golangci-lint runs with only-new-issues: true, so the pre-existing unused findings are grandfathered and never reported. This was surfaced in #308: re-applying a refactor from the stale #152 touched these lines, which made golangci-lint flag them as new unused/errcheck issues — at which point it became clear the whole file is dead.
Proposed action
Either:
- Delete
hugo/helpers.go if the image-rewrite feature is not planned, or
- Wire the helpers into the intended exported function if the feature was meant to ship.
Option 1 is the likely answer; confirm with whoever authored the img-rewrite work.
Notes
- These are unexported funcs, so removing them is not a breaking change to module consumers.
- Pure cleanup —
chore:/refactor: scope, no release impact.
Filed as follow-up to #308 (which salvaged the still-relevant parts of the now-closed #152).
Summary
hugo/helpers.gocontains four unexported functions that are never called anywhere in thehugomodule:extractImageLinks(helpers.go:14)downloadImages(helpers.go:28)replaceImageLinks(helpers.go:60)downloadImageAsBytes(helpers.go:75)All four have zero call sites (verified by grep across
hugo/**/*.go, excluding their own definitions). They appear to be image-link rewriting helpers that were never wired into an exported module function (last touched in309376b feat: fix/update-hugo-img-rewrites).Why it isn't already failing lint
The repo's golangci-lint runs with
only-new-issues: true, so the pre-existingunusedfindings are grandfathered and never reported. This was surfaced in #308: re-applying a refactor from the stale #152 touched these lines, which made golangci-lint flag them as newunused/errcheckissues — at which point it became clear the whole file is dead.Proposed action
Either:
hugo/helpers.goif the image-rewrite feature is not planned, orOption 1 is the likely answer; confirm with whoever authored the img-rewrite work.
Notes
chore:/refactor:scope, no release impact.Filed as follow-up to #308 (which salvaged the still-relevant parts of the now-closed #152).