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

error: consider errno as a return value #332

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

geyslan
Copy link
Member

@geyslan geyslan commented Jun 2, 2023

CGo provide us a way to get errno value from C code as a return value, so it's always a good idea to make use of it.

CGo provide us a way to get errno value from C code as a return value,
so it's always a good idea to make use of it.
@geyslan geyslan self-assigned this Jun 2, 2023
@geyslan geyslan added the chore label Jun 2, 2023
@geyslan geyslan merged commit 1be18b3 into aquasecurity:main Jun 2, 2023
@geyslan geyslan deleted the ret-errno branch June 3, 2023 11:06
if numCPUs < 0 {
return 0, fmt.Errorf("failed to retrieve the number of CPUs")
return 0, fmt.Errorf("failed to retrieve the number of CPUs: %w", errC)
Copy link
Contributor

Choose a reason for hiding this comment

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

Was just gonna do this, you were faster than me 😄. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants