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/job.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/job.go')
-rw-r--r-- | model/job.go | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/model/job.go b/model/job.go index 9a7566025..e10ed1f5d 100644 --- a/model/job.go +++ b/model/job.go @@ -71,11 +71,8 @@ func (j *Job) IsValid() *AppError { } func (js *Job) ToJson() string { - if b, err := json.Marshal(js); err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(js) + return string(b) } func JobFromJson(data io.Reader) *Job { @@ -88,11 +85,8 @@ func JobFromJson(data io.Reader) *Job { } func JobsToJson(jobs []*Job) string { - if b, err := json.Marshal(jobs); err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(jobs) + return string(b) } func JobsFromJson(data io.Reader) []*Job { @@ -105,11 +99,8 @@ func JobsFromJson(data io.Reader) []*Job { } func (js *Job) DataToJson() string { - if b, err := json.Marshal(js.Data); err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(js.Data) + return string(b) } type Worker interface { |