From d7b3df5ae18fce41451cc0bf85e71e1bf26358e6 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Sat, 2 Dec 2017 13:52:43 +0000 Subject: [PATCH] Fix staticcheck errors --- discovery/file/file_test.go | 2 +- web/api/v1/api.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/discovery/file/file_test.go b/discovery/file/file_test.go index 6ac5aa7e9..5116ab9bc 100644 --- a/discovery/file/file_test.go +++ b/discovery/file/file_test.go @@ -76,10 +76,10 @@ func testFileSD(t *testing.T, prefix, ext string, expect bool) { }() newf, err := os.Create(filepath.Join(testDir, "_test_"+prefix+ext)) - defer newf.Close() if err != nil { t.Fatal(err) } + defer newf.Close() f, err := os.Open(filepath.Join(testDir, prefix+ext)) if err != nil { diff --git a/web/api/v1/api.go b/web/api/v1/api.go index 238ba8ff6..28d0681b6 100644 --- a/web/api/v1/api.go +++ b/web/api/v1/api.go @@ -45,18 +45,18 @@ type status string const ( statusSuccess status = "success" - statusError = "error" + statusError status = "error" ) type errorType string const ( errorNone errorType = "" - errorTimeout = "timeout" - errorCanceled = "canceled" - errorExec = "execution" - errorBadData = "bad_data" - errorInternal = "internal" + errorTimeout errorType = "timeout" + errorCanceled errorType = "canceled" + errorExec errorType = "execution" + errorBadData errorType = "bad_data" + errorInternal errorType = "internal" ) var corsHeaders = map[string]string{