diff --git a/weed/filer/abstract_sql/abstract_sql_store.go b/weed/filer/abstract_sql/abstract_sql_store.go index 33a237e87..bd1ac9734 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 2c815aa1f..06fb3af46 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 d37699a5a..0fa57dd06 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 2549b6029..2e9556f1f 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 b9f7f06dd..70f729fc9 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)