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

Adjust vet and gosec complaints #548

Merged
merged 3 commits into from
Feb 8, 2023

Conversation

dataclouder
Copy link
Contributor

@dataclouder dataclouder commented Feb 6, 2023

The command make vet was running without tags, and therefore it was ignoring most of the test files.
After adding -tags ALL, some complains appeared that are addressed here.

  • Makefile
  • govcd/access_control_catalog_test.go
  • govcd/access_control_vapp_test.go
  • govcd/catalog_test.go
  • govcd/common_test.go
  • govcd/external_network_v2_test.go
  • govcd/nsxt_firewall_group_dynamic_security_group_test.go

The latest version of gosec (2.15 released today) raises several security complaints related to unsafe usage of defer. Such usages are fixed in this PR.

  • govcd/api_vcd.go
  • govcd/catalog.go
  • govcd/media.go
  • govcd/nsxt_importable_switch.go

Furthermore, the installation of gosec in the Github Actions worker sometimes fails with unclear errors. To help understanding the issue, we have added more debugging information to scripts/gosec.sh.

Giuseppe Maxia added 2 commits February 6, 2023 20:40
Fix complaints for test files that were previously unchecked

Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
@dataclouder dataclouder marked this pull request as ready for review February 6, 2023 20:13
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dataclouder dataclouder requested a review from adezxc February 7, 2023 07:40
Copy link
Collaborator

@adambarreiro adambarreiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements!

Copy link

@adezxc adezxc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Thanks!

@dataclouder dataclouder merged commit 7ee3d7e into vmware:main Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants