fix(cli): return error for non-positive --chunk-size#4
Merged
Congregalis merged 1 commit intomainfrom Mar 12, 2026
Merged
Conversation
Congregalis
commented
Mar 12, 2026
Owner
Author
Congregalis
left a comment
There was a problem hiding this comment.
LGTM ✅\n\n- 现在对 直接返回明确错误,比之前静默回退到默认值更符合直觉(fail fast)。\n- 测试覆盖了 0/-1 两种输入,足够。\n\n小建议(可选):把 table-driven 用 包一下,失败时更好定位具体 case。\n\n我觉得可以合并。
Congregalis
commented
Mar 12, 2026
Owner
Author
Congregalis
left a comment
There was a problem hiding this comment.
LGTM ✅
- 现在对
--chunk-size <= 0直接返回明确错误,比之前静默回退到默认值更符合直觉(fail fast)。 - 测试覆盖了 0/-1 两种输入,足够。
小建议(可选):把 table-driven 用 t.Run(value, ...) 包一下,失败时更好定位具体 case。
我觉得可以合并。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parseFlagsto return an explicit error when--chunk-size <= 0--chunk-size must be positiveinternal/cli/run_test.gofor--chunk-size 0and--chunk-size -1Testing
gotoolchain is not installed:go: command not found)Fixes #1