rename variables according to golangci-lint rec.
This commit is contained in:
committed by
Umputun
parent
cbdf5f1e47
commit
717c4aa638
@@ -89,12 +89,12 @@ func (s *private) createCommentCtrl(w http.ResponseWriter, r *http.Request) {
|
||||
comment = s.commentFormatter.Format(comment)
|
||||
|
||||
// check if images are valid
|
||||
imgIds, err := s.imageService.ExtractPictures(comment.Text)
|
||||
imgIDs, err := s.imageService.ExtractPictures(comment.Text)
|
||||
if err != nil {
|
||||
rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't extract pictures from comment text", rest.ErrCommentValidation)
|
||||
return
|
||||
}
|
||||
for _, id := range imgIds {
|
||||
for _, id := range imgIDs {
|
||||
_, err = s.imageService.Load(id)
|
||||
if err != nil {
|
||||
rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't load picture from the comment", rest.ErrImgNotFound)
|
||||
|
||||
@@ -134,12 +134,12 @@ func (s *public) previewCommentCtrl(w http.ResponseWriter, r *http.Request) {
|
||||
comment.Sanitize()
|
||||
|
||||
// check if images are valid
|
||||
imgIds, err := s.imageService.ExtractPictures(comment.Text)
|
||||
imgIDs, err := s.imageService.ExtractPictures(comment.Text)
|
||||
if err != nil {
|
||||
rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't extract pictures from comment text", rest.ErrCommentValidation)
|
||||
return
|
||||
}
|
||||
for _, id := range imgIds {
|
||||
for _, id := range imgIDs {
|
||||
_, err = s.imageService.Load(id)
|
||||
if err != nil {
|
||||
rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't load picture from the comment", rest.ErrImgNotFound)
|
||||
|
||||
Reference in New Issue
Block a user