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