An example :
for _, a := range albums {
if a.ID == id {
c.IndentedJSON(http.StatusOK, a)
return
}
}
is ugly compared to a much more readable : for a in albums:
if a.ID == id:
// the rest of the code
or albums = append(albums, newAlbum)
is ugly compared to albums.append(newAlbum)
Edit : I have trouble formatting the code. How do you do this on HN ?` doesn't seem to work.Edit 2 : Fixed the formatting issue.