From 862c2cb8e6bcf7e332b8f1cb6b5ec4d0de7bac4e Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 21 Jul 2019 21:51:38 -0700 Subject: [PATCH] go fmt --- weed/filer2/leveldb2/leveldb2_store.go | 6 +++--- weed/filer2/leveldb2/leveldb2_store_test.go | 4 ++-- weed/s3api/filer_multipart.go | 6 +++--- weed/s3api/filer_util.go | 2 +- weed/shell/command_fs_mv.go | 3 --- weed/topology/topology.go | 1 - 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/weed/filer2/leveldb2/leveldb2_store.go b/weed/filer2/leveldb2/leveldb2_store.go index bce81e357..4b47d2eb3 100644 --- a/weed/filer2/leveldb2/leveldb2_store.go +++ b/weed/filer2/leveldb2/leveldb2_store.go @@ -21,7 +21,7 @@ func init() { } type LevelDB2Store struct { - dbs []*leveldb.DB + dbs []*leveldb.DB dbCount int } @@ -46,7 +46,7 @@ func (store *LevelDB2Store) initialize(dir string, dbCount int) (err error) { CompactionTableSizeMultiplier: 4, } - for d := 0 ; d < dbCount; d++ { + for d := 0; d < dbCount; d++ { dbFolder := fmt.Sprintf("%s/%02d", dir, d) os.MkdirAll(dbFolder, 0755) db, dbErr := leveldb.OpenFile(dbFolder, opts) @@ -204,5 +204,5 @@ func hashToBytes(dir string, dbCount int) ([]byte, int) { x := b[len(b)-1] - return b, int(x)%dbCount + return b, int(x) % dbCount } diff --git a/weed/filer2/leveldb2/leveldb2_store_test.go b/weed/filer2/leveldb2/leveldb2_store_test.go index a16803ca1..e28ef7dac 100644 --- a/weed/filer2/leveldb2/leveldb2_store_test.go +++ b/weed/filer2/leveldb2/leveldb2_store_test.go @@ -13,7 +13,7 @@ func TestCreateAndFind(t *testing.T) { dir, _ := ioutil.TempDir("", "seaweedfs_filer_test") defer os.RemoveAll(dir) store := &LevelDB2Store{} - store.initialize(dir,2) + store.initialize(dir, 2) filer.SetStore(store) filer.DisableDirectoryCache() @@ -68,7 +68,7 @@ func TestEmptyRoot(t *testing.T) { dir, _ := ioutil.TempDir("", "seaweedfs_filer_test2") defer os.RemoveAll(dir) store := &LevelDB2Store{} - store.initialize(dir,2) + store.initialize(dir, 2) filer.SetStore(store) filer.DisableDirectoryCache() diff --git a/weed/s3api/filer_multipart.go b/weed/s3api/filer_multipart.go index 4de1dda36..c8fe05645 100644 --- a/weed/s3api/filer_multipart.go +++ b/weed/s3api/filer_multipart.go @@ -101,9 +101,9 @@ func (s3a *S3ApiServer) completeMultipartUpload(ctx context.Context, input *s3.C output = &CompleteMultipartUploadResult{ CompleteMultipartUploadOutput: s3.CompleteMultipartUploadOutput{ Location: aws.String(fmt.Sprintf("http://%s%s/%s", s3a.option.Filer, dirName, entryName)), - Bucket: input.Bucket, - ETag: aws.String("\"" + filer2.ETag(finalParts) + "\""), - Key: objectKey(input.Key), + Bucket: input.Bucket, + ETag: aws.String("\"" + filer2.ETag(finalParts) + "\""), + Key: objectKey(input.Key), }, } diff --git a/weed/s3api/filer_util.go b/weed/s3api/filer_util.go index 84e3050cd..1c3814fce 100644 --- a/weed/s3api/filer_util.go +++ b/weed/s3api/filer_util.go @@ -151,4 +151,4 @@ func objectKey(key *string) *string { return &t } return key -} \ No newline at end of file +} diff --git a/weed/shell/command_fs_mv.go b/weed/shell/command_fs_mv.go index 130bfe4e7..67606ab53 100644 --- a/weed/shell/command_fs_mv.go +++ b/weed/shell/command_fs_mv.go @@ -49,12 +49,10 @@ func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer ctx := context.Background() - sourceDir, sourceName := filer2.FullPath(sourcePath).DirAndName() destinationDir, destinationName := filer2.FullPath(destinationPath).DirAndName() - return commandEnv.withFilerClient(ctx, filerServer, filerPort, func(client filer_pb.SeaweedFilerClient) error { // collect destination entry info @@ -77,7 +75,6 @@ func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer targetName = destinationName } - request := &filer_pb.AtomicRenameEntryRequest{ OldDirectory: sourceDir, OldName: sourceName, diff --git a/weed/topology/topology.go b/weed/topology/topology.go index 7cbf80b4d..eff8c99a0 100644 --- a/weed/topology/topology.go +++ b/weed/topology/topology.go @@ -34,7 +34,6 @@ type Topology struct { Configuration *Configuration RaftServer raft.Server - } func NewTopology(id string, seq sequence.Sequencer, volumeSizeLimit uint64, pulse int) *Topology {