Skip to content

fix: report map string conversion errors - #364

Open
ryanchou1994 wants to merge 1 commit into
spf13:masterfrom
ryanchou1994:fix/string-map-conversion-errors
Open

ryanchou1994 wants to merge 1 commit into
spf13:masterfrom
ryanchou1994:fix/string-map-conversion-errors

Conversation

@ryanchou1994

Copy link
Copy Markdown

ToStringMapStringE currently discards conversion errors from map keys and values. For example, a map value containing an unsupported slice returns an empty string with a nil error.

Return the first conversion error while continuing to build the complete result. ToStringMapString keeps its existing output, including zero values for entries that cannot be converted. Each key and value is converted once.

The regression tests cover invalid keys and values, mixed entries, named map types, JSON input, and Stringer call counts.

Validation: full shuffled race tests, go vet, and go build passed on Linux with Go 1.21.13 and 1.27.1; golangci-lint 2.13.1 reported no issues.

Related #159. This addresses missing error reporting; it does not add slice-to-JSON conversion.

Copilot AI lite review requested due to automatic review settings September 21, 2026 03:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CLAassistant

CLAassistant commented Sep 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

3 participants