Fix padding on readme

This commit is contained in:
Gerasimos Maropoulos 2016-10-02 15:07:52 +03:00
parent 92785d109f
commit 9ef6ac30cb

View File

@ -252,30 +252,30 @@ func save(ctx *iris.Context) {
// Get avatar
avatar, err := ctx.FormFile("avatar")
if err != nil {
ctx.EmitError(iris.StatusInternalServerError)
return
ctx.EmitError(iris.StatusInternalServerError)
return
}
// Source
src, err := avatar.Open()
if err != nil {
ctx.EmitError(iris.StatusInternalServerError)
return
ctx.EmitError(iris.StatusInternalServerError)
return
}
defer src.Close()
// Destination
dst, err := os.Create(avatar.Filename)
if err != nil {
ctx.EmitError(iris.StatusInternalServerError)
return
ctx.EmitError(iris.StatusInternalServerError)
return
}
defer dst.Close()
// Copy
if _, err = io.Copy(dst, src); err != nil {
ctx.EmitError(iris.StatusInternalServerError)
return
ctx.EmitError(iris.StatusInternalServerError)
return
}
ctx.HTML(iris.StatusOK, "<b>Thanks!</b>")
@ -297,8 +297,8 @@ type User struct {
iris.Post("/users", func(ctx *iris.Context) {
u := new(User)
if err := ctx.ReadJSON(u); err != nil {
ctx.EmitError(iris.StatusInternalServerError)
return
ctx.EmitError(iris.StatusInternalServerError)
return
}
ctx.JSON(iris.StatusCreated, u)
// or