Skip to content

Commit

Permalink
make sure to close files
Browse files Browse the repository at this point in the history
  • Loading branch information
vaskoz committed Dec 2, 2019
1 parent 6bb61e6 commit 19779db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions day1p1/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ func TestMain(t *testing.T) {
if expected := "3368364"; expected != result {
t.Errorf("Expected %v, got %v", expected, result)
}

file.Close()
}

func BenchmarkMain(b *testing.B) {
Expand All @@ -29,5 +31,6 @@ func BenchmarkMain(b *testing.B) {
out = buff

main()
file.Close()
}
}
3 changes: 3 additions & 0 deletions day1p2/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ func TestMain(t *testing.T) {
if expected := "5049684"; expected != result {
t.Errorf("Expected %v, got %v", expected, result)
}

file.Close()
}

func BenchmarkMain(b *testing.B) {
Expand All @@ -29,5 +31,6 @@ func BenchmarkMain(b *testing.B) {
out = buff

main()
file.Close()
}
}

0 comments on commit 19779db

Please sign in to comment.