From 0c8968fb8df4ce302c928118cd81e75f5bef2861 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 30 Jan 2018 17:23:00 -0600 Subject: unnamed return (#8170) --- model/system.go | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'model/system.go') diff --git a/model/system.go b/model/system.go index e2f4283a4..020c50858 100644 --- a/model/system.go +++ b/model/system.go @@ -22,21 +22,12 @@ type System struct { } func (o *System) ToJson() string { - b, err := json.Marshal(o) - if err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(o) + return string(b) } func SystemFromJson(data io.Reader) *System { - decoder := json.NewDecoder(data) - var o System - err := decoder.Decode(&o) - if err == nil { - return &o - } else { - return nil - } + var o *System + json.NewDecoder(data).Decode(&o) + return o } -- cgit v1.2.3-1-g7c22