unit test refactor in pkg/httputils as suggested by vdemeester; using pattern if x := …; x == nil {}

Signed-off-by: Kristina Zabunova <triara.xiii@gmail.com>
(cherry picked from commit c3f1b2a5bd4a4330bcbad401c316af90925b99ad)
This commit is contained in:
Kristina Zabunova 2015-07-01 08:42:13 -07:00 committed by David Calavera
parent 46454090b6
commit a5efa69750
2 changed files with 9 additions and 12 deletions

View file

@ -7,8 +7,7 @@ import (
func TestDetectContentType(t *testing.T) {
input := []byte("That is just a plain text")
contentType, _, err := DetectContentType(input)
if err != nil || contentType != "text/plain" {
if contentType, _, err := DetectContentType(input); err != nil || contentType != "text/plain" {
t.Errorf("TestDetectContentType failed")
}
}