Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

go fmt

Chris Lu35d939a1d213
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index 8da69d0ac1..f6f7b1d555 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -75,7 +75,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
if err != nil {
glog.V(0).Infof("failed to talk to filer %s: %v", filerGrpcAddress, err)
glog.V(0).Infof("wait for %d seconds ...", i+1)
- time.Sleep(time.Duration(i+1)*time.Second)
+ time.Sleep(time.Duration(i+1) * time.Second)
}
}
if err != nil {
diff --git a/weed/filer/filerstore.go b/weed/filer/filerstore.go
index 069920f2db..a5b2f25de0 100644
--- a/weed/filer/filerstore.go
+++ b/weed/filer/filerstore.go
@@ -44,4 +44,3 @@ type BucketAware interface {
OnBucketCreation(bucket string)
OnBucketDeletion(bucket string)
}
-
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go
index 7a6b4fa2b0..7c3907326b 100644
--- a/weed/filesys/wfs.go
+++ b/weed/filesys/wfs.go
@@ -131,7 +131,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
})
entry, _ := filer_pb.GetEntry(wfs, util.FullPath(wfs.option.FilerMountRootPath))
- wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs, entry: filer.FromPbEntry(wfs.option.FilerMountRootPath,entry)}
+ wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs, entry: filer.FromPbEntry(wfs.option.FilerMountRootPath, entry)}
wfs.fsNodeCache = newFsCache(wfs.root)
if wfs.option.ConcurrentWriters > 0 {
diff --git a/weed/pb/filer_pb/filer_client.go b/weed/pb/filer_pb/filer_client.go
index e4d8bee349..8cf42026d1 100644
--- a/weed/pb/filer_pb/filer_client.go
+++ b/weed/pb/filer_pb/filer_client.go
@@ -104,7 +104,7 @@ func SeaweedList(client SeaweedFilerClient, parentDirectoryPath, prefix string,
func doSeaweedList(client SeaweedFilerClient, fullDirPath util.FullPath, prefix string, fn EachEntryFunciton, startFrom string, inclusive bool, limit uint32) (err error) {
// Redundancy limit to make it correctly judge whether it is the last file.
redLimit := limit
- if limit != math.MaxInt32 && limit != 0{
+ if limit != math.MaxInt32 && limit != 0 {
redLimit = limit + 1
}
request := &ListEntriesRequest{
diff --git a/weed/shell/command_s3_clean_uploads.go b/weed/shell/command_s3_clean_uploads.go
index 1fe13d9819..5f674d7b66 100644
--- a/weed/shell/command_s3_clean_uploads.go
+++ b/weed/shell/command_s3_clean_uploads.go
@@ -54,7 +54,7 @@ func (c *commandS3CleanUploads) Do(args []string, commandEnv *CommandEnv, writer
return fmt.Errorf("list buckets under %v: %v", filerBucketsPath, err)
}
- for _, bucket:= range buckets {
+ for _, bucket := range buckets {
c.cleanupUploads(commandEnv, writer, filerBucketsPath, bucket, *uploadedTimeAgo)
}
@@ -63,7 +63,7 @@ func (c *commandS3CleanUploads) Do(args []string, commandEnv *CommandEnv, writer
}
func (c *commandS3CleanUploads) cleanupUploads(commandEnv *CommandEnv, writer io.Writer, filerBucketsPath string, bucket string, timeAgo time.Duration) error {
- uploadsDir := filerBucketsPath+"/"+bucket+"/.uploads"
+ uploadsDir := filerBucketsPath + "/" + bucket + "/.uploads"
var staleUploads []string
now := time.Now()
err := filer_pb.List(commandEnv, uploadsDir, "", func(entry *filer_pb.Entry, isLast bool) error {
@@ -77,8 +77,8 @@ func (c *commandS3CleanUploads) cleanupUploads(commandEnv *CommandEnv, writer io
return fmt.Errorf("list uploads under %v: %v", uploadsDir, err)
}
- for _, staleUpload:= range staleUploads {
- deleteUrl := fmt.Sprintf("http://%s:%d%s/%s?recursive=true&ignoreRecursiveError=true",commandEnv.option.FilerHost, commandEnv.option.FilerPort,uploadsDir, staleUpload)
+ for _, staleUpload := range staleUploads {
+ deleteUrl := fmt.Sprintf("http://%s:%d%s/%s?recursive=true&ignoreRecursiveError=true", commandEnv.option.FilerHost, commandEnv.option.FilerPort, uploadsDir, staleUpload)
fmt.Fprintf(writer, "purge %s\n", deleteUrl)
err = util.Delete(deleteUrl, "")
@@ -89,4 +89,4 @@ func (c *commandS3CleanUploads) cleanupUploads(commandEnv *CommandEnv, writer io
return nil
-}
\ No newline at end of file
+}
diff --git a/weed/storage/needle/crc.go b/weed/storage/needle/crc.go
index 22456faa29..4476631c2f 100644
--- a/weed/storage/needle/crc.go
+++ b/weed/storage/needle/crc.go
@@ -35,7 +35,7 @@ func NewCRCwriter(w io.Writer) *CRCwriter {
return &CRCwriter{
crc: CRC(0),
- w: w,
+ w: w,
}
}
diff --git a/weed/storage/volume_stream_write.go b/weed/storage/volume_stream_write.go
index 955875aa26..d229bdf208 100644
--- a/weed/storage/volume_stream_write.go
+++ b/weed/storage/volume_stream_write.go
@@ -73,7 +73,7 @@ func (v *Volume) StreamRead(n *needle.Needle, writer io.Writer) (err error) {
sr := &StreamReader{
readerAt: v.DataBackend,
- offset: nv.Offset.ToActualOffset(),
+ offset: nv.Offset.ToActualOffset(),
}
bufReader := bufio.NewReader(sr)
bufReader.Discard(NeedleHeaderSize)
diff --git a/weed/wdclient/net2/doc.go b/weed/wdclient/net2/doc.go
index f4d6552e49..fd1c6323d9 100644
--- a/weed/wdclient/net2/doc.go
+++ b/weed/wdclient/net2/doc.go
@@ -3,4 +3,4 @@
package net2
// copied from https://github.com/dropbox/godropbox/tree/master/net2
-// removed other dependencies
\ No newline at end of file
+// removed other dependencies
diff --git a/weed/wdclient/net2/ip.go b/weed/wdclient/net2/ip.go
index 60e46342f7..ff5e3b24e5 100644
--- a/weed/wdclient/net2/ip.go
+++ b/weed/wdclient/net2/ip.go
@@ -80,7 +80,7 @@ func GetLocalIPs() ([]*net.IP, error) {
// TODO(zviad): Is rest of the code really necessary?
addrs, err := net.InterfaceAddrs()
if err != nil {
- return nil, fmt.Errorf( "Failed to get interface addresses: %v", err)
+ return nil, fmt.Errorf("Failed to get interface addresses: %v", err)
}
for _, addr := range addrs {
ipnet, ok := addr.(*net.IPNet)
diff --git a/weed/wdclient/resource_pool/doc.go b/weed/wdclient/resource_pool/doc.go
index c17b17c6cf..b8b3f92fa9 100644
--- a/weed/wdclient/resource_pool/doc.go
+++ b/weed/wdclient/resource_pool/doc.go
@@ -2,4 +2,4 @@
package resource_pool
// copied from https://github.com/dropbox/godropbox/tree/master/resource_pool
-// removed other dependencies
\ No newline at end of file
+// removed other dependencies