As pointed out in #48938, gopls doesn't currently tag unused variables as 'unnecessary', because we compute the 'unnecessary' tag by looking for suggested fixes that are pure deletions. We could change the way we compute the 'unnecessary' tag, but it is approximately the same amount of work to provide a suggested fix.
This is a good issue for an external contributor, as it just involves writing and hooking up an analyzer.
The text was updated successfully, but these errors were encountered:
Please feel free to pick this one up. I think it should be as simple as finding the enclosing spec/decl and suggesting to delete it (though you'll have to be a bit careful about declarations with more than one spec).