Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: Support anonymously embedded fields for audit diffs#5746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 4 commits intomainfromnested-anon-struc-pairing
Jan 17, 2023

Conversation

Kira-Pilot
Copy link
Member

@Kira-PilotKira-Pilot commentedJan 17, 2023
edited by Emyrk
Loading

PR adds support for anonymously embedded structs in audit diffs. Named nested structs are still not supported.

Anonymous structs can reasonably be recursively flattened to the top level struct. This is to support#5730.

The example type in question. It is easiest to anonymously embed the Group type that is auto generated with Sqlc. TheGroup type's fields should be treated as top level fields.

typeAuditableGroupstruct {GroupMembers []GroupMember`json:"members"`}

- Unit tests for anonymously embedded structs- Add docs and refactor code around
@EmyrkEmyrk changed the titleNested anon struc pairingchore:Jan 17, 2023
@EmyrkEmyrk changed the titlechore:chore: Support anonymously embedded fields for audit diffsJan 17, 2023
@EmyrkEmyrk marked this pull request as ready for reviewJanuary 17, 2023 16:21
@Emyrk
Copy link
Member

@coadler What do you think about expanding anonymous fields like this?

I intentionally am avoiding using named nested structs, since that adds hierarchy complexity. Anonymous fields being expanded like this adds some convenience for the other PR linked in the description.

@EmyrkEmyrk requested a review fromcoadlerJanuary 17, 2023 16:23
Copy link
Contributor

@coadlercoadler left a comment

Choose a reason for hiding this comment

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

I like the addition!

@EmyrkEmyrk merged commitf0eddba intomainJan 17, 2023
@EmyrkEmyrk deleted the nested-anon-struc-pairing branchJanuary 17, 2023 18:13
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 17, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@coadlercoadlercoadler approved these changes

@EmyrkEmyrkAwaiting requested review from Emyrk

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@Kira-Pilot@Emyrk@coadler

[8]ページ先頭

©2009-2025 Movatter.jp