提交 a0eae692 编写于 作者: R Robert Swain

mediaapi/writers: Remove unnecessary fmt.Sprintf

上级 08d1eb96
...@@ -119,7 +119,7 @@ func (r *uploadRequest) doUpload(reqReader io.Reader, cfg *config.MediaAPI, db * ...@@ -119,7 +119,7 @@ func (r *uploadRequest) doUpload(reqReader io.Reader, cfg *config.MediaAPI, db *
fileutils.RemoveDir(tmpDir, r.Logger) fileutils.RemoveDir(tmpDir, r.Logger)
return &util.JSONResponse{ return &util.JSONResponse{
Code: 400, Code: 400,
JSON: jsonerror.Unknown(fmt.Sprintf("Failed to upload")), JSON: jsonerror.Unknown("Failed to upload"),
} }
} }
...@@ -222,7 +222,7 @@ func (r *uploadRequest) storeFileAndMetadata(tmpDir types.Path, absBasePath type ...@@ -222,7 +222,7 @@ func (r *uploadRequest) storeFileAndMetadata(tmpDir types.Path, absBasePath type
r.Logger.WithError(err).Error("Failed to move file.") r.Logger.WithError(err).Error("Failed to move file.")
return &util.JSONResponse{ return &util.JSONResponse{
Code: 400, Code: 400,
JSON: jsonerror.Unknown(fmt.Sprintf("Failed to upload")), JSON: jsonerror.Unknown("Failed to upload"),
} }
} }
if duplicate { if duplicate {
...@@ -239,7 +239,7 @@ func (r *uploadRequest) storeFileAndMetadata(tmpDir types.Path, absBasePath type ...@@ -239,7 +239,7 @@ func (r *uploadRequest) storeFileAndMetadata(tmpDir types.Path, absBasePath type
} }
return &util.JSONResponse{ return &util.JSONResponse{
Code: 400, Code: 400,
JSON: jsonerror.Unknown(fmt.Sprintf("Failed to upload")), JSON: jsonerror.Unknown("Failed to upload"),
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册