Skip to content

struct: reflect []rune as a string - #407

Closed
team-humaki wants to merge 1 commit into
go-ini:v1from
team-humaki:struct-rune-slices
Closed

team-humaki wants to merge 1 commit into
go-ini:v1from
team-humaki:struct-rune-slices

Conversation

@team-humaki

Copy link
Copy Markdown

ReflectFrom left []rune keys empty (unsupported type '[]int32'). MapTo had the same gap.

Treat []int32 (including []rune) as a Unicode string so a field like []rune("abc") writes prop.1 = abc and maps back.

Fixes #335

unknwon commented Nov 11, 2026

Copy link
Copy Markdown
Member

Thanks. rune is an alias of int32, so this treats every []int32 as text, e.g., ports = 80, 443 maps to character codes, and ReflectFrom writes []int32{80, 443} as Pƻ. As noted on issue 335, []rune stays unsupported, so please use string.

@unknwon unknwon closed this Nov 11, 2026
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.

Serialization for arrays of rune not a possibility?

2 participants