summaryrefslogtreecommitdiffstats
path: root/model/cluster_stats.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/cluster_stats.go')
-rw-r--r--model/cluster_stats.go19
1 files changed, 5 insertions, 14 deletions
diff --git a/model/cluster_stats.go b/model/cluster_stats.go
index 879487c6e..064f7b816 100644
--- a/model/cluster_stats.go
+++ b/model/cluster_stats.go
@@ -16,21 +16,12 @@ type ClusterStats struct {
}
func (me *ClusterStats) ToJson() string {
- b, err := json.Marshal(me)
- if err != nil {
- return ""
- } else {
- return string(b)
- }
+ b, _ := json.Marshal(me)
+ return string(b)
}
func ClusterStatsFromJson(data io.Reader) *ClusterStats {
- decoder := json.NewDecoder(data)
- var me ClusterStats
- err := decoder.Decode(&me)
- if err == nil {
- return &me
- } else {
- return nil
- }
+ var me *ClusterStats
+ json.NewDecoder(data).Decode(&me)
+ return me
}