Skip to content

Commit

Permalink
feat: shuffle the result of ListStorageProviders
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 committed Nov 8, 2023
1 parent 524d442 commit 7f356bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/api_sp.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/hex"
math2 "math"
"math/rand"
"strings"
"time"

Expand Down Expand Up @@ -97,6 +98,10 @@ func (c *Client) ListStorageProviders(ctx context.Context, isInService bool) ([]
spInfoList = append(spInfoList, *info)
}

rand.Shuffle(len(spInfoList), func(i, j int) {
spInfoList[i], spInfoList[j] = spInfoList[j], spInfoList[i]
})

return spInfoList, nil
}

Expand Down

0 comments on commit 7f356bd

Please sign in to comment.