Skip to content

Commit

Permalink
refactor: unused args names to underscores
Browse files Browse the repository at this point in the history
Signed-off-by: Artsiom Koltun <[email protected]>
  • Loading branch information
artek-koltun authored and sandersms committed Feb 13, 2024
1 parent 86b40eb commit 3e3e7eb
Show file tree
Hide file tree
Showing 20 changed files with 66 additions and 66 deletions.
4 changes: 2 additions & 2 deletions cmd/inventory/inventory-get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions cmd/ipsec/ipsec-stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipsec/ipsec-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
12 changes: 6 additions & 6 deletions cmd/network/evpn-bridge-port.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions cmd/network/evpn-logical-brige.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions cmd/network/evpn-svi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/network/evpn-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
10 changes: 5 additions & 5 deletions cmd/network/evpn-vrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions cmd/storage/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand All @@ -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)
},
Expand All @@ -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)
},
Expand All @@ -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)
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/storage/backend/nvme_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions cmd/storage/backend/nvme_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand All @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions cmd/storage/frontend/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand All @@ -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)
},
Expand All @@ -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)
},
Expand All @@ -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)
},
Expand All @@ -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)
},
Expand All @@ -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)
},
Expand Down
Loading

0 comments on commit 3e3e7eb

Please sign in to comment.