From 55a8f57381aaeeb0cfc1326646024a7052928965 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 6 May 2021 03:37:51 -0700 Subject: [PATCH] go fmt --- weed/command/filer_copy.go | 2 +- weed/filer/filer_search.go | 2 +- weed/filer/reader_at_test.go | 2 +- weed/filer/stream.go | 1 - weed/filesys/dir.go | 2 +- weed/filesys/wfs.go | 1 + 6 files changed, 5 insertions(+), 5 deletions(-) diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go index e7a9b107f..a9b715f90 100644 --- a/weed/command/filer_copy.go +++ b/weed/command/filer_copy.go @@ -299,7 +299,7 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) err var assignResult *filer_pb.AssignVolumeResponse var assignError error - if task.fileMode & os.ModeDir == 0 && task.fileSize > 0 { + if task.fileMode&os.ModeDir == 0 && task.fileSize > 0 { mimeType = detectMimeType(f) data, err := ioutil.ReadAll(f) diff --git a/weed/filer/filer_search.go b/weed/filer/filer_search.go index f43312cfa..2ee29be25 100644 --- a/weed/filer/filer_search.go +++ b/weed/filer/filer_search.go @@ -58,7 +58,7 @@ func (f *Filer) StreamListDirectoryEntries(ctx context.Context, p util.FullPath, func (f *Filer) doListPatternMatchedEntries(ctx context.Context, p util.FullPath, startFileName string, inclusive bool, limit int64, prefix, restNamePattern string, namePatternExclude string, eachEntryFunc ListEachEntryFunc) (missedCount int64, lastFileName string, err error) { - if len(restNamePattern) == 0 && len(namePatternExclude) == 0{ + if len(restNamePattern) == 0 && len(namePatternExclude) == 0 { lastFileName, err = f.doListValidEntries(ctx, p, startFileName, inclusive, limit, prefix, eachEntryFunc) return 0, lastFileName, err } diff --git a/weed/filer/reader_at_test.go b/weed/filer/reader_at_test.go index a31319082..f8e4727ce 100644 --- a/weed/filer/reader_at_test.go +++ b/weed/filer/reader_at_test.go @@ -21,7 +21,7 @@ func (m *mockChunkCache) GetChunk(fileId string, minSize uint64) (data []byte) { return data } -func(m *mockChunkCache) GetChunkSlice(fileId string, offset, length uint64) []byte { +func (m *mockChunkCache) GetChunkSlice(fileId string, offset, length uint64) []byte { return nil } diff --git a/weed/filer/stream.go b/weed/filer/stream.go index f9a762187..2c25b8722 100644 --- a/weed/filer/stream.go +++ b/weed/filer/stream.go @@ -33,7 +33,6 @@ func StreamContent(masterClient wdclient.HasLookupFileIdFunction, w io.Writer, c fileId2Url[chunkView.FileId] = urlStrings } - for _, chunkView := range chunkViews { urlStrings := fileId2Url[chunkView.FileId] diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 33d9248ab..09d5fd449 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -176,7 +176,7 @@ func (dir *Dir) Create(ctx context.Context, req *fuse.CreateRequest, }, } file.dirtyMetadata = true - fh := dir.wfs.AcquireHandle(file, req.Uid, req.Gid, req.Flags & fuse.OpenWriteOnly > 0) + fh := dir.wfs.AcquireHandle(file, req.Uid, req.Gid, req.Flags&fuse.OpenWriteOnly > 0) return file, fh, nil } diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index 7757e4285..fcce7d9cc 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -270,6 +270,7 @@ func (wfs *WFS) LookupFn() wdclient.LookupFileIdFunctionType { } type NodeWithId uint64 + func (n NodeWithId) Id() uint64 { return uint64(n) }