Skip to content

struct: preserve embedded values in non-unique sections - #421

Closed
Narek-Khachikyan wants to merge 1 commit into
go-ini:mainfrom
Narek-Khachikyan:fix/327-embedded-nonunique-sections
Closed

Narek-Khachikyan wants to merge 1 commit into
go-ini:mainfrom
Narek-Khachikyan:fix/327-embedded-nonunique-sections

Conversation

@Narek-Khachikyan

Copy link
Copy Markdown

Describe the pull request

ReflectFrom writes embedded fields into the first matching section, so the second BigSlot overwrites the first slot's ID and loses its own. Keep nested fields in the current section occurrence when the section names match.

The regression calls ReflectFrom and WriteTo in memory. Before the fix, it produces ID 4 with blue and no ID with red. After the fix, it produces ID 3 with blue and ID 4 with red.

Proof: go test -v -race ./..., go vet ./..., and golangci-lint run --timeout=30m pass. Formatting checks are clean.

Fixes #327.

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code.

@Narek-Khachikyan Narek-Khachikyan closed this by deleting the head repository Nov 9, 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.

Allow NonUniqueSections not working for Embedded Structs

1 participant