xdsclient: remove unexported method from ResourceData interface #7835
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.
Having an unexported method in the
ResourceData
interface is not very useful since it has other exported methods. Implementations are currently forced to embed this interface to satisfy it. But if a breaking change is made to the interface, implementations will panic at runtime if the newly added method is called (since they embed the interface and therefore satisfy the interface, but don't have an implementation for the newly added method).Removing the unexported interface results in implementations no longer having to embed this interface. Instead, they can rely on compile time type assertions to ensure that their implementation satisfies the interface, and therefore their build will fail at compile time if a breaking change is made to the interface (instead of a runtime panic).
RELEASE NOTES: none