fixing golint issues to try to figure out test flakiness

This commit is contained in:
2017-08-05 17:15:45 -07:00
parent be1aefa439
commit 029d1ed5b3
5 changed files with 28 additions and 21 deletions
+5 -3
View File
@@ -3,9 +3,9 @@ package caddyhugo
import (
"fmt"
"image"
_ "image/gif"
_ "image/gif" // for processing images
"image/jpeg"
_ "image/png"
_ "image/png" // for processing images
"io"
"net/http"
"os"
@@ -217,6 +217,9 @@ func (ch *CaddyHugo) uploadMedia(w http.ResponseWriter, r *http.Request) (int, e
for {
part, err := mr.NextPart()
if err == io.EOF {
break
}
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return 400, nil
@@ -344,7 +347,6 @@ func parseSizeString(str string, actual image.Rectangle) (image.Rectangle, error
// w was the only dimension given, so set it to the greater dimension
// of the actual image size
if actual.Dx() > actual.Dy() {
w = w
h = 0
} else {
h = w