Skip to content

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

Open
solunolab wants to merge 1 commit into
rclone:masterfrom
solunolab:master
Open

refactor: use slices.Backward to simplify the code#9501
solunolab wants to merge 1 commit into
rclone:masterfrom
solunolab:master

Conversation

@solunolab

@solunolab solunolab commented Jun 7, 2026

Copy link
Copy Markdown

What is the purpose of this change?

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

Was the change discussed in an issue or in the forum before?

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

Signed-off-by: solunolab <solunolab@outlook.com>
@solunolab

Copy link
Copy Markdown
Author

@roucc Hi, Could you please review this PR at your convenience? Thank you very much.

@ncw ncw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks fine. Can you remove the extra blank lines and I'll merge - thank you :-)

for level := len(toDelete) - 1; level >= 0; level-- {
dirs := toDelete[level]
for level, dirs := range slices.Backward(toDelete) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you remove these blank lines?

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

Successfully merging this pull request may close these issues.

2 participants