mirror of
https://github.com/rclone/rclone.git
synced 2025-03-01 08:51:58 +01:00
union: fix goimports
This commit is contained in:
parent
3cd1b20236
commit
540bd61305
@ -1,14 +1,14 @@
|
||||
package union
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bufio"
|
||||
"context"
|
||||
"io"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/backend/union/upstream"
|
||||
"github.com/rclone/rclone/fs"
|
||||
)
|
||||
|
||||
// Object describes a union Object
|
||||
@ -70,7 +70,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||
// Get multiple reader
|
||||
readers := make([]io.Reader, len(entries))
|
||||
writers := make([]io.Writer, len(entries))
|
||||
errs := make([]error, len(entries) + 1)
|
||||
errs := make([]error, len(entries)+1)
|
||||
for i := range entries {
|
||||
r, w := io.Pipe()
|
||||
bw := bufio.NewWriter(w)
|
||||
@ -85,7 +85,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||
}
|
||||
}()
|
||||
// Multi-threading
|
||||
multithread(len(entries), func(i int){
|
||||
multithread(len(entries), func(i int) {
|
||||
if o, ok := entries[i].(*upstream.Object); ok {
|
||||
errs[i] = o.Update(ctx, readers[i], src, options...)
|
||||
} else {
|
||||
@ -109,7 +109,7 @@ func (o *Object) Remove(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
errs := make([]error, len(entries))
|
||||
multithread(len(entries), func(i int){
|
||||
multithread(len(entries), func(i int) {
|
||||
if o, ok := entries[i].(*upstream.Object); ok {
|
||||
errs[i] = o.Remove(ctx)
|
||||
} else {
|
||||
@ -123,6 +123,7 @@ func (o *Object) Remove(ctx context.Context) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetModTime sets the metadata on the object to set the modification date
|
||||
func (o *Object) SetModTime(ctx context.Context, t time.Time) error {
|
||||
f := o.Fs().(*Fs)
|
||||
@ -132,7 +133,7 @@ func (o *Object) SetModTime(ctx context.Context, t time.Time) error {
|
||||
}
|
||||
var wg sync.WaitGroup
|
||||
errs := make([]error, len(entries))
|
||||
multithread(len(entries), func(i int){
|
||||
multithread(len(entries), func(i int) {
|
||||
if o, ok := entries[i].(*upstream.Object); ok {
|
||||
errs[i] = o.SetModTime(ctx, t)
|
||||
} else {
|
||||
@ -153,7 +154,7 @@ func (o *Object) SetModTime(ctx context.Context, t time.Time) error {
|
||||
func (d *Directory) ModTime(ctx context.Context) (t time.Time) {
|
||||
entries := d.candidates()
|
||||
times := make([]time.Time, len(entries))
|
||||
multithread(len(entries), func(i int){
|
||||
multithread(len(entries), func(i int) {
|
||||
times[i] = entries[i].ModTime(ctx)
|
||||
})
|
||||
for _, ti := range times {
|
||||
|
Loading…
Reference in New Issue
Block a user