This repository has been archived by the owner on Jan 23, 2025. It is now read-only.
Unable to inject different "sling" property to API due to unexported property #1
Labels
enhancement
New feature or request
Hey guys,
I'm was playing around with https://github.com/cloudamqp/terraform-provider and trying to write some unittests and stumbled across a possible issue.
Have a look how the api variable is casted from
interface{}
to*.api.API
:resource_image.go
This would be easy to test if I could inject the api client with a fake mux to actually test the requests but the underlying code looks like this:
api/api.go
Written this way, I seem to be unable to use a different Client when defining a custom API struct since the sling property was not exported.
Is there another way to test without injecting the sling client? If so, how can I do it?
Cheers!
The text was updated successfully, but these errors were encountered: