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

ecs-gpu-init: Fix go lint #4027

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Conversation

yeazelm
Copy link
Contributor

@yeazelm yeazelm commented Jun 4, 2024

Description of changes:
The new lint rules for Go want us to check the return code. For this defer its not super useful, but we can still emit a log entry on shutdown just in case things go poorly.

Testing done:
cargo make check-golangci-lint now passes. It used to say:

 Running [/home/runner/golangci-lint-1.59.0-linux-amd64/golangci-lint run --path-prefix=sources/ecs-gpu-init] in [/home/runner/work/bottlerocket/bottlerocket/sources/ecs-gpu-init] ...
  Error: sources/ecs-gpu-init/cmd/ecs-gpu-init/main.go:28:21: Error return value is not checked (errcheck)
  	defer nvml.Shutdown()
  	                   ^
  
  Error: issues found

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

This checks the value of the nvml Shutdown() call and emits an entry on
failure to fix the Go lint for unchecked returns.

Signed-off-by: Matthew Yeazel <yeazelm@amazon.com>
@yeazelm yeazelm merged commit 592d46b into bottlerocket-os:develop Jun 4, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants