Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change User and Tenant param type to ...any #36

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ The `oops.OopsError` builder must finish with either `.Errorf(...)`, `.Wrap(...)
| `.Span(string)` | `err.Span() string` | Add a span representing a unit of work or operation... (default: ULID) |
| `.Hint(string)` | `err.Hint() string` | Set a hint for faster debugging |
| `.Owner(string)` | `err.Owner() (string)` | Set the name/email of the collegue/team responsible for handling this error. Useful for alerting purpose |
| `.User(string, any...)` | `err.User() (string, map[string]any)` | Supply user id and a chain of key/value |
| `.Tenant(string, any...)` | `err.Tenant() (string, map[string]any)` | Supply tenant id and a chain of key/value |
| `.User(string, any...)` | `err.User() (string, any...)` | Supply user id and a chain of key/value |
| `.Tenant(string, any...)` | `err.Tenant() (string, any...)` | Supply tenant id and a chain of key/value |
| `.Request(*http.Request, bool)` | `err.Request() *http.Request` | Supply http request |
| `.Response(*http.Response, bool)` | `err.Response() *http.Response` | Supply http response |

Expand Down
4 changes: 2 additions & 2 deletions oops.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ func Owner(owner string) OopsErrorBuilder {
}

// User supplies user id and a chain of key/value.
func User(userID string, data map[string]any) OopsErrorBuilder {
func User(userID string, data ...any) OopsErrorBuilder {
return new().User(userID, data)
}

// Tenant supplies tenant id and a chain of key/value.
func Tenant(tenantID string, data map[string]any) OopsErrorBuilder {
func Tenant(tenantID string, data ...any) OopsErrorBuilder {
return new().Tenant(tenantID, data)
}

Expand Down