all: assert internal objects implement interfaces
This commit is contained in:
parent
44ef109483
commit
06fd1369aa
@ -47,6 +47,9 @@ type Args struct {
|
|||||||
Path string
|
Path string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Args implements the CNIArgs interface
|
||||||
|
var _ CNIArgs = &Args{}
|
||||||
|
|
||||||
func (args *Args) AsEnv() []string {
|
func (args *Args) AsEnv() []string {
|
||||||
env := os.Environ()
|
env := os.Environ()
|
||||||
pluginArgsStr := args.PluginArgsStr
|
pluginArgsStr := args.PluginArgsStr
|
||||||
|
3
ns/ns.go
3
ns/ns.go
@ -62,6 +62,9 @@ type netNS struct {
|
|||||||
closed bool
|
closed bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// netNS implements the NetNS interface
|
||||||
|
var _ NetNS = &netNS{}
|
||||||
|
|
||||||
func getCurrentThreadNetNSPath() string {
|
func getCurrentThreadNetNSPath() string {
|
||||||
// /proc/self/ns/net returns the namespace of the main thread, not
|
// /proc/self/ns/net returns the namespace of the main thread, not
|
||||||
// of whatever thread this goroutine is running on. Make sure we
|
// of whatever thread this goroutine is running on. Make sure we
|
||||||
|
@ -36,6 +36,9 @@ type pluginInfo struct {
|
|||||||
SupportedVersions_ []string `json:"supportedVersions,omitempty"`
|
SupportedVersions_ []string `json:"supportedVersions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pluginInfo implements the PluginInfo interface
|
||||||
|
var _ PluginInfo = &pluginInfo{}
|
||||||
|
|
||||||
func (p *pluginInfo) Encode(w io.Writer) error {
|
func (p *pluginInfo) Encode(w io.Writer) error {
|
||||||
return json.NewEncoder(w).Encode(p)
|
return json.NewEncoder(w).Encode(p)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user