go fmt
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user