-
Notifications
You must be signed in to change notification settings - Fork 108
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
Goreportcard fixes #121
Goreportcard fixes #121
Conversation
Hi @fatih. When you have some free time, do you mind reviewing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
Thanks for the review @nanzhong. Do you have permissions to merge? If so, please do merge this PR. |
Nope 😢, I'll go get some and merge this. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vaskoz
Can you please resolve one of the comments and squash all your changes in a single commit?
driver/controller.go
Outdated
GB | ||
// TB is a Tebibyte https://en.wikipedia.org/wiki/Tebibyte. | ||
TB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not needed and makes it hard to read. Can you please remove these comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fatih I can definitely remove those comments, however, golint
will still complain about those since they're exported. They appear in the GoReportCard as Line 37: warning: exported const KB should have comment (or a comment on this block) or be unexported (golint)
and so on for the rest. https://goreportcard.com/report/github.com/digitalocean/csi-digitalocean#golint
The goal of this cosmetic PR is just to achieve 100% on all GoReportCard categories except gocyclo
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All commits squashed into a single commit.
- gofmt -s -w simplifies some code - add godoc to exported constants - fix typo in DeleteSnapshot godoc - golint: if block ends with a return statement, so drop this else and outdent its block - add a space between comment block and godoc block - in integration test return error if namespace cannot be created - fix typo 'occured' to 'occurred'
GB | ||
TB | ||
_ = iota | ||
kiB = 1 << (10 * iota) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative is to un-export these constants since they're not used outside of this package anyway. I added a commit to that effect.
If you prefer the exported constants without godoc, just let me know and I'll make that change.
Thanks @vaskoz for the contribution, much appreciated :) |
* Cherry-pick: Add tagging support for Volumes via the new `--do-tag` flag [[GH-130]](#130) * Cherry-pick: Fix support for volume snapshots by setting snapshot id on volume creation [[GH-129]](#129) * Cherry-pick: Goreportcard fixes (typos, exported variables, etc..) [[GH-121]](#121) * Cherry-pick: Rename the cluster role bindings for the `node-driver-registrar` to be consistent with the other role bindings. [[GH-118]](#118) * Cherry-pick: Remove the `--token` flag for the `csi-do-node` driver. Drivers running on the node don't need the token anymore. [[GH-118]](#118) * Cherry-pick: Don't check the volume limits on the worker nodes (worker nodes are not able to talk to DigitalOcean API) [[GH-142]](#142) * Cherry-pick: Update `godo` (DigitalOcean API package) version to v1.13.0 [[GH-143]](#143) * Cherry-pick: Fix race in snapshot integration test. [[GH-146]](#146) * Cherry-pick: Add tagging support for Volume snapshots via the new `--do-tag` flag [[GH-145]](#145)
* Cherry-pick: Add tagging support for Volumes via the new `--do-tag` flag [[GH-130]](#130) * Cherry-pick: Fix support for volume snapshots by setting snapshot id on volume creation [[GH-129]](#129) * Cherry-pick: Goreportcard fixes (typos, exported variables, etc..) [[GH-121]](#121) * Cherry-pick: Rename the cluster role bindings for the `node-driver-registrar` to be consistent with the other role bindings. [[GH-118]](#118) * Cherry-pick: Remove the `--token` flag for the `csi-do-node` driver. Drivers running on the node don't need the token anymore. [[GH-118]](#118) * Cherry-pick: Don't check the volume limits on the worker nodes (worker nodes are not able to talk to DigitalOcean API) [[GH-142]](#142) * Cherry-pick: Update `godo` (DigitalOcean API package) version to v1.13.0 [[GH-143]](#143) * Cherry-pick: Fix race in snapshot integration test. [[GH-146]](#146) * Cherry-pick: Add tagging support for Volume snapshots via the new `--do-tag` flag [[GH-145]](#145)
Some simple fixes identified by https://goreportcard.com/report/github.com/digitalocean/csi-digitalocean .
Everything but the gocyclo issues should be fixed by this PR.