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