diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-09-01 02:45:42 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-09-01 02:45:42 -0700 |
| commit | 7ce97b59d828b3f6d7bcdab323209740280da3f3 (patch) | |
| tree | b4f50634e183c2bc8ba897baefbf3d62731bf9f8 /weed/filer | |
| parent | d1a4e19a3f0aeaabcf87aba3c99880f82bde87a3 (diff) | |
| download | seaweedfs-7ce97b59d828b3f6d7bcdab323209740280da3f3.tar.xz seaweedfs-7ce97b59d828b3f6d7bcdab323209740280da3f3.zip | |
go fmt
Diffstat (limited to 'weed/filer')
| -rw-r--r-- | weed/filer/read_remote.go | 2 | ||||
| -rw-r--r-- | weed/filer/sqlite/sqlite_store.go | 1 | ||||
| -rw-r--r-- | weed/filer/sqlite/sqlite_store_unsupported.go | 1 | ||||
| -rw-r--r-- | weed/filer/stream.go | 20 | ||||
| -rw-r--r-- | weed/filer/tikv/tikv_store.go | 1 | ||||
| -rw-r--r-- | weed/filer/tikv/tikv_store_kv.go | 1 |
6 files changed, 15 insertions, 11 deletions
diff --git a/weed/filer/read_remote.go b/weed/filer/read_remote.go index 3406246a9..58639024b 100644 --- a/weed/filer/read_remote.go +++ b/weed/filer/read_remote.go @@ -21,7 +21,7 @@ func MapFullPathToRemoteStorageLocation(localMountedDir util.FullPath, remoteMou return remoteLocation } -func MapRemoteStorageLocationPathToFullPath(localMountedDir util.FullPath, remoteMountedLocation *remote_pb.RemoteStorageLocation, remoteLocationPath string)(fp util.FullPath) { +func MapRemoteStorageLocationPathToFullPath(localMountedDir util.FullPath, remoteMountedLocation *remote_pb.RemoteStorageLocation, remoteLocationPath string) (fp util.FullPath) { return localMountedDir.Child(remoteLocationPath[len(remoteMountedLocation.Path):]) } diff --git a/weed/filer/sqlite/sqlite_store.go b/weed/filer/sqlite/sqlite_store.go index 6b055e53c..ca9d38786 100644 --- a/weed/filer/sqlite/sqlite_store.go +++ b/weed/filer/sqlite/sqlite_store.go @@ -1,3 +1,4 @@ +//go:build linux || darwin || windows // +build linux darwin windows // limited GOOS due to modernc.org/libc/unistd diff --git a/weed/filer/sqlite/sqlite_store_unsupported.go b/weed/filer/sqlite/sqlite_store_unsupported.go index 803c71afa..0fba1ea33 100644 --- a/weed/filer/sqlite/sqlite_store_unsupported.go +++ b/weed/filer/sqlite/sqlite_store_unsupported.go @@ -1,3 +1,4 @@ +//go:build !linux && !darwin && !windows && !s390 && !ppc64le && !mips64 // +build !linux,!darwin,!windows,!s390,!ppc64le,!mips64 // limited GOOS due to modernc.org/libc/unistd diff --git a/weed/filer/stream.go b/weed/filer/stream.go index ce0264cd3..4a70d118e 100644 --- a/weed/filer/stream.go +++ b/weed/filer/stream.go @@ -127,14 +127,14 @@ func ReadAll(masterClient *wdclient.MasterClient, chunks []*filer_pb.FileChunk) // ---------------- ChunkStreamReader ---------------------------------- type ChunkStreamReader struct { - chunkViews []*ChunkView - totalSize int64 - logicOffset int64 - buffer []byte - bufferOffset int64 - bufferLock sync.Mutex - chunk string - lookupFileId wdclient.LookupFileIdFunctionType + chunkViews []*ChunkView + totalSize int64 + logicOffset int64 + buffer []byte + bufferOffset int64 + bufferLock sync.Mutex + chunk string + lookupFileId wdclient.LookupFileIdFunctionType } var _ = io.ReadSeeker(&ChunkStreamReader{}) @@ -206,7 +206,7 @@ func (c *ChunkStreamReader) doRead(p []byte) (n int, err error) { } func (c *ChunkStreamReader) isBufferEmpty() bool { - return len(c.buffer) <= int(c.logicOffset - c.bufferOffset) + return len(c.buffer) <= int(c.logicOffset-c.bufferOffset) } func (c *ChunkStreamReader) Seek(offset int64, whence int) (int64, error) { @@ -261,7 +261,7 @@ func (c *ChunkStreamReader) prepareBufferFor(offset int64) (err error) { } else if currentChunkIndex > 0 { if insideChunk(offset, c.chunkViews[currentChunkIndex]) { // good hit - } else if insideChunk(offset, c.chunkViews[currentChunkIndex-1]){ + } else if insideChunk(offset, c.chunkViews[currentChunkIndex-1]) { currentChunkIndex -= 1 // fmt.Printf("select -1 chunk %d %s\n", currentChunkIndex, c.chunkViews[currentChunkIndex].FileId) } else { diff --git a/weed/filer/tikv/tikv_store.go b/weed/filer/tikv/tikv_store.go index 4a8e8784d..561f23910 100644 --- a/weed/filer/tikv/tikv_store.go +++ b/weed/filer/tikv/tikv_store.go @@ -1,3 +1,4 @@ +//go:build tikv // +build tikv package tikv diff --git a/weed/filer/tikv/tikv_store_kv.go b/weed/filer/tikv/tikv_store_kv.go index 3fed7e045..1d9428c69 100644 --- a/weed/filer/tikv/tikv_store_kv.go +++ b/weed/filer/tikv/tikv_store_kv.go @@ -1,3 +1,4 @@ +//go:build tikv // +build tikv package tikv |
