From 8b4201ce26ed2ad5aa3f77c033bd0abb2f51ffee Mon Sep 17 00:00:00 2001 From: Artsiom Koltun Date: Mon, 12 Feb 2024 08:42:15 +0100 Subject: [PATCH] refactor: unused args names to underscores Signed-off-by: Artsiom Koltun --- cmd/inventory/inventory-get.go | 4 ++-- cmd/ipsec/ipsec-stats.go | 4 ++-- cmd/ipsec/ipsec-test.go | 2 +- cmd/network/evpn-bridge-port.go | 12 ++++++------ cmd/network/evpn-logical-brige.go | 10 +++++----- cmd/network/evpn-svi.go | 10 +++++----- cmd/network/evpn-test.go | 2 +- cmd/network/evpn-vrf.go | 10 +++++----- cmd/storage/backend/backend.go | 8 ++++---- cmd/storage/backend/nvme_controller.go | 4 ++-- cmd/storage/backend/nvme_path.go | 8 ++++---- cmd/storage/frontend/frontend.go | 12 ++++++------ cmd/storage/frontend/nvme_controller.go | 8 ++++---- cmd/storage/frontend/nvme_namespace.go | 4 ++-- cmd/storage/frontend/nvme_subsystem.go | 4 ++-- cmd/storage/frontend/virtio_blk.go | 4 ++-- cmd/storage/storage.go | 6 +++--- cmd/storage/test.go | 14 +++++++------- inventory/client_test.go | 4 ++-- main.go | 2 +- 20 files changed, 66 insertions(+), 66 deletions(-) diff --git a/cmd/inventory/inventory-get.go b/cmd/inventory/inventory-get.go index 52e43de..2fe1caf 100644 --- a/cmd/inventory/inventory-get.go +++ b/cmd/inventory/inventory-get.go @@ -23,7 +23,7 @@ func NewGetCommand() *cobra.Command { Aliases: []string{"g"}, Short: "Gets DPU inventory information", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { invClient, err := inventory.New(addr) if err != nil { log.Fatalf("could create gRPC client: %v", err) @@ -51,7 +51,7 @@ func NewInventoryCommand() *cobra.Command { Aliases: []string{"g"}, Short: "Tests inventory functionality", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(cmd *cobra.Command, _ []string) { err := cmd.Help() if err != nil { log.Fatalf("[ERROR] %s", err.Error()) diff --git a/cmd/ipsec/ipsec-stats.go b/cmd/ipsec/ipsec-stats.go index 5dd4ea1..a26e91b 100644 --- a/cmd/ipsec/ipsec-stats.go +++ b/cmd/ipsec/ipsec-stats.go @@ -22,7 +22,7 @@ func NewStatsCommand() *cobra.Command { Aliases: []string{"c"}, Short: "Queries ipsec statistics", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { res := ipsec.Stats(addr) fmt.Println(res) }, @@ -39,7 +39,7 @@ func NewIPSecCommand() *cobra.Command { Aliases: []string{"g"}, Short: "Tests ipsec functionality", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(cmd *cobra.Command, _ []string) { err := cmd.Help() if err != nil { log.Fatalf("[ERROR] %s", err.Error()) diff --git a/cmd/ipsec/ipsec-test.go b/cmd/ipsec/ipsec-test.go index fea8cb9..088c93e 100644 --- a/cmd/ipsec/ipsec-test.go +++ b/cmd/ipsec/ipsec-test.go @@ -22,7 +22,7 @@ func NewTestCommand() *cobra.Command { Aliases: []string{"c"}, Short: "Test ipsec functionality", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { res := ipsec.TestIpsec(addr, pingaddr) fmt.Println(res) }, diff --git a/cmd/network/evpn-bridge-port.go b/cmd/network/evpn-bridge-port.go index c4b3a51..7866123 100644 --- a/cmd/network/evpn-bridge-port.go +++ b/cmd/network/evpn-bridge-port.go @@ -26,7 +26,7 @@ func CreateBridgePort() *cobra.Command { Use: "create-bp", Short: "Create a bridge port", Long: "Create a BridgePort with the specified name, MAC address, type, and VLAN IDs", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewBridgePort(addr) if err != nil { @@ -57,7 +57,7 @@ func CreateBridgePort() *cobra.Command { } // Define allowed choices for the "type" Flag - err := cmd.RegisterFlagCompletionFunc("type", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + err := cmd.RegisterFlagCompletionFunc("type", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return []string{"access", "trunk"}, cobra.ShellCompDirectiveNoFileComp }) if err != nil { @@ -76,7 +76,7 @@ func DeleteBridgePort() *cobra.Command { Use: "delete-bp", Short: "Delete a bridge port", Long: "Delete a BridgePort with the specified name", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewBridgePort(addr) if err != nil { @@ -109,7 +109,7 @@ func GetBridgePort() *cobra.Command { Use: "get-bp", Short: "Show details of a bridge port", Long: "Show details of a BridgePort with the specified name", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewBridgePort(addr) if err != nil { @@ -145,7 +145,7 @@ func ListBridgePorts() *cobra.Command { cmd := &cobra.Command{ Use: "list-bps", Short: "Show details of all bridge ports", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewBridgePort(addr) if err != nil { @@ -190,7 +190,7 @@ func UpdateBridgePort() *cobra.Command { Use: "update-bp", Short: "Update the bridge port", Long: "updates the Bridge Port with updated mask", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewBridgePort(addr) if err != nil { diff --git a/cmd/network/evpn-logical-brige.go b/cmd/network/evpn-logical-brige.go index a8dd145..d76f32e 100644 --- a/cmd/network/evpn-logical-brige.go +++ b/cmd/network/evpn-logical-brige.go @@ -26,7 +26,7 @@ func CreateLogicalBridge() *cobra.Command { Use: "create-lb", Short: "Create a logical bridge", Long: "Create a logical bridge with the specified name, VLAN ID, and VNI", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewLogicalBridge(addr) if err != nil { @@ -75,7 +75,7 @@ func DeleteLogicalBridge() *cobra.Command { Use: "delete-lb", Short: "Delete a logical bridge", Long: "Delete a logical bridge with the specified name", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewLogicalBridge(addr) if err != nil { @@ -111,7 +111,7 @@ func GetLogicalBridge() *cobra.Command { Use: "get-lb", Short: "Show details of a logical bridge", Long: "Show details of a logical bridge with the specified name", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewLogicalBridge(addr) if err != nil { @@ -146,7 +146,7 @@ func ListLogicalBridges() *cobra.Command { cmd := &cobra.Command{ Use: "list-lbs", Short: "Show details of all logical bridges", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewLogicalBridge(addr) if err != nil { @@ -190,7 +190,7 @@ func UpdateLogicalBridge() *cobra.Command { cmd := &cobra.Command{ Use: "update-lb", Short: "update the logical bridge", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewLogicalBridge(addr) if err != nil { diff --git a/cmd/network/evpn-svi.go b/cmd/network/evpn-svi.go index 72ba608..b7ffa65 100644 --- a/cmd/network/evpn-svi.go +++ b/cmd/network/evpn-svi.go @@ -29,7 +29,7 @@ func CreateSVI() *cobra.Command { Use: "create-svi", Short: "Create a SVI", Long: "Create an using name, vrf,logical bridges, mac, gateway ip's and enable bgp ", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewSVI(addr) if err != nil { @@ -82,7 +82,7 @@ func DeleteSVI() *cobra.Command { cmd := &cobra.Command{ Use: "delete-svi", Short: "Delete a SVI", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewSVI(addr) if err != nil { @@ -117,7 +117,7 @@ func GetSVI() *cobra.Command { cmd := &cobra.Command{ Use: "get-svi", Short: "Show details of a SVI", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewSVI(addr) if err != nil { @@ -153,7 +153,7 @@ func ListSVIs() *cobra.Command { cmd := &cobra.Command{ Use: "list-svis", Short: "Show details of all SVIs", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewSVI(addr) if err != nil { @@ -199,7 +199,7 @@ func UpdateSVI() *cobra.Command { cmd := &cobra.Command{ Use: "update-svi", Short: "update the SVI", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewSVI(addr) if err != nil { diff --git a/cmd/network/evpn-test.go b/cmd/network/evpn-test.go index 93c99dd..9ca11dd 100644 --- a/cmd/network/evpn-test.go +++ b/cmd/network/evpn-test.go @@ -18,7 +18,7 @@ func NewEvpnCommand() *cobra.Command { Aliases: []string{"g"}, Short: "Tests DPU evpn functionality", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(cmd *cobra.Command, _ []string) { err := cmd.Help() if err != nil { log.Fatalf("[ERROR] %s", err.Error()) diff --git a/cmd/network/evpn-vrf.go b/cmd/network/evpn-vrf.go index ca6cc5a..98569e3 100644 --- a/cmd/network/evpn-vrf.go +++ b/cmd/network/evpn-vrf.go @@ -25,7 +25,7 @@ func CreateVRF() *cobra.Command { cmd := &cobra.Command{ Use: "create-vrf", Short: "Create a VRF", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewVRF(addr) if err != nil { @@ -67,7 +67,7 @@ func DeleteVRF() *cobra.Command { cmd := &cobra.Command{ Use: "delete-vrf", Short: "Delete a VRF", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewVRF(addr) if err != nil { @@ -99,7 +99,7 @@ func GetVRF() *cobra.Command { cmd := &cobra.Command{ Use: "get-vrf", Short: "Show details of a VRF", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewVRF(addr) if err != nil { @@ -135,7 +135,7 @@ func ListVRFs() *cobra.Command { cmd := &cobra.Command{ Use: "list-vrfs", Short: "Show details of all Vrfs", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewVRF(addr) if err != nil { @@ -179,7 +179,7 @@ func UpdateVRF() *cobra.Command { cmd := &cobra.Command{ Use: "update-vrf", Short: "update the VRF", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) evpnClient, err := network.NewVRF(addr) if err != nil { diff --git a/cmd/storage/backend/backend.go b/cmd/storage/backend/backend.go index 17f45c4..0df0d1f 100644 --- a/cmd/storage/backend/backend.go +++ b/cmd/storage/backend/backend.go @@ -13,7 +13,7 @@ func NewCreateCommand() *cobra.Command { Aliases: []string{"b"}, Short: "Creates backend resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -30,7 +30,7 @@ func newCreateNvmeCommand() *cobra.Command { Aliases: []string{"n"}, Short: "Creates nvme resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -49,7 +49,7 @@ func NewDeleteCommand() *cobra.Command { Aliases: []string{"b"}, Short: "Deletes backend resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -66,7 +66,7 @@ func newDeleteNvmeCommand() *cobra.Command { Aliases: []string{"n"}, Short: "Deletes nvme resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, diff --git a/cmd/storage/backend/nvme_controller.go b/cmd/storage/backend/nvme_controller.go index 2a71346..298c8a1 100644 --- a/cmd/storage/backend/nvme_controller.go +++ b/cmd/storage/backend/nvme_controller.go @@ -23,7 +23,7 @@ func newCreateNvmeControllerCommand() *cobra.Command { Aliases: []string{"c"}, Short: "Creates nvme controller representing an external nvme device", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) @@ -68,7 +68,7 @@ func newDeleteNvmeControllerCommand() *cobra.Command { Aliases: []string{"c"}, Short: "Deletes nvme controller representing an external nvme device", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) diff --git a/cmd/storage/backend/nvme_path.go b/cmd/storage/backend/nvme_path.go index 282ba4c..e0e44e2 100644 --- a/cmd/storage/backend/nvme_path.go +++ b/cmd/storage/backend/nvme_path.go @@ -19,7 +19,7 @@ func newCreateNvmePathCommand() *cobra.Command { Aliases: []string{"p"}, Short: "Creates nvme path to an external nvme device", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -43,7 +43,7 @@ func newCreateNvmePathTCPCommand() *cobra.Command { Aliases: []string{"t"}, Short: "Creates nvme path to a remote nvme TCP controller", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) @@ -87,7 +87,7 @@ func newCreateNvmePathPcieCommand() *cobra.Command { Aliases: []string{"p"}, Short: "Creates nvme path to PCIe controller", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) @@ -125,7 +125,7 @@ func newDeleteNvmePathCommand() *cobra.Command { Aliases: []string{"p"}, Short: "Deletes nvme path to an external nvme device", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) diff --git a/cmd/storage/frontend/frontend.go b/cmd/storage/frontend/frontend.go index a137a51..07ab893 100644 --- a/cmd/storage/frontend/frontend.go +++ b/cmd/storage/frontend/frontend.go @@ -13,7 +13,7 @@ func NewCreateCommand() *cobra.Command { Aliases: []string{"f"}, Short: "Creates frontend resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -31,7 +31,7 @@ func newCreateNvmeCommand() *cobra.Command { Aliases: []string{"n"}, Short: "Creates nvme resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -50,7 +50,7 @@ func newCreateVirtioCommand() *cobra.Command { Aliases: []string{"v"}, Short: "Creates virtio resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -68,7 +68,7 @@ func NewDeleteCommand() *cobra.Command { Aliases: []string{"f"}, Short: "Deletes frontend resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -86,7 +86,7 @@ func newDeleteNvmeCommand() *cobra.Command { Aliases: []string{"n"}, Short: "Deletes nvme resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -105,7 +105,7 @@ func newDeleteVirtioCommand() *cobra.Command { Aliases: []string{"v"}, Short: "Deletes virtio resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, diff --git a/cmd/storage/frontend/nvme_controller.go b/cmd/storage/frontend/nvme_controller.go index 12b3775..0b79a9e 100644 --- a/cmd/storage/frontend/nvme_controller.go +++ b/cmd/storage/frontend/nvme_controller.go @@ -19,7 +19,7 @@ func newCreateNvmeControllerCommand() *cobra.Command { Aliases: []string{"c"}, Short: "Creates nvme controller", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -41,7 +41,7 @@ func newCreateNvmeControllerTCPCommand() *cobra.Command { Aliases: []string{"t"}, Short: "Creates nvme TCP controller", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) @@ -84,7 +84,7 @@ func newCreateNvmeControllerPcieCommand() *cobra.Command { Aliases: []string{"p"}, Short: "Creates nvme PCIe controller", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) @@ -125,7 +125,7 @@ func newDeleteNvmeControllerCommand() *cobra.Command { Aliases: []string{"c"}, Short: "Deletes nvme controller", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) diff --git a/cmd/storage/frontend/nvme_namespace.go b/cmd/storage/frontend/nvme_namespace.go index bbd63a0..f581add 100644 --- a/cmd/storage/frontend/nvme_namespace.go +++ b/cmd/storage/frontend/nvme_namespace.go @@ -21,7 +21,7 @@ func newCreateNvmeNamespaceCommand() *cobra.Command { Aliases: []string{"n"}, Short: "Creates nvme namespace", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) @@ -59,7 +59,7 @@ func newDeleteNvmeNamespaceCommand() *cobra.Command { Aliases: []string{"d"}, Short: "Deletes nvme namespace", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) diff --git a/cmd/storage/frontend/nvme_subsystem.go b/cmd/storage/frontend/nvme_subsystem.go index 75553b7..0ea38b1 100644 --- a/cmd/storage/frontend/nvme_subsystem.go +++ b/cmd/storage/frontend/nvme_subsystem.go @@ -21,7 +21,7 @@ func newCreateNvmeSubsystemCommand() *cobra.Command { Aliases: []string{"s"}, Short: "Creates nvme subsystem", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) @@ -58,7 +58,7 @@ func newDeleteNvmeSubsystemCommand() *cobra.Command { Aliases: []string{"s"}, Short: "Deletes nvme subsystem", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) diff --git a/cmd/storage/frontend/virtio_blk.go b/cmd/storage/frontend/virtio_blk.go index cba80b6..b1abb7e 100644 --- a/cmd/storage/frontend/virtio_blk.go +++ b/cmd/storage/frontend/virtio_blk.go @@ -24,7 +24,7 @@ func newCreateVirtioBlkCommand() *cobra.Command { Aliases: []string{"b"}, Short: "Creates virtio-blk controller", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) @@ -66,7 +66,7 @@ func newDeleteVirtioBlkCommand() *cobra.Command { Aliases: []string{"b"}, Short: "Deletes virtio-blk controller", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { addr, err := c.Flags().GetString(common.AddrCmdLineArg) cobra.CheckErr(err) diff --git a/cmd/storage/storage.go b/cmd/storage/storage.go index dfc1ed3..c748762 100644 --- a/cmd/storage/storage.go +++ b/cmd/storage/storage.go @@ -20,7 +20,7 @@ func NewStorageCommand() *cobra.Command { Aliases: []string{"g"}, Short: "Tests storage functionality", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -43,7 +43,7 @@ func newStorageCreateCommand() *cobra.Command { Aliases: []string{"c"}, Short: "Creates resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, @@ -61,7 +61,7 @@ func newStorageDeleteCommand() *cobra.Command { Aliases: []string{"d"}, Short: "Deletes resource", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { err := c.Help() cobra.CheckErr(err) }, diff --git a/cmd/storage/test.go b/cmd/storage/test.go index 806356f..9148fb6 100644 --- a/cmd/storage/test.go +++ b/cmd/storage/test.go @@ -35,7 +35,7 @@ func newStorageTestCommand() *cobra.Command { Aliases: []string{"s"}, Short: "Test storage functionality", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { runTests( c, allStoragePartitions, @@ -56,7 +56,7 @@ func newStorageTestFrontendCommand() *cobra.Command { Use: string(storagePartitionFrontend), Short: "Tests storage frontend API", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { runTests( c, []storagePartition{storagePartitionFrontend}, @@ -69,7 +69,7 @@ func newStorageTestFrontendCommand() *cobra.Command { Use: "nvme", Short: "Tests storage frontend nvme API", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { runTests( c, []storagePartition{storagePartitionFrontend}, @@ -81,7 +81,7 @@ func newStorageTestFrontendCommand() *cobra.Command { Use: "virtio-blk", Short: "Tests storage frontend virtio-blk API", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { runTests( c, []storagePartition{storagePartitionFrontend}, @@ -93,7 +93,7 @@ func newStorageTestFrontendCommand() *cobra.Command { Use: "scsi", Short: "Tests storage frontend scsi API", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { runTests( c, []storagePartition{storagePartitionFrontend}, @@ -110,7 +110,7 @@ func newStorageTestBackendCommand() *cobra.Command { Use: string(storagePartitionBackend), Short: "Tests storage backend API", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { runTests( c, []storagePartition{storagePartitionBackend}, @@ -127,7 +127,7 @@ func newStorageTestMiddleendCommand() *cobra.Command { Use: string(storagePartitionMiddleend), Short: "Tests storage middleend API", Args: cobra.NoArgs, - Run: func(c *cobra.Command, args []string) { + Run: func(c *cobra.Command, _ []string) { runTests( c, []storagePartition{storagePartitionMiddleend}, diff --git a/inventory/client_test.go b/inventory/client_test.go index 19b5d39..e712d3b 100644 --- a/inventory/client_test.go +++ b/inventory/client_test.go @@ -65,7 +65,7 @@ var _ = Describe("Inventory", func() { Context("and the getter is valid", func() { BeforeEach(func() { - g = func(c grpc.ClientConnInterface) pb.InventoryServiceClient { + g = func(_ grpc.ClientConnInterface) pb.InventoryServiceClient { return &mocks.InventorySvcClient{} } c, err = inventory.NewWithArgs(m, g) @@ -101,7 +101,7 @@ var _ = Describe("Inventory", func() { Context("and the getter is valid", func() { BeforeEach(func() { - g = func(c grpc.ClientConnInterface) pb.InventoryServiceClient { + g = func(_ grpc.ClientConnInterface) pb.InventoryServiceClient { return &mocks.InventorySvcClient{} } c, err = inventory.NewWithArgs(m, g) diff --git a/main.go b/main.go index d060cb3..9711cfb 100644 --- a/main.go +++ b/main.go @@ -30,7 +30,7 @@ func newCommand() *cobra.Command { c := &cobra.Command{ Use: "godpu", Short: "godpu - DPUs and IPUs cli commands", - Run: func(cmd *cobra.Command, args []string) { + Run: func(cmd *cobra.Command, _ []string) { err := cmd.Help() if err != nil { log.Fatalf("[ERROR] %s", err.Error())