Skip to content

Allow *any when using UnmarshalPlist()#46

Merged
jessepeterson merged 2 commits intomicromdm:mainfrom
mikeschinkel:allow-ptr-to-interface
Mar 15, 2025
Merged

Allow *any when using UnmarshalPlist()#46
jessepeterson merged 2 commits intomicromdm:mainfrom
mikeschinkel:allow-ptr-to-interface

Conversation

@mikeschinkel
Copy link
Copy Markdown
Contributor

This PR addresses the use-case discussed on the MacAdmins Slack forum with @korylprince and @jessepeterson.

Basically when a struct property is of type *CustomType it was not possible to unmarshal to that type. The fix was suggested by @korylprince which I implemented and tested for my use-case and it appears to work.

I also added a test case name TestValueForDecodeWithDict, and it as well as all other test pass.

@korylprince
Copy link
Copy Markdown
Contributor

Thanks for the PR @mikeschinkel (and for adding the test case!). I've done some experimentation with this change and confirmed it doesn't change any functionality (other than allowing the new functionality instead of returning an error).

@mikeschinkel
Copy link
Copy Markdown
Contributor Author

@korylprince — Thank you! You are the best! 😊

@jessepeterson
Copy link
Copy Markdown
Member

@mikeschinkel thanks for the PR! Would you mind revising the test data to be more simplified plist (that's only large enough to display the issue)? For clarity I'd hope to keep it as tiny as possible. Then we can get this merged. Thanks!

@mikeschinkel
Copy link
Copy Markdown
Contributor Author

@jessepeterson — I have since had to task switch to a different project. As my head isn't in this use-case at the moment I'll wait to follow up once I am back again working on my prefsctl project.

@korylprince
Copy link
Copy Markdown
Contributor

@jessepeterson I implemented a minimal test for this PR, if you can take a look.

Copy link
Copy Markdown
Member

@jessepeterson jessepeterson left a comment

Choose a reason for hiding this comment

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

lgtm! thanks @mikeschinkel and @korylprince

@jessepeterson jessepeterson merged commit c0c2f16 into micromdm:main Mar 15, 2025
6 checks passed
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