From ca3f128194888e30aadc149eb40a1370931eb2eb Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Wed, 8 Dec 2021 20:46:02 +0100 Subject: [bug] panic no more --- pkg/motd/motd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/motd/motd.go') diff --git a/pkg/motd/motd.go b/pkg/motd/motd.go index 4dead55..c2d2994 100644 --- a/pkg/motd/motd.go +++ b/pkg/motd/motd.go @@ -14,12 +14,12 @@ const ExampleFile = "motd-example.json" func ParseFile(f string) (Messages, error) { jsonFile, err := os.Open(f) if err != nil { - panic(err) + return Messages{}, err } defer jsonFile.Close() byteVal, err := ioutil.ReadAll(jsonFile) if err != nil { - panic(err) + return Messages{}, err } return getFromJSON(byteVal) } -- cgit v1.2.3