From 2fead035e84117d42c47ed84fb90a1a2cf77cc5d Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Tue, 8 Feb 2022 00:05:35 +0300 Subject: [PATCH] Fix the linting errors --- tap/extensions/http/main_test.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tap/extensions/http/main_test.go b/tap/extensions/http/main_test.go index 9f1346994..36f3cd206 100644 --- a/tap/extensions/http/main_test.go +++ b/tap/extensions/http/main_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "io" "io/ioutil" "log" "os" @@ -34,7 +35,8 @@ func TestDissect(t *testing.T) { if testUpdateEnabled { os.RemoveAll(expectDir) - os.MkdirAll(expectDir, 0775) + err := os.MkdirAll(expectDir, 0775) + assert.Nil(t, err) } dissector := NewDissector() @@ -85,7 +87,10 @@ func TestDissect(t *testing.T) { SrcPort: "1", DstPort: "2", } - dissector.Dissect(bufferClient, true, tcpIDClient, counterPair, &api.SuperTimer{}, superIdentifier, emitter, options) + err = dissector.Dissect(bufferClient, true, tcpIDClient, counterPair, &api.SuperTimer{}, superIdentifier, emitter, options) + if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF { + panic(err) + } // Response pathServer := basePath + respSuffix @@ -100,7 +105,10 @@ func TestDissect(t *testing.T) { SrcPort: "2", DstPort: "1", } - dissector.Dissect(bufferServer, false, tcpIDServer, counterPair, &api.SuperTimer{}, superIdentifier, emitter, options) + err = dissector.Dissect(bufferServer, false, tcpIDServer, counterPair, &api.SuperTimer{}, superIdentifier, emitter, options) + if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF { + panic(err) + } fileClient.Close() fileServer.Close()