Quoth Jérôme LAFORGE:
> I am surprised that go mod tidy doesn't remove all unnecessary
> dependencies from the go.mod.
>
> It raises some questions:
> - Is it unsafe to do this kind of process to ensure that all unnecessary
> dependencies are removed?
> - Why go mod tidy doesn't remove them?
> - How it can be done with go tools?
I have also been surprised by this behaviour. I'd be keen to hear
rationale for it, as I (no doubt naively) can't imagine why it isn't
always the correct decision to remove all unneeded dependencies in
go.mod when 'go mod tidy' is run. Indeed, I'd say that the name
'tidy' implies "remove unneeded stuff" more than "add needed stuff".