Skip to content

Commit

Permalink
fix: linter issue
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Jun 11, 2024
1 parent 56e79cd commit b95621e
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 10 deletions.
4 changes: 3 additions & 1 deletion sztp-agent/cmd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ func NewDaemonCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "daemon",
Short: "Run the daemon command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {
err := c.Help()
cobra.CheckErr(err)
a := secureagent.NewAgent(bootstrapURL, serialNumber, dhcpLeaseFile, devicePassword, devicePrivateKey, deviceEndEntityCert, bootstrapTrustAnchorCert)
return a.RunCommandDaemon()
},
Expand Down
4 changes: 3 additions & 1 deletion sztp-agent/cmd/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func TestNewDaemonCommand(t *testing.T) {
want: &cobra.Command{
Use: "daemon",
Short: "Run the daemon command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {

Check failure on line 24 in sztp-agent/cmd/daemon_test.go

View workflow job for this annotation

GitHub Actions / golangci

unused-parameter: parameter 'args' seems to be unused, consider removing or renaming it as _ (revive)
err := c.Help()
cobra.CheckErr(err)
return nil
},
},
Expand Down
4 changes: 3 additions & 1 deletion sztp-agent/cmd/disable.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func NewDisableCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "disable",
Short: "Run the disable command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {
err := c.Help()
cobra.CheckErr(err)
a := secureagent.NewAgent(bootstrapURL, serialNumber, dhcpLeaseFile, devicePassword, devicePrivateKey, deviceEndEntityCert, bootstrapTrustAnchorCert)
return a.RunCommandDisable()
},
Expand Down
4 changes: 3 additions & 1 deletion sztp-agent/cmd/disable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func TestNewDisableCommand(t *testing.T) {
want: &cobra.Command{
Use: "disable",
Short: "Run the disable command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {
err := c.Help()
cobra.CheckErr(err)
return nil
},
},
Expand Down
4 changes: 3 additions & 1 deletion sztp-agent/cmd/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func NewEnableCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "enable",
Short: "Run the enable command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {

Check failure on line 31 in sztp-agent/cmd/enable.go

View workflow job for this annotation

GitHub Actions / golangci

unused-parameter: parameter 'args' seems to be unused, consider removing or renaming it as _ (revive)
err := c.Help()
cobra.CheckErr(err)
a := secureagent.NewAgent(bootstrapURL, serialNumber, dhcpLeaseFile, devicePassword, devicePrivateKey, deviceEndEntityCert, bootstrapTrustAnchorCert)
return a.RunCommandEnable()
},
Expand Down
4 changes: 3 additions & 1 deletion sztp-agent/cmd/enable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func TestNewEnableCommand(t *testing.T) {
want: &cobra.Command{
Use: "enable",
Short: "Run the enable command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {
err := c.Help()
cobra.CheckErr(err)
return nil
},
},
Expand Down
4 changes: 3 additions & 1 deletion sztp-agent/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func NewRunCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "run",
Short: "Exec the run command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {

Check failure on line 31 in sztp-agent/cmd/run.go

View workflow job for this annotation

GitHub Actions / golangci

unused-parameter: parameter 'args' seems to be unused, consider removing or renaming it as _ (revive)
err := c.Help()
cobra.CheckErr(err)
a := secureagent.NewAgent(bootstrapURL, serialNumber, dhcpLeaseFile, devicePassword, devicePrivateKey, deviceEndEntityCert, bootstrapTrustAnchorCert)
return a.RunCommand()
},
Expand Down
4 changes: 3 additions & 1 deletion sztp-agent/cmd/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func TestNewRunCommand(t *testing.T) {
want: &cobra.Command{
Use: "run",
Short: "Exec the run command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {
err := c.Help()
cobra.CheckErr(err)
return nil
},
},
Expand Down
4 changes: 3 additions & 1 deletion sztp-agent/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func NewStatusCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "status",
Short: "Run the status command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {
err := c.Help()
cobra.CheckErr(err)
a := secureagent.NewAgent(bootstrapURL, serialNumber, dhcpLeaseFile, devicePassword, devicePrivateKey, deviceEndEntityCert, bootstrapTrustAnchorCert)
return a.RunCommandStatus()
},
Expand Down
4 changes: 3 additions & 1 deletion sztp-agent/cmd/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func TestNewStatusCommand(t *testing.T) {
want: &cobra.Command{
Use: "status",
Short: "Run the status command",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(c *cobra.Command, args []string) error {

Check failure on line 24 in sztp-agent/cmd/status_test.go

View workflow job for this annotation

GitHub Actions / golangci

unused-parameter: parameter 'args' seems to be unused, consider removing or renaming it as _ (revive)
err := c.Help()
cobra.CheckErr(err)
return nil
},
},
Expand Down

0 comments on commit b95621e

Please sign in to comment.