Skip to content

Commit 505a5a2

Browse files
fix: unexport global commands slice
Signed-off-by: Xeckt <jordansavell1198@gmail.com>
1 parent d409fb5 commit 505a5a2

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

sztp-agent/cmd/cli.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/spf13/cobra"
99
)
1010

11-
// Commands hold a slice of all cobra commands for cli tool
12-
var Commands []*cobra.Command
11+
// commands hold a slice of all cobra commands for cli tool
12+
var commands []*cobra.Command
1313

1414
// RootCmd is the main entrypoint for the cli
1515
func RootCmd() *cobra.Command {
@@ -25,7 +25,7 @@ func RootCmd() *cobra.Command {
2525
},
2626
}
2727

28-
for _, cmd := range Commands {
28+
for _, cmd := range commands {
2929
c.AddCommand(cmd)
3030
}
3131

sztp-agent/cmd/daemon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
//nolint:gochecknoinits
2121
func init() {
22-
Commands = append(Commands, Daemon())
22+
commands = append(commands, Daemon())
2323
}
2424

2525
// Daemon returns the daemon command
@@ -37,7 +37,7 @@ func Daemon() *cobra.Command {
3737
cmd := &cobra.Command{
3838
Use: "daemon",
3939
Short: "Run the daemon command",
40-
RunE: func(c *cobra.Command, _ []string) error {
40+
RunE: func(_ *cobra.Command, _ []string) error {
4141
arrayChecker := []string{devicePrivateKey, deviceEndEntityCert, bootstrapTrustAnchorCert}
4242
if bootstrapURL != "" && dhcpLeaseFile != "" {
4343
return fmt.Errorf("'--bootstrap-url' and '--dhcp-lease-file' are mutualy exclusive")

sztp-agent/cmd/disable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
//nolint:gochecknoinits
1717
func init() {
18-
Commands = append(Commands, Disable())
18+
commands = append(commands, Disable())
1919
}
2020

2121
// Disable returns the disable command

sztp-agent/cmd/enable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
//nolint:gochecknoinits
1717
func init() {
18-
Commands = append(Commands, Enable())
18+
commands = append(commands, Enable())
1919
}
2020

2121
// Enable returns the enable command

sztp-agent/cmd/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
//nolint:gochecknoinits
1717
func init() {
18-
Commands = append(Commands, Run())
18+
commands = append(commands, Run())
1919
}
2020

2121
// Run returns the run command

sztp-agent/cmd/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
//nolint:gochecknoinits
1717
func init() {
18-
Commands = append(Commands, Status())
18+
commands = append(commands, Status())
1919
}
2020

2121
// Status returns the status command

0 commit comments

Comments
 (0)