fix: change User and Tenant param type to ...any#36
Conversation
|
Warning: it might cause a breaking change. I suggest 3 interpretations of the parameters:
Please check the implem of slog.Group or slog.With, which is similar. |
5ad28fb to
463623e
Compare
… pairs, map[string]any and slog
463623e to
a0a1027
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
==========================================
- Coverage 85.08% 84.30% -0.78%
==========================================
Files 14 14
Lines 972 1013 +41
==========================================
+ Hits 827 854 +27
- Misses 119 133 +14
Partials 26 26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates the oops.User and oops.Tenant helpers to accept variadic attribute inputs (matching the underlying builder API), and enhances attribute parsing to support additional structured input forms.
Changes:
- Change
oops.User(...)/oops.Tenant(...)signatures frommap[string]anyto...any. - Extend builder parsing to support
map[string]anyandslog.Attr(includingslog.Group) in user/tenant attributes. - Update README examples and add test cases covering
slog.Attr+ mixed argument forms for user attributes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| README.md | Updates API documentation and examples for the new User/Tenant attribute formats. |
| oops.go | Changes top-level User/Tenant function signatures to ...any and forwards args to the builder. |
| builder.go | Introduces shared argument-to-map conversion supporting slog.Attr, map[string]any, and string key/value pairs. |
| oops_test.go | Adds tests for User(...) using slog.Attr/slog.Group and mixed map + key/value arguments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Hey 👋,
oops.User()only acceptmap[string]anyas second argument but the underlying function is expecting...any(chain of key/value)This is the same for
oops.Tenant()This result in this code working
But this code does not