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 Lu16ad74f4779b
diff --git a/weed/filer/abstract_sql/abstract_sql_store.go b/weed/filer/abstract_sql/abstract_sql_store.go
index 33a237e873..bd1ac9734e 100644
--- a/weed/filer/abstract_sql/abstract_sql_store.go
+++ b/weed/filer/abstract_sql/abstract_sql_store.go
@@ -203,7 +203,7 @@ func (store *AbstractSqlStore) ListDirectoryPrefixedEntries(ctx context.Context,
entries = append(entries, entry)
}
- hasMore = int64(len(entries)) == limit + 1
+ hasMore = int64(len(entries)) == limit+1
if hasMore {
entries = entries[:limit]
}
diff --git a/weed/filer/cassandra/cassandra_store.go b/weed/filer/cassandra/cassandra_store.go
index 2c815aa1f8..06fb3af46f 100644
--- a/weed/filer/cassandra/cassandra_store.go
+++ b/weed/filer/cassandra/cassandra_store.go
@@ -201,7 +201,7 @@ func (store *CassandraStore) ListDirectoryEntries(ctx context.Context, dirPath u
glog.V(0).Infof("list iterator close: %v", err)
}
- hasMore = int64(len(entries)) == limit + 1
+ hasMore = int64(len(entries)) == limit+1
if hasMore {
entries = entries[:limit]
}
diff --git a/weed/filer/filer_search.go b/weed/filer/filer_search.go
index d37699a5a9..0fa57dd067 100644
--- a/weed/filer/filer_search.go
+++ b/weed/filer/filer_search.go
@@ -53,7 +53,7 @@ func (f *Filer) doListPatternMatchedEntries(ctx context.Context, p util.FullPath
return
}
if len(restNamePattern) == 0 {
- return foundEntries, false,0, lastFileName, nil
+ return foundEntries, false, 0, lastFileName, nil
}
for _, entry := range foundEntries {
nameToTest := strings.ToLower(entry.Name())
diff --git a/weed/filer/mongodb/mongodb_store.go b/weed/filer/mongodb/mongodb_store.go
index 2549b60291..2e9556f1f1 100644
--- a/weed/filer/mongodb/mongodb_store.go
+++ b/weed/filer/mongodb/mongodb_store.go
@@ -190,7 +190,7 @@ func (store *MongodbStore) ListDirectoryEntries(ctx context.Context, dirPath uti
"$gte": startFileName,
}
}
- optLimit := int64(limit+1)
+ optLimit := int64(limit + 1)
opts := &options.FindOptions{Limit: &optLimit, Sort: bson.M{"name": 1}}
cur, err := store.connect.Database(store.database).Collection(store.collectionName).Find(ctx, where, opts)
for cur.Next(ctx) {
@@ -212,7 +212,7 @@ func (store *MongodbStore) ListDirectoryEntries(ctx context.Context, dirPath uti
entries = append(entries, entry)
}
- hasMore = int64(len(entries)) == limit + 1
+ hasMore = int64(len(entries)) == limit+1
if hasMore {
entries = entries[:limit]
}
diff --git a/weed/filer/mysql/mysql_store.go b/weed/filer/mysql/mysql_store.go
index b9f7f06dd8..70f729fc9f 100644
--- a/weed/filer/mysql/mysql_store.go
+++ b/weed/filer/mysql/mysql_store.go
@@ -42,7 +42,7 @@ func (store *MysqlStore) Initialize(configuration util.Configuration, prefix str
}
func (store *MysqlStore) initialize(user, password, hostname string, port int, database string, maxIdle, maxOpen,
- maxLifetimeSeconds int, interpolateParams bool) (err error) {
+ maxLifetimeSeconds int, interpolateParams bool) (err error) {
//
store.SqlInsert = "INSERT INTO filemeta (dirhash,name,directory,meta) VALUES(?,?,?,?)"
store.SqlUpdate = "UPDATE filemeta SET meta=? WHERE dirhash=? AND name=? AND directory=?"
@@ -67,7 +67,7 @@ func (store *MysqlStore) initialize(user, password, hostname string, port int, d
store.DB.SetMaxIdleConns(maxIdle)
store.DB.SetMaxOpenConns(maxOpen)
- store.DB.SetConnMaxLifetime(time.Duration(maxLifetimeSeconds)*time.Second)
+ store.DB.SetConnMaxLifetime(time.Duration(maxLifetimeSeconds) * time.Second)
if err = store.DB.Ping(); err != nil {
return fmt.Errorf("connect to %s error:%v", sqlUrl, err)