Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unused required some changes to have a correctly working whole program mode. We had to let go of using *ssa.Functions to identify functions, as we cannot persist them across packages anymore. Instead, we switched to strings for deduplication and finding the "owning" types.Object of functions, even those that do not have a types.Object recorded in the SSA graph. To enable whole program mode, staticcheck accepts the new -unused.whole-program flag. An alternative approach we tried was to run two instances of unused, one in normal mode and one in exported mode. However, the cost of whole program mode is significant and we don't want to subject all users to it. When unused runs in whole program mode, its check name changes to U1001. This is so that linter directives and configuration files can address both modes separately.
- Loading branch information