Bug
In bin/good-first-issue.js the issue selection uses:
const key = cmd.first ? 0 : Math.floor(Math.random() * Math.floor(issues.length - 1))
Because the multiplier is bounded by `issues.length - 1`, `Math.random()` can never produce `issues.length - 1`, so the final issue in the result list is never selectable.
Expected
Every returned issue should have an equal chance of being picked, including the last one.
Fix (one line)
const key = cmd.first ? 0 : Math.floor(Math.random() * issues.length)
The inner `Math.floor(issues.length - 1)` is also redundant since `issues.length` is already an integer.
Bug
In bin/good-first-issue.js the issue selection uses:
Because the multiplier is bounded by `issues.length - 1`, `Math.random()` can never produce `issues.length - 1`, so the final issue in the result list is never selectable.
Expected
Every returned issue should have an equal chance of being picked, including the last one.
Fix (one line)
The inner `Math.floor(issues.length - 1)` is also redundant since `issues.length` is already an integer.