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

Refactor code to use Go 1.20 and 1.21 features #3418

Closed
spencerschrock opened this issue Aug 23, 2023 · 2 comments
Closed

Refactor code to use Go 1.20 and 1.21 features #3418

spencerschrock opened this issue Aug 23, 2023 · 2 comments
Assignees

Comments

@spencerschrock
Copy link
Member

Serves as a general tracking issue for clean ups I'd like to investigate when I have time, now that 1.20 and 1.21 have new features.

1.21:

  • min, max built-ins
    • we only call math.Max or math.Min in 1-2 places, but could replace that
  • The new slices package can replace our use of golang.org/x/exp/slices
  • The new OnceFunc, OnceValue and OnceValues could replace some of client handlers.
    • We often use sync.Once and save the response, as well as an error

1.20:

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity.

@spencerschrock
Copy link
Member Author

Not going to switch the sync.Once uses over, as the overall readability didn't improve too much. Can re-visit later if needed

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

No branches or pull requests

1 participant