Skip to content

Conversation

@StephenButtolph
Copy link
Contributor

Why this should be merged

This was suggested with #4211

How this works

Includes the prior diff + addresses my comment (for this test only file). I'm making a followup to fix the codec (which is non-trivial, so didn't want to mix it with this PR).

How this was tested

CI

Need to be documented in RELEASES.md?

no.

@Copilot Copilot AI review requested due to automatic review settings September 22, 2025 20:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes reflection usage by replacing reflect.TypeOf calls with the newer reflect.TypeFor generic function introduced in Go 1.22. This change improves type safety and readability by eliminating the need for pointer dereferencing patterns with nil values.

Key changes:

  • Replace reflect.TypeOf((*Type)(nil)).Elem() pattern with reflect.TypeFor[Type]()
  • Replace reflect.TypeOf(&Type{}) pattern with reflect.TypeFor[*Type]()

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@StephenButtolph StephenButtolph self-assigned this Sep 22, 2025
@StephenButtolph StephenButtolph moved this to In Review 🔎 in avalanchego Sep 22, 2025
@StephenButtolph StephenButtolph added this pull request to the merge queue Sep 23, 2025
Merged via the queue into master with commit e1a6900 Sep 23, 2025
35 checks passed
@StephenButtolph StephenButtolph deleted the use-type-for branch September 23, 2025 13:53
@github-project-automation github-project-automation bot moved this from In Review 🔎 to Done 🎉 in avalanchego Sep 23, 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.

3 participants