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

Add reflection.Type[T]() helper and use it. #370

Merged
merged 3 commits into from
Jun 1, 2023

Conversation

ghemawat
Copy link
Collaborator

@ghemawat ghemawat commented Jun 1, 2023

Previously we would have to write complicated code to get the reflect.Type for an interface since an interface cannot have a concrete value and therefore reflect.TypeOf() did not work. Encapsulated this logic into a single generic function.

Previously we would have to write complicated code to get the
reflect.Type for an interface since an interface cannot have a
concrete value and therefore reflect.TypeOf() did not
work. Encapsulated this logic into a single generic function.
@ghemawat ghemawat requested a review from mwhittaker June 1, 2023 16:03
Copy link
Member

@mwhittaker mwhittaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!!!

internal/reflection/reflection_test.go Outdated Show resolved Hide resolved
@ghemawat ghemawat merged commit c989c90 into ServiceWeaver:main Jun 1, 2023
7 checks passed
@ghemawat ghemawat deleted the typeof branch June 1, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants