Skip to content

fix(config): preserve Windows hub registry paths#244

Merged
RussellLuo merged 2 commits into
OpenCSGs:mainfrom
wanghaojie124:dev
Jun 25, 2026
Merged

fix(config): preserve Windows hub registry paths#244
RussellLuo merged 2 commits into
OpenCSGs:mainfrom
wanghaojie124:dev

Conversation

@wanghaojie124

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread internal/config/config.go

func parseRawStringValue(raw string) string {
return strings.Trim(strings.TrimSpace(raw), `"`)
raw = strings.TrimSpace(raw)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this now relies on strconv.Unquote rather than a plain trim, it would help to add a short comment here explaining why: this preserves canonical TOML-escaped content for values like Windows hub registry paths, and avoids double-escaping on later save cycles. For example: // Preserve escaped TOML string content such as Windows paths. A plain trim would cause double-escaping on later save cycles.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I think we can keep this helper without an inline comment for now: the implementation is still fairly direct, and the new tests already capture the main reason for the change, namely preserving escaped TOML content such as Windows paths and avoiding double-escaping on save. Adding that context here may end up encoding a very specific bug history into a general-purpose parsing helper. If we find this pattern becoming non-obvious elsewhere, I would be more inclined to document it at the config parsing level instead.

@RussellLuo RussellLuo merged commit 47579db into OpenCSGs:main Jun 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants