aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-07-21 14:38:12 -0700
committerChris Lu <chris.lu@gmail.com>2021-07-21 14:38:12 -0700
commit7359193e974e8ee30d2b2625ae30008ad940d1a6 (patch)
tree4ff6c24a6b7cf3ba797eb0c9a014dc8ab9468bad
parentcc32436d63a433b436ab74c99fe7246242a83716 (diff)
downloadseaweedfs-7359193e974e8ee30d2b2625ae30008ad940d1a6.tar.xz
seaweedfs-7359193e974e8ee30d2b2625ae30008ad940d1a6.zip
go fmt
-rw-r--r--weed/filer/filer_conf.go14
-rw-r--r--weed/filesys/dir_rename.go1
-rw-r--r--weed/replication/sink/filersink/filer_sink.go2
-rw-r--r--weed/s3api/filer_multipart.go6
-rw-r--r--weed/s3api/filer_util.go2
-rw-r--r--weed/shell/command_volume_fix_replication.go2
-rw-r--r--weed/shell/command_volume_server_evacuate.go2
-rw-r--r--weed/util/log_buffer/log_buffer.go4
8 files changed, 16 insertions, 17 deletions
diff --git a/weed/filer/filer_conf.go b/weed/filer/filer_conf.go
index bae0eac5c..c58b26dc2 100644
--- a/weed/filer/filer_conf.go
+++ b/weed/filer/filer_conf.go
@@ -13,13 +13,13 @@ import (
)
const (
- DirectoryEtcRoot = "/etc"
- DirectoryEtcSeaweedFS = "/etc/seaweedfs"
- DirectoryEtcRemote = "/etc/remote"
- FilerConfName = "filer.conf"
- IamConfigDirecotry = "/etc/iam"
- IamIdentityFile = "identity.json"
- IamPoliciesFile = "policies.json"
+ DirectoryEtcRoot = "/etc"
+ DirectoryEtcSeaweedFS = "/etc/seaweedfs"
+ DirectoryEtcRemote = "/etc/remote"
+ FilerConfName = "filer.conf"
+ IamConfigDirecotry = "/etc/iam"
+ IamIdentityFile = "identity.json"
+ IamPoliciesFile = "policies.json"
)
type FilerConf struct {
diff --git a/weed/filesys/dir_rename.go b/weed/filesys/dir_rename.go
index f69339a14..dd76577b0 100644
--- a/weed/filesys/dir_rename.go
+++ b/weed/filesys/dir_rename.go
@@ -63,7 +63,6 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector
return fuse.EIO
}
-
return nil
}
diff --git a/weed/replication/sink/filersink/filer_sink.go b/weed/replication/sink/filersink/filer_sink.go
index 3898f2c58..2b526cc52 100644
--- a/weed/replication/sink/filersink/filer_sink.go
+++ b/weed/replication/sink/filersink/filer_sink.go
@@ -5,7 +5,7 @@ import (
"fmt"
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/wdclient"
- "math"
+ "math"
"google.golang.org/grpc"
diff --git a/weed/s3api/filer_multipart.go b/weed/s3api/filer_multipart.go
index 5d7bf2ac3..2b6707f2e 100644
--- a/weed/s3api/filer_multipart.go
+++ b/weed/s3api/filer_multipart.go
@@ -71,7 +71,7 @@ func (s3a *S3ApiServer) completeMultipartUpload(input *s3.CompleteMultipartUploa
return nil, s3err.ErrNoSuchUpload
}
- pentry, err := s3a.getEntry(s3a.genUploadsFolder(*input.Bucket),*input.UploadId)
+ pentry, err := s3a.getEntry(s3a.genUploadsFolder(*input.Bucket), *input.UploadId)
if err != nil {
glog.Errorf("completeMultipartUpload %s %s error: %v", *input.Bucket, *input.UploadId, err)
return nil, s3err.ErrNoSuchUpload
@@ -112,11 +112,11 @@ func (s3a *S3ApiServer) completeMultipartUpload(input *s3.CompleteMultipartUploa
dirName = dirName[:len(dirName)-1]
}
- err = s3a.mkFile(dirName, entryName, finalParts,func(entry *filer_pb.Entry) {
+ err = s3a.mkFile(dirName, entryName, finalParts, func(entry *filer_pb.Entry) {
if entry.Extended == nil {
entry.Extended = make(map[string][]byte)
}
- for k,v := range pentry.Extended{
+ for k, v := range pentry.Extended {
if k != "key" {
entry.Extended[k] = v
}
diff --git a/weed/s3api/filer_util.go b/weed/s3api/filer_util.go
index 92267a154..888003e45 100644
--- a/weed/s3api/filer_util.go
+++ b/weed/s3api/filer_util.go
@@ -17,7 +17,7 @@ func (s3a *S3ApiServer) mkdir(parentDirectoryPath string, dirName string, fn fun
func (s3a *S3ApiServer) mkFile(parentDirectoryPath string, fileName string, chunks []*filer_pb.FileChunk, fn func(entry *filer_pb.Entry)) error {
- return filer_pb.MkFile(s3a, parentDirectoryPath, fileName, chunks,fn)
+ return filer_pb.MkFile(s3a, parentDirectoryPath, fileName, chunks, fn)
}
diff --git a/weed/shell/command_volume_fix_replication.go b/weed/shell/command_volume_fix_replication.go
index d1f830efb..9e6280788 100644
--- a/weed/shell/command_volume_fix_replication.go
+++ b/weed/shell/command_volume_fix_replication.go
@@ -158,7 +158,7 @@ func (c *commandVolumeFixReplication) fixOverReplicatedVolumes(commandEnv *Comma
func (c *commandVolumeFixReplication) fixUnderReplicatedVolumes(commandEnv *CommandEnv, writer io.Writer, takeAction bool, underReplicatedVolumeIds []uint32, volumeReplicas map[uint32][]*VolumeReplica, allLocations []location, retryCount int) (err error) {
for _, vid := range underReplicatedVolumeIds {
- for i:=0;i<retryCount+1;i++{
+ for i := 0; i < retryCount+1; i++ {
if err = c.fixOneUnderReplicatedVolume(commandEnv, writer, takeAction, volumeReplicas, vid, allLocations); err == nil {
continue
}
diff --git a/weed/shell/command_volume_server_evacuate.go b/weed/shell/command_volume_server_evacuate.go
index fb9bf79c6..6e0c19ae1 100644
--- a/weed/shell/command_volume_server_evacuate.go
+++ b/weed/shell/command_volume_server_evacuate.go
@@ -61,7 +61,7 @@ func (c *commandVolumeServerEvacuate) Do(args []string, commandEnv *CommandEnv,
return fmt.Errorf("need to specify volume server by -node=<host>:<port>")
}
- for i:=0;i<*retryCount+1;i++{
+ for i := 0; i < *retryCount+1; i++ {
if err = volumeServerEvacuate(commandEnv, *volumeServer, *skipNonMoveable, *applyChange, writer); err == nil {
return nil
}
diff --git a/weed/util/log_buffer/log_buffer.go b/weed/util/log_buffer/log_buffer.go
index 4742c2b7c..c2158e7eb 100644
--- a/weed/util/log_buffer/log_buffer.go
+++ b/weed/util/log_buffer/log_buffer.go
@@ -170,8 +170,8 @@ func (m *LogBuffer) copyToFlush() *dataToFlush {
m.lastFlushTime = m.stopTime
}
m.buf = m.prevBuffers.SealBuffer(m.startTime, m.stopTime, m.buf, m.pos)
- m.startTime = time.Unix(0,0)
- m.stopTime = time.Unix(0,0)
+ m.startTime = time.Unix(0, 0)
+ m.stopTime = time.Unix(0, 0)
m.pos = 0
m.idx = m.idx[:0]
return d