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

polygon/heimdall: use generics to eliminate casts #10371

Merged
merged 3 commits into from
May 16, 2024
Merged

Conversation

battlmonstr
Copy link
Contributor

No description provided.

// Zero value of any type T
// https://stackoverflow.com/questions/70585852/return-default-value-for-generic-type)
// https://go.dev/ref/spec#The_zero_value
func Zero[T any]() T {
Copy link
Member

Choose a reason for hiding this comment

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

nice! helpful function - it feels like we can add it to erigon-lib/common - we can gradually build common generics helpers if other use cases come along

@battlmonstr battlmonstr merged commit 3e93af6 into main May 16, 2024
10 checks passed
@battlmonstr battlmonstr deleted the pr/entitycasts branch May 16, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants