Skip to content

Conversation

@wmypku
Copy link

@wmypku wmypku commented Aug 26, 2025

Why this should be merged

Try to use better api reflect.TypeFor instead of reflect.TypeOf when we have known the type.

More info golang/go#60088

How this works

How this was tested

Need to be documented in RELEASES.md?

Signed-off-by: wmypku <wmypku@outlook.com>
func TestVMServerInterface(t *testing.T) {
var wantMethods, gotMethods []string
pb := reflect.TypeOf((*vmpb.VMServer)(nil)).Elem()
pb := reflect.TypeFor[vm.VMServer]()
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that we should also be using this below here and in the codec/reflectcodec package.

Copy link
Author

Choose a reason for hiding this comment

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

I don't think there are any places that can be replaced anymore;

You can perform a global search for the keyword (nil)).Elem. 😄

@github-project-automation github-project-automation bot moved this to In Progress 🏗️ in avalanchego Aug 26, 2025
@joshua-kim joshua-kim moved this from In Progress 🏗️ to Ready 🚦 in avalanchego Sep 15, 2025
@StephenButtolph
Copy link
Contributor

closing in favor of #4311.

@github-project-automation github-project-automation bot moved this from Ready 🚦 to Done 🎉 in avalanchego Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants