refactor(gih): clean up version handling and arg formatting#28
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Refactors gih/main.go to make version reporting and argument logging less error-prone and easier to extend with future subcommands, without changing the core sync behavior.
Changes:
- Remove the hardcoded
goversionvariable and print the Go runtime version viaruntime.Version(). - Normalize the
args:log line spacing to single spaces. - Replace the
ifsubcommand check with aswitchand extract version printing intoprintVersion().
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.
Issue
tasks/improvements-review-2026-04-26.md残課題 #13(13 項目中 12 完了の最後の 1 項目)。gih/main.goの軽微なクリーンアップ。Overview
gih/main.goの 3 サブ項目に対応。ユーザー機能影響ゼロの純粋な保守性向上。変更内容
goversionをruntime.Version()化goversion = "1.26.2"変数を削除gih versionの go バージョン表示をruntime.Version()の戻り値に変更出力フォーマットの 2 スペースを 1 スペースに統一
args:出力行のconcurrency:/timeout:前の 2 スペースを 1 スペースに統一targetDir: %s ignoreDir: %s concurrency: %d timeout: %vtargetDir: %s ignoreDir: %s concurrency: %d timeout: %vsubcommand を
ifからswitch+printVersion()関数に整理if flag.Arg(0) == "version"をswitch文に変更printVersion()関数に切り出しcase "X": runX()の 1 行で済む形に検証
make build && make test && make lintすべてグリーンgih_dev version→git-here '0.0.1-test'+go version go1.26.2gih_dev --target "^x" --ignore "^y" status→args: targetDir: ^x ignoreDir: ^y concurrency: N timeout: 20s(1 スペース統一)gih_dev fetch等)は switch を通過して syncer に正常委譲flag.Usage()表示で exit 1🤖 Generated with Claude Code