8000 Guard recursive embedded XML type discovery by dajiaohuang · Pull Request #1788 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Guard recursive embedded XML type discovery - #1788

Open
dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/fakexml-recursive-embed
Open

dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/fakexml-recursive-embed

Conversation

@dajiaohuang
@dajiaohuang dajiaohuang commented Oct 1, 2026 •
Copy link
Copy Markdown

fakexml recursively resolves embedded struct fields before caching type information. A valid self-embedded pointer struct recurses indefinitely in getTypeInfo and can crash staticcheck when marshaled to XML. Track the current type-info recursion path and treat revisiting a type as contributing no additional promoted fields; add an SA1026 fixture.

Review update: the unrelated generic-instantiation change and its fixture were removed through a normal follow-up commit; #1764 tracks that fix separately. Current-head validation: go test ./staticcheck/sa1026 passed (three tests); git diff --check passed. Prior validation text above is historical unless repeated here.

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.

1 participant

0