From 46765b84867f20b521ea6b5b2dad55bb317cdfbc Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Thu, 5 Feb 2026 18:00:40 +0800 Subject: [PATCH] test(node): more linters #24783 (#1996) --- node/config_test.go | 5 ++--- node/utils_test.go | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/node/config_test.go b/node/config_test.go index e518e7128b..1eca21a62b 100644 --- a/node/config_test.go +++ b/node/config_test.go @@ -65,10 +65,9 @@ func TestDatadirCreation(t *testing.T) { dir = filepath.Join(file.Name(), "invalid/path") node, err = New(&Config{DataDir: dir}) if err == nil { + // Ensure resources are cleaned up even on unexpected success. + _ = node.Close() t.Fatalf("protocol stack created with an invalid datadir") - if err := node.Close(); err != nil { - t.Fatalf("failed to close node: %v", err) - } } } diff --git a/node/utils_test.go b/node/utils_test.go index b73ff90de3..ec05dff2d0 100644 --- a/node/utils_test.go +++ b/node/utils_test.go @@ -47,8 +47,6 @@ type InstrumentedService struct { startHook func() stopHook func() - - protocols []p2p.Protocol } func (s *InstrumentedService) Start() error {