diff options
Diffstat (limited to 'model/system.go')
-rw-r--r-- | model/system.go | 19 |
1 files changed, 5 insertions, 14 deletions
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 } |