fix: string slice support in populate#51
Merged
Akalanka47000 merged 1 commit intomainfrom Jun 16, 2025
Merged
Conversation
Reviewer's GuideThis PR updates the Populate method to accept a slice of strings and refines its parsing of comma- or space-separated field names, and adds comprehensive tests covering these new input formats. Class diagram for updated Populate method input handlingclassDiagram
class Model {
+Populate(values ...any) Model[T]
}
Model : +populate(value any) Model[T]
note for Model "Populate now accepts string, []string, or comma/space-separated string input"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Hey @Akalanka47000 - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Enable
Populateto accept string slices and various single-argument formats, and expand tests accordinglyBug Fixes:
Populateto recognize and handle[]stringinputs and properly split comma- or space-separated stringsEnhancements:
Populateto use a type switch for single-argument parsing of string and slice inputsTests:
Populatetests to cover variadic arguments, string slices, comma/space-separated strings, and both BSON and model field names