summaryrefslogtreecommitdiffstats
path: root/model/switch_request.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/switch_request.go')
-rw-r--r--model/switch_request.go19
1 files changed, 5 insertions, 14 deletions
diff --git a/model/switch_request.go b/model/switch_request.go
index 100392944..e153c92f4 100644
--- a/model/switch_request.go
+++ b/model/switch_request.go
@@ -19,23 +19,14 @@ type SwitchRequest struct {
}
func (o *SwitchRequest) ToJson() string {
- b, err := json.Marshal(o)
- if err != nil {
- return ""
- } else {
- return string(b)
- }
+ b, _ := json.Marshal(o)
+ return string(b)
}
func SwitchRequestFromJson(data io.Reader) *SwitchRequest {
- decoder := json.NewDecoder(data)
- var o SwitchRequest
- err := decoder.Decode(&o)
- if err == nil {
- return &o
- } else {
- return nil
- }
+ var o *SwitchRequest
+ json.NewDecoder(data).Decode(&o)
+ return o
}
func (o *SwitchRequest) EmailToOAuth() bool {