-
Notifications
You must be signed in to change notification settings - Fork 46
Fix unidiomatic error handling, unchecked errors, and other unidiomatic code #113
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
base: main
Are you sure you want to change the base?
Conversation
Will you also change all the remaining |
Yes, I will, I was just done for the day, that's why it's still a draft |
This PR will now also fix code issues brought to my attention by golangci-lint |
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.
I don’t see any use in exporting test specific function thus i think we should revert 74abfc1
The function was already exported and used in different areas of the code I believe. One of the types it returned was not exported, and in go, it is always good practice to have all return types of an exported function be exported as well so if other packages use the function they can actually make use of the data that was returned. |
Check errors that are unchecked, and remove calls to panic. According to go documentation, panic should NOT be used in production. https://go.dev/doc/effective_go#panic (this same bad error handling is present in pterodactyl, and the commits where it was introduced are originally from pterodactyl, this is not pelican's fault)