diff --git a/internal/dns/command_test.go b/internal/dns/command_test.go index 7300780b..d3fe6d62 100644 --- a/internal/dns/command_test.go +++ b/internal/dns/command_test.go @@ -16,7 +16,6 @@ import ( func Test_Start(t *testing.T) { t.Parallel() mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() logger := mock_logging.NewMockLogger(mockCtrl) logger.EXPECT().Info("starting unbound") commander := mock_command.NewMockCommander(mockCtrl) @@ -54,7 +53,6 @@ func Test_Version(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() commander := mock_command.NewMockCommander(mockCtrl) commander.EXPECT().Run(context.Background(), "unbound", "-V"). Return(tc.runOutput, tc.runErr) diff --git a/internal/dns/conf_test.go b/internal/dns/conf_test.go index 5bccd18d..8d287078 100644 --- a/internal/dns/conf_test.go +++ b/internal/dns/conf_test.go @@ -31,7 +31,6 @@ func Test_generateUnboundConf(t *testing.T) { IPv6: true, } mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() ctx := context.Background() client := mock_network.NewMockClient(mockCtrl) client.EXPECT().Get(ctx, string(constants.MaliciousBlockListHostnamesURL)). @@ -233,7 +232,6 @@ func Test_buildBlocked(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() ctx := context.Background() client := mock_network.NewMockClient(mockCtrl) if tc.malicious.blocked { @@ -287,7 +285,6 @@ func Test_getList(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() ctx := context.Background() client := mock_network.NewMockClient(mockCtrl) client.EXPECT().Get(ctx, "irrelevant_url"). @@ -392,7 +389,6 @@ func Test_buildBlockedHostnames(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() ctx := context.Background() client := mock_network.NewMockClient(mockCtrl) if tc.malicious.blocked { @@ -510,7 +506,6 @@ func Test_buildBlockedIPs(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() ctx := context.Background() client := mock_network.NewMockClient(mockCtrl) if tc.malicious.blocked { diff --git a/internal/dns/nameserver_test.go b/internal/dns/nameserver_test.go index 1c88aa80..2b5e5889 100644 --- a/internal/dns/nameserver_test.go +++ b/internal/dns/nameserver_test.go @@ -56,7 +56,6 @@ func Test_UseDNSSystemWide(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() file := mock_os.NewMockFile(mockCtrl) if tc.openErr == nil { diff --git a/internal/dns/roots_test.go b/internal/dns/roots_test.go index d2f5be01..67e69fca 100644 --- a/internal/dns/roots_test.go +++ b/internal/dns/roots_test.go @@ -70,7 +70,6 @@ func Test_downloadAndSave(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() ctx := context.Background() logger := mock_logging.NewMockLogger(mockCtrl)