summaryrefslogtreecommitdiffstats
path: root/model/plugins_response.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/plugins_response.go')
-rw-r--r--model/plugins_response.go19
1 files changed, 5 insertions, 14 deletions
diff --git a/model/plugins_response.go b/model/plugins_response.go
index 74c89af26..b6c01b642 100644
--- a/model/plugins_response.go
+++ b/model/plugins_response.go
@@ -19,21 +19,12 @@ type PluginsResponse struct {
}
func (m *PluginsResponse) ToJson() string {
- b, err := json.Marshal(m)
- if err != nil {
- return ""
- } else {
- return string(b)
- }
+ b, _ := json.Marshal(m)
+ return string(b)
}
func PluginsResponseFromJson(data io.Reader) *PluginsResponse {
- decoder := json.NewDecoder(data)
- var m PluginsResponse
- err := decoder.Decode(&m)
- if err == nil {
- return &m
- } else {
- return nil
- }
+ var m *PluginsResponse
+ json.NewDecoder(data).Decode(&m)
+ return m
}