Skip to content

Commit

Permalink
Fix removeDir function in tests. (dgraph-io#1145)
Browse files Browse the repository at this point in the history
All the usages of removeDir only called the function itself and not
the returned func. This change does away with the returned func, so
calling removeDir will remove the badger directories during the test.
  • Loading branch information
danielmai authored and Ibrahim Jarif committed Dec 6, 2019
1 parent 407e5bd commit 690488d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2025,11 +2025,9 @@ func ExampleDB_Subscribe() {
// a-key is now set to a-value
}

func removeDir(dir string) func() {
return func() {
if err := os.RemoveAll(dir); err != nil {
panic(err)
}
func removeDir(dir string) {
if err := os.RemoveAll(dir); err != nil {
panic(err)
}
}

Expand Down

0 comments on commit 690488d

Please sign in to comment.