From f8ea65dbc8606e93856723fe43f6a4a2be419e4e Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 2 Jan 2026 00:59:35 -0500 Subject: [PATCH] refactor: make MockPDK private Signed-off-by: Deluan --- plugins/cmd/ndpgen/internal/templates/pdk_stub.go.tmpl | 8 ++++---- plugins/pdk/go/pdk/pdk_stub.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/cmd/ndpgen/internal/templates/pdk_stub.go.tmpl b/plugins/cmd/ndpgen/internal/templates/pdk_stub.go.tmpl index 48d27be4b..6a57a6469 100644 --- a/plugins/cmd/ndpgen/internal/templates/pdk_stub.go.tmpl +++ b/plugins/cmd/ndpgen/internal/templates/pdk_stub.go.tmpl @@ -10,19 +10,19 @@ package pdk import "github.com/stretchr/testify/mock" -// MockPDK is the mock implementation for testing PDK functions. -type MockPDK struct { +// mockPDK is the mock implementation for testing PDK functions. +type mockPDK struct { mock.Mock } // PDKMock is the auto-instantiated mock instance for testing. // Use this to set expectations: pdk.PDKMock.On("GetConfig", "key").Return("value", true) -var PDKMock = &MockPDK{} +var PDKMock = &mockPDK{} // ResetMock resets the mock to its initial state. // Call this in test setup/teardown to ensure clean state between tests. func ResetMock() { - PDKMock = &MockPDK{} + PDKMock = &mockPDK{} } // Functions diff --git a/plugins/pdk/go/pdk/pdk_stub.go b/plugins/pdk/go/pdk/pdk_stub.go index 6b725417c..3bdbb1cb7 100644 --- a/plugins/pdk/go/pdk/pdk_stub.go +++ b/plugins/pdk/go/pdk/pdk_stub.go @@ -10,19 +10,19 @@ package pdk import "github.com/stretchr/testify/mock" -// MockPDK is the mock implementation for testing PDK functions. -type MockPDK struct { +// mockPDK is the mock implementation for testing PDK functions. +type mockPDK struct { mock.Mock } // PDKMock is the auto-instantiated mock instance for testing. // Use this to set expectations: pdk.PDKMock.On("GetConfig", "key").Return("value", true) -var PDKMock = &MockPDK{} +var PDKMock = &mockPDK{} // ResetMock resets the mock to its initial state. // Call this in test setup/teardown to ensure clean state between tests. func ResetMock() { - PDKMock = &MockPDK{} + PDKMock = &mockPDK{} } // Functions