Skip to content

Commit 92c6a65

Browse files
landismndeloof
authored andcommitted
tilt: enable errcheck on tests (docker#2877)
1 parent 00b3cae commit 92c6a65

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

pkg/watch/notify_test.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212
"testing"
1313
"time"
1414

15+
"github.com/stretchr/testify/require"
16+
1517
"github.com/stretchr/testify/assert"
1618

1719
"github.com/windmilleng/tilt/internal/dockerignore"
@@ -95,7 +97,8 @@ func TestGitBranchSwitch(t *testing.T) {
9597
}
9698

9799
if i != 0 {
98-
os.RemoveAll(dir)
100+
err := os.RemoveAll(dir)
101+
require.NoError(t, err)
99102
}
100103
}
101104

@@ -313,7 +316,12 @@ func TestWatchBrokenLink(t *testing.T) {
313316
if err != nil {
314317
t.Fatal(err)
315318
}
316-
defer newRoot.TearDown()
319+
defer func() {
320+
err := newRoot.TearDown()
321+
if err != nil {
322+
fmt.Printf("error tearing down temp dir: %v\n", err)
323+
}
324+
}()
317325

318326
link := filepath.Join(newRoot.Path(), "brokenLink")
319327
missingFile := filepath.Join(newRoot.Path(), "missingFile")
@@ -323,7 +331,8 @@ func TestWatchBrokenLink(t *testing.T) {
323331
}
324332

325333
f.watch(newRoot.Path())
326-
os.Remove(link)
334+
err = os.Remove(link)
335+
require.NoError(t, err)
327336
f.assertEvents(link)
328337
}
329338

0 commit comments

Comments
 (0)