Skip to content

Commit

Permalink
fix reuse test if writer is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
djherbis committed Mar 7, 2020
1 parent d81755d commit 646777d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fscache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,10 @@ func TestReuse(t *testing.T) {

data := fmt.Sprintf("hello %d", i)

w.Write([]byte(data))
w.Close()
if w != nil {
w.Write([]byte(data))
w.Close()
}

check(t, r, data)
r.Close()
Expand Down

0 comments on commit 646777d

Please sign in to comment.