From 06fd1369aabb041b1743146ded582ace8a459b21 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 14 Dec 2016 17:09:01 -0600 Subject: [PATCH] all: assert internal objects implement interfaces --- invoke/args.go | 3 +++ ns/ns.go | 3 +++ version/plugin.go | 3 +++ 3 files changed, 9 insertions(+) diff --git a/invoke/args.go b/invoke/args.go index be28ba62..ba9d0c3b 100644 --- a/invoke/args.go +++ b/invoke/args.go @@ -47,6 +47,9 @@ type Args struct { Path string } +// Args implements the CNIArgs interface +var _ CNIArgs = &Args{} + func (args *Args) AsEnv() []string { env := os.Environ() pluginArgsStr := args.PluginArgsStr diff --git a/ns/ns.go b/ns/ns.go index 3246ebf3..220dd694 100644 --- a/ns/ns.go +++ b/ns/ns.go @@ -62,6 +62,9 @@ type netNS struct { closed bool } +// netNS implements the NetNS interface +var _ NetNS = &netNS{} + func getCurrentThreadNetNSPath() string { // /proc/self/ns/net returns the namespace of the main thread, not // of whatever thread this goroutine is running on. Make sure we diff --git a/version/plugin.go b/version/plugin.go index dc937b54..8a467281 100644 --- a/version/plugin.go +++ b/version/plugin.go @@ -36,6 +36,9 @@ type pluginInfo struct { SupportedVersions_ []string `json:"supportedVersions,omitempty"` } +// pluginInfo implements the PluginInfo interface +var _ PluginInfo = &pluginInfo{} + func (p *pluginInfo) Encode(w io.Writer) error { return json.NewEncoder(w).Encode(p) }