Skip to content

refactor: use slices.Backward to simplify the code#5227

Closed
chuanshanjida wants to merge 1 commit intoava-labs:masterfrom
chuanshanjida:master
Closed

refactor: use slices.Backward to simplify the code#5227
chuanshanjida wants to merge 1 commit intoava-labs:masterfrom
chuanshanjida:master

Conversation

@chuanshanjida
Copy link
Copy Markdown

Why this should be merged

There is a new function added in the go1.23 standard library, which can make the code more concise and easy to read.

More info can see golang/go#61899

How this works

How this was tested

Need to be documented in RELEASES.md?

@chuanshanjida chuanshanjida requested a review from a team as a code owner April 12, 2026 15:20
@JonathanOppenheimer
Copy link
Copy Markdown
Contributor

Hi @chuanshanjida -- you will need to sign your commits to make a contribution to this repository. Please let me know if you have any questions!

Signed-off-by: chuanshanjida <chuanshanjida@outlook.com>
@chuanshanjida
Copy link
Copy Markdown
Author

Hi @chuanshanjida -- you will need to sign your commits to make a contribution to this repository. Please let me know if you have any questions!

@JonathanOppenheimer Thanks! Signed. Please review it again.

@joshua-kim joshua-kim closed this Apr 13, 2026
@github-project-automation github-project-automation Bot moved this to Done 🎉 in avalanchego Apr 13, 2026
@chuanshanjida
Copy link
Copy Markdown
Author

@joshua-kim Hi,Why did you close this PR?

CC @JonathanOppenheimer

@joshua-kim
Copy link
Copy Markdown
Contributor

These are one-of trivial cosmetic improvements that do not meaningfully improve code quality, I would be interested in this if we could add it through a linter. Otherwise this is not a good use of our review bandwidth.

@JonathanOppenheimer
Copy link
Copy Markdown
Contributor

These are one-of trivial cosmetic improvements that do not meaningfully improve code quality, I would be interested in this if we could add it through a linter. Otherwise this is not a good use of our review bandwidth.

we can, there's a modernize linter we have, which is commented out and not activated. @chuanshanjida maybe that's a task you could take a crack at?

@JonathanOppenheimer
Copy link
Copy Markdown
Contributor

See

# - modernize

@chuanshanjida
Copy link
Copy Markdown
Author

See

# - modernize

Sure, I’d be happy to do this. I’ll open a new PR later. Thanks for your explanations and suggestions.

@chuanshanjida
Copy link
Copy Markdown
Author

@JonathanOppenheimer The new pr. #5231

Thanks

@JonathanOppenheimer
Copy link
Copy Markdown
Contributor

@JonathanOppenheimer The new pr. #5231

Thanks

You have to actually make the lint changes when you enable the linter haha.

@chuanshanjida
Copy link
Copy Markdown
Author

@JonathanOppenheimer The new pr. #5231
Thanks

You have to actually make the lint changes when you enable the linter haha.

Added. It looks like a lot of changes😅… but I searched, and it seems this is an official tool provided by Go, so accuracy is likely fine. I’ll keep an eye on the unit tests at all times.

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