You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.
Hi @starsz, I find the proposal to adopt interfaces reasonable and your use case valid. Its a large undertaking however and a potentially backwards incompatible change (so a major version bump may be warranted).
Just to make sure you have explored the option, did you try to pass your own implementation of http.Client? Its not exactly the same, but you can mock the HTTP layer by providing a custom client.
Just to make sure you have explored the option, did you try to pass your own implementation of http.Client? Its not exactly the same, but you can mock the HTTP layer by providing a custom client.
You can't pass an own implementation of http.Client either because the function uses the http.Client struct type instead of an interface around the Do method. Is there any other way to inject it?
Description
Hello, I found that the xxxManager was defined as a struct.
And it was referenced in management.
auth0/management/management.go
Lines 85 to 106 in 0ed82d2
auth0/management/user.go
Lines 280 to 282 in 0ed82d2
Affected Resources
management.Xxx
management.XxxManager
Potential Sample Code
I recommend to use interface instead of struct in xxxManager
Like this:
So that we can mock the
Management.User
and do some unit tests.The same as other managers.
The text was updated successfully, but these errors were encountered: