Skip to content

Commit

Permalink
[feature]add UploadPartCopy
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobo.chen committed Jun 19, 2023
1 parent 19b2ce6 commit 306645f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ func SplitFileByPartSize(fileSize, partSize int64) ([]FilePart, error) {
var parts []FilePart
var part = FilePart{}
for i := int64(0); i < partN; i++ {
part.Number = int(i + 1)
part.Number = int(i)
part.Offset = i * partSize
part.Size = partSize
parts = append(parts, part)
}

if fileSize%partSize > 0 {
part.Number = len(parts) + 1
part.Number = len(parts)
part.Offset = int64(len(parts)) * partSize
part.Size = fileSize % partSize
parts = append(parts, part)
Expand Down

0 comments on commit 306645f

Please sign in to comment.