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/data_retention_policy.go | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'model/data_retention_policy.go') diff --git a/model/data_retention_policy.go b/model/data_retention_policy.go index 7284477e5..dbb13374d 100644 --- a/model/data_retention_policy.go +++ b/model/data_retention_policy.go @@ -16,21 +16,12 @@ type DataRetentionPolicy struct { } func (me *DataRetentionPolicy) ToJson() string { - b, err := json.Marshal(me) - if err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(me) + return string(b) } func DataRetentionPolicyFromJson(data io.Reader) *DataRetentionPolicy { - decoder := json.NewDecoder(data) - var me DataRetentionPolicy - err := decoder.Decode(&me) - if err == nil { - return &me - } else { - return nil - } + var me *DataRetentionPolicy + json.NewDecoder(data).Decode(&me) + return me } -- cgit v1.2.3-1-g7c22