pkg/truncindex: lint and add comments

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
This commit is contained in:
unclejack
2014-10-06 22:00:58 +03:00
parent d29c7e51cf
commit 39fe2a3e4e
2 changed files with 21 additions and 13 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ func httpError(w http.ResponseWriter, err error) {
// FIXME: this is brittle and should not be necessary.
// If we need to differentiate between different possible error types, we should
// create appropriate error types with clearly defined meaning.
if strings.Contains(err.Error(), "No such") {
if strings.Contains(err.Error(), "no such") {
statusCode = http.StatusNotFound
} else if strings.Contains(err.Error(), "Bad parameter") {
statusCode = http.StatusBadRequest