Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit dcc078c

Browse files
committed
use t.fatal in setup
1 parent b8e9351 commit dcc078c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

util/file_cache_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package util
1818

1919
import (
2020
"bytes"
21-
"fmt"
2221
"io/ioutil"
2322
"os"
2423
"testing"
@@ -52,14 +51,12 @@ func cacheAndTest(c *cache.FileCache, t *testing.T, testStr string, layerId stri
5251
func TestCache(t *testing.T) {
5352
cacheDir, err := ioutil.TempDir("", ".cache")
5453
if err != nil {
55-
fmt.Printf(err.Error())
56-
os.Exit(1)
54+
t.Fatalf("error when creating cache directory: %s", err.Error())
5755
}
5856
defer os.RemoveAll(cacheDir)
5957
c, err := cache.NewFileCache(cacheDir)
6058
if err != nil {
61-
fmt.Printf(err.Error())
62-
os.Exit(1)
59+
t.Fatalf("error when creating cache: %s", err.Error())
6360
}
6461
testRuns := []struct {
6562
Name string

0 commit comments

Comments
 (0)