From 1d661dfa0dcf07f790056ba9dd054538ec45d8c3 Mon Sep 17 00:00:00 2001 From: Michael Zappa Date: Sat, 5 Aug 2023 21:14:18 -0600 Subject: [PATCH] fix white space issues Signed-off-by: Michael Zappa --- cni.go | 10 +++++----- cni_test.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cni.go b/cni.go index a0b5bf8..6847f2a 100644 --- a/cni.go +++ b/cni.go @@ -194,7 +194,7 @@ func (c *libcni) SetupSerially(ctx context.Context, id string, path string, opts return c.createResult(result) } -// BuildMultiNetwork build dynamic list of Networks. +// BuildMultiNetwork build dynamic list of Networks. func (c *libcni) BuildMultiNetwork(networkNames []*NetworkInterface) ([]*Network, error) { var network []*Network ifaceindex := 0 @@ -202,12 +202,12 @@ func (c *libcni) BuildMultiNetwork(networkNames []*NetworkInterface) ([]*Network config := make(map[string]*Network) ifs := make(map[string]*Network) - for _, v := range c.Networks(){ + for _, v := range c.Networks() { config[v.config.Name] = v } name := "" - for _,v := range networkNames { + for _, v := range networkNames { if net, ok := config[v.NetworkName]; ok { if v.InterfaceName == "" { name = getIfName(c.prefix, ifaceindex) @@ -217,14 +217,14 @@ func (c *libcni) BuildMultiNetwork(networkNames []*NetworkInterface) ([]*Network } network = append(network, &Network{ - cni: net.cni, + cni: net.cni, config: net.config, ifName: name, }) if _, ok := ifs[name]; ok { return nil, fmt.Errorf("the interface: %v already exists and must be unique", name) - } + } ifs[name] = net } else { diff --git a/cni_test.go b/cni_test.go index a053981..642334b 100644 --- a/cni_test.go +++ b/cni_test.go @@ -314,7 +314,7 @@ func TestBuildNetworksWithAnnotation(t *testing.T) { InterfaceName: "net1", }, { - NetworkName: "plugin2", + NetworkName: "plugin2", InterfaceName: "net10", }, } @@ -371,7 +371,7 @@ func TestBuildNetworksDuplicateIfName(t *testing.T) { //InterfaceName: "This should be commented out" }, { - NetworkName: "plugin2", + NetworkName: "plugin2", InterfaceName: "net10", }, }