diff options
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 { |