mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 07:17:25 +08:00
go fmt
This commit is contained in:
@@ -299,7 +299,7 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) err
|
|||||||
var assignResult *filer_pb.AssignVolumeResponse
|
var assignResult *filer_pb.AssignVolumeResponse
|
||||||
var assignError error
|
var assignError error
|
||||||
|
|
||||||
if task.fileMode & os.ModeDir == 0 && task.fileSize > 0 {
|
if task.fileMode&os.ModeDir == 0 && task.fileSize > 0 {
|
||||||
|
|
||||||
mimeType = detectMimeType(f)
|
mimeType = detectMimeType(f)
|
||||||
data, err := ioutil.ReadAll(f)
|
data, err := ioutil.ReadAll(f)
|
||||||
|
@@ -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) {
|
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)
|
lastFileName, err = f.doListValidEntries(ctx, p, startFileName, inclusive, limit, prefix, eachEntryFunc)
|
||||||
return 0, lastFileName, err
|
return 0, lastFileName, err
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ func (m *mockChunkCache) GetChunk(fileId string, minSize uint64) (data []byte) {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
func(m *mockChunkCache) GetChunkSlice(fileId string, offset, length uint64) []byte {
|
func (m *mockChunkCache) GetChunkSlice(fileId string, offset, length uint64) []byte {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,7 +33,6 @@ func StreamContent(masterClient wdclient.HasLookupFileIdFunction, w io.Writer, c
|
|||||||
fileId2Url[chunkView.FileId] = urlStrings
|
fileId2Url[chunkView.FileId] = urlStrings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for _, chunkView := range chunkViews {
|
for _, chunkView := range chunkViews {
|
||||||
|
|
||||||
urlStrings := fileId2Url[chunkView.FileId]
|
urlStrings := fileId2Url[chunkView.FileId]
|
||||||
|
@@ -176,7 +176,7 @@ func (dir *Dir) Create(ctx context.Context, req *fuse.CreateRequest,
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
file.dirtyMetadata = true
|
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
|
return file, fh, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -270,6 +270,7 @@ func (wfs *WFS) LookupFn() wdclient.LookupFileIdFunctionType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NodeWithId uint64
|
type NodeWithId uint64
|
||||||
|
|
||||||
func (n NodeWithId) Id() uint64 {
|
func (n NodeWithId) Id() uint64 {
|
||||||
return uint64(n)
|
return uint64(n)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user