コード例 #1
0
ファイル: leveldb.go プロジェクト: carriercomm/levigoNS
/*
CloseAndDeleteDB closes and deletes a db given handle and dbpath.
Useful in use and throw implementations. And also tests.
*/
func CloseAndDeleteDB(dbpath string, db *levigo.DB) {
	db.Close()
	if os.RemoveAll(dbpath) != nil {
		panic("Fail: Temporary DB files are still present at: " + dbpath)
	}
}