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:
parent
46454090b6
commit
a5efa69750
2 changed files with 9 additions and 12 deletions
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue