complete rewrite of project

This commit is contained in:
Michael 2019-10-27 14:22:17 +00:00
parent bcd4b5d165
commit 614c320fee

View File

@ -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)