decred / dcrd

Decred daemon in Go (golang).
https://decred.org
ISC License
731 stars 289 forks source link

build: Rework lint script to use go.mod files. #3365

Closed davecgh closed 1 month ago

davecgh commented 1 month ago

This reworks the logic in the lint script for determining which modules to lint to use the existence of a go.mod file instead of attempting to use the result of go list.

The existing logic is to pick the dependencies out of output of go list which have the main module as a prefix. However, that is error prone because go list also reports indirect dependencies which may themselves depend on older versions of modules that are no longer in the repo, but naturally have the prefix that is being filtered.

Searching for the go.mod files in the repo is a simpler approach that isn't prone to the aforementioned issue while still dynamically finding all modules in the repo.