Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Govet verification fails with possible nil pointer issue #116

Closed
Madhan-SWE opened this issue Feb 15, 2022 · 1 comment · Fixed by #117
Closed

Govet verification fails with possible nil pointer issue #116

Madhan-SWE opened this issue Feb 15, 2022 · 1 comment · Fixed by #117
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@Madhan-SWE
Copy link

/kind bug

What happened?
Govet verification fails with possible nil pointer issue

madhankumar@MADHANKUMARs-MacBook-Pro ibm-powervs-block-csi-driver % make verify
echo "Installing golangci-lint..."
Installing golangci-lint...
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.43.0
golangci/golangci-lint info checking GitHub for tag 'v1.43.0'
golangci/golangci-lint info found version: 1.43.0 for v1.43.0/darwin/amd64
golangci/golangci-lint info installed ./bin/golangci-lint

### verify-vendor:
Repo uses 'go mod'.
+ env GO111MODULE=on go mod tidy
Go dependencies up-to-date.
echo "verifying and linting files ..."
verifying and linting files ...
./hack/verify-all
Verifying gofmt
No issue found
Verifying govet
Done
pkg/driver/node.go:386:62: SA5011: possible nil pointer dereference (staticcheck)
	klog.V(4).Infof("NodeGetVolumeStats: called with args %+v", *req)
	                                                            ^
pkg/driver/node.go:389:5: SA5011(related information): this check suggests that the pointer can be nil (staticcheck)
	if req == nil || req.VolumeId == "" {
	   ^
make: *** [verify] Error 1
madhankumar@MADHANKUMARs-MacBook-Pro ibm-powervs-block-csi-driver % 

What you expected to happen?
Don't have to check if req is nil as its passed from provisioner and will not be nil.

How to reproduce it (as minimally and precisely as possible)?
Run make verify on the repo.

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 15, 2022
@Madhan-SWE
Copy link
Author

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants