diff options
author | George Goldberg <george@gberg.me> | 2018-02-06 17:25:53 +0000 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2018-02-06 17:25:53 +0000 |
commit | 7941c30117efe1b957ac0458c2f0479e3824196d (patch) | |
tree | df791632a9dc790a6f73dec53aae3ba919ebda63 /model/manifest.go | |
parent | e1cd64613591cf5a990442a69ebf188258bd0cb5 (diff) | |
parent | 034dbc07e3068c482e654b6a1a8fcbe4b01c44f3 (diff) | |
download | chat-7941c30117efe1b957ac0458c2f0479e3824196d.tar.gz chat-7941c30117efe1b957ac0458c2f0479e3824196d.tar.bz2 chat-7941c30117efe1b957ac0458c2f0479e3824196d.zip |
Merge branch 'master' into advanced-permissions-phase-1
Diffstat (limited to 'model/manifest.go')
-rw-r--r-- | model/manifest.go | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/model/manifest.go b/model/manifest.go index 03d78f84e..5ba4854b6 100644 --- a/model/manifest.go +++ b/model/manifest.go @@ -142,43 +142,25 @@ type ManifestWebapp struct { } func (m *Manifest) ToJson() string { - b, err := json.Marshal(m) - if err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(m) + return string(b) } func ManifestListToJson(m []*Manifest) string { - b, err := json.Marshal(m) - if err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(m) + return string(b) } func ManifestFromJson(data io.Reader) *Manifest { - decoder := json.NewDecoder(data) - var m Manifest - err := decoder.Decode(&m) - if err == nil { - return &m - } else { - return nil - } + var m *Manifest + json.NewDecoder(data).Decode(&m) + return m } func ManifestListFromJson(data io.Reader) []*Manifest { - decoder := json.NewDecoder(data) var manifests []*Manifest - err := decoder.Decode(&manifests) - if err == nil { - return manifests - } else { - return nil - } + json.NewDecoder(data).Decode(&manifests) + return manifests } func (m *Manifest) HasClient() bool { |