--workers is silently clamped instead of rejected #10
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
scan.go:54-56doesif workers < 1 { workers = 1 }, andmain.go:71-72registers the flag with no validation. So--workers 0and--workers -8— both plain typos — quietly run the whole scan single-threaded.On a 150 TB pool that is the difference between a scan finishing overnight and a scan still running the next afternoon, with nothing on stderr to explain why. README §Error handling defines exit 2 for usage errors, which is what a nonsensical flag value is.
Definition of done
scanrejects--workersless than 1 with a one-line usage error on stderr and exit 2.scan.go:54-56is removed, since the value is now validated upstream.runtime.NumCPU().--workers 0and--workers -1.make checkgreen.