From 614c320feed425afc22f95d7328008d8c749e045 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 27 Oct 2019 14:22:17 +0000 Subject: [PATCH] complete rewrite of project --- file.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/file.go b/file.go index 9d83733..1321ced 100644 --- a/file.go +++ b/file.go @@ -4,16 +4,14 @@ import ( "io/ioutil" "log" "os" - - "0cd.xyz-go/logger" ) // File reads request json file -func File(path string) ([]byte, *logger.HTTPError) { +func File(path string) ([]byte, error) { jsonFile, err := os.Open(path) if err != nil { log.Println("Error reading request. ", err) - return nil, &logger.HTTPError{Status: "500 Internal Server Error", StatusCode: 500} + return nil, err } defer jsonFile.Close() byteValue, _ := ioutil.ReadAll(jsonFile)