From c9c8b012a027e7ff234ac3440620303374464665 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Wed, 31 Jul 2019 11:48:19 -0700 Subject: Add static compile time check to plugins Add a static compile time check to plugins to make sure that any interface implementation mismatch is caught at compile time rather than runtime. Issue-ID: MULTICLOUD-666 Change-Id: I7f57774ad9384edb874cf64534f521014aea422f Signed-off-by: Kiran Kamineni --- src/k8splugin/plugins/namespace/plugin.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/k8splugin/plugins/namespace/plugin.go') diff --git a/src/k8splugin/plugins/namespace/plugin.go b/src/k8splugin/plugins/namespace/plugin.go index d30f55b8..feb2aa61 100644 --- a/src/k8splugin/plugins/namespace/plugin.go +++ b/src/k8splugin/plugins/namespace/plugin.go @@ -26,6 +26,9 @@ import ( "github.com/onap/multicloud-k8s/src/k8splugin/internal/plugin" ) +// Compile time check to see if namespacePlugin implements the correct interface +var _ plugin.Reference = namespacePlugin{} + // ExportedVariable is what we will look for when calling the plugin var ExportedVariable namespacePlugin -- cgit 1.2.3-korg