From ffd9a9164a48bc0c74b335a851d8c0c82787a73e Mon Sep 17 00:00:00 2001 From: CFC4N Date: Sat, 17 Aug 2024 00:16:47 +0800 Subject: [PATCH] pkg: fix lint staticcheck Signed-off-by: CFC4N --- pkg/event_processor/processor_test.go | 6 ++++-- user/module/probe_openssl_lib.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/event_processor/processor_test.go b/pkg/event_processor/processor_test.go index 8b0b92a46..5380f4b41 100644 --- a/pkg/event_processor/processor_test.go +++ b/pkg/event_processor/processor_test.go @@ -44,13 +44,15 @@ func TestEventProcessor_Serve(t *testing.T) { var err error err = ep.Serve() if err != nil { - log.Fatalf(err.Error()) + //log.Fatalf(err.Error()) + t.Error(err) + return } }() content, err := os.ReadFile(testFile) if err != nil { //Do something - log.Fatalf("open file error: %s, file:%s", err.Error(), testFile) + t.Fatalf("open file error: %s, file:%s", err.Error(), testFile) } lines := strings.Split(string(content), "\n") diff --git a/user/module/probe_openssl_lib.go b/user/module/probe_openssl_lib.go index 564833300..9b40cc9b8 100644 --- a/user/module/probe_openssl_lib.go +++ b/user/module/probe_openssl_lib.go @@ -212,8 +212,8 @@ func (m *MOpenSSLProbe) detectOpenssl(soPath string) error { } - f.Close() - buf = buf[:0] + _ = f.Close() + //buf = buf[:0] var bpfFile string var found bool