From 2a64a71eb85e94d14e1a9172460aff1567c758e5 Mon Sep 17 00:00:00 2001 From: Umputun Date: Mon, 25 Mar 2019 01:15:51 -0500 Subject: [PATCH] lint: missing err check in test --- backend/app/rest/api/rest_private_test.go | 2 ++ backend/app/store/image/fs_store_test.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/app/rest/api/rest_private_test.go b/backend/app/rest/api/rest_private_test.go index 33663b6e..662fe321 100644 --- a/backend/app/rest/api/rest_private_test.go +++ b/backend/app/rest/api/rest_private_test.go @@ -523,6 +523,7 @@ func TestRest_SavePictureCtrl(t *testing.T) { m := map[string]string{} err = json.Unmarshal(body, &m) + assert.NoError(t, err) assert.Contains(t, m["id"], ".png") // load picture @@ -577,6 +578,7 @@ func TestRest_CreateWithPictures(t *testing.T) { require.Nil(t, err) m := map[string]string{} err = json.Unmarshal(body, &m) + assert.NoError(t, err) assert.Contains(t, m["id"], ".png") return m["id"] } diff --git a/backend/app/store/image/fs_store_test.go b/backend/app/store/image/fs_store_test.go index 5906d814..56623131 100644 --- a/backend/app/store/image/fs_store_test.go +++ b/backend/app/store/image/fs_store_test.go @@ -187,14 +187,14 @@ func TestFsStore_Cleanup(t *testing.T) { assert.NotNil(t, err, "no file on staging anymore") } -func prepareImageTest(t *testing.T) (svc FileSystem, teardown func()) { +func prepareImageTest(t *testing.T) (svc *FileSystem, teardown func()) { loc, err := ioutil.TempDir("", "test_image_r42") require.NoError(t, err, "failed to make temp dir") staging, err := ioutil.TempDir("", "test_image_r42.staging") require.NoError(t, err, "failed to make temp staging dir") - svc = FileSystem{ + svc = &FileSystem{ Location: loc, Staging: staging, Partitions: 100,