Skip to content

Commit

Permalink
fix: golangci-lint errors fixed
Browse files Browse the repository at this point in the history
Signed-off-by: James Lu <jamesluhz@gmail.com>
  • Loading branch information
mantissahz committed May 24, 2024
1 parent c25aee2 commit 39706c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ var (
DefaultDeletionRetryCount = pvController.DefaultFailedDeleteThreshold
)

func cmdNotFound(c *cli.Context, command string) {
func cmdNotFound(_ *cli.Context, command string) {
panic(fmt.Errorf("Unrecognized command: %s", command))
}

func onUsageError(c *cli.Context, err error, isSubcommand bool) error {
panic(fmt.Errorf("Usage error, please check your command"))
func onUsageError(_ *cli.Context, err error, _ bool) error {
panic(errors.Wrap(err, "Usage error, please check your command"))
}

func RegisterShutdownChannel(cancelFn context.CancelFunc) {
Expand Down
4 changes: 2 additions & 2 deletions provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (p *LocalPathProvisioner) pickConfig(storageClassName string) (*StorageClas
return &cfg, nil
}

func (p *LocalPathProvisioner) Provision(ctx context.Context, opts pvController.ProvisionOptions) (*v1.PersistentVolume, pvController.ProvisioningState, error) {
func (p *LocalPathProvisioner) Provision(_ context.Context, opts pvController.ProvisionOptions) (*v1.PersistentVolume, pvController.ProvisioningState, error) {
cfg, err := p.pickConfig(opts.StorageClass.Name)
if err != nil {
return nil, pvController.ProvisioningFinished, err
Expand Down Expand Up @@ -401,7 +401,7 @@ func (p *LocalPathProvisioner) provisionFor(opts pvController.ProvisionOptions,
}, pvController.ProvisioningFinished, nil
}

func (p *LocalPathProvisioner) Delete(ctx context.Context, pv *v1.PersistentVolume) (err error) {
func (p *LocalPathProvisioner) Delete(_ context.Context, pv *v1.PersistentVolume) (err error) {
cfg, err := p.pickConfig(pv.Spec.StorageClassName)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions test/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
)

func createCmd(t *testing.T, cmd, kustomizeDir string, envs []string, callback func(*exec.Cmd)) *exec.Cmd {
t.Logf("creating command: %s", cmd)
c := exec.Command("bash", "-c", cmd)
c.Env = append(os.Environ(), envs...)
c.Dir = kustomizeDir
Expand Down

0 comments on commit 39706c2

Please sign in to comment.