Skip to content

Conversation

leofleeo
Copy link
Contributor

@leofleeo leofleeo commented Jul 4, 2025

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)

@rmartinoscar
Copy link
Member

Will you also change all the remaining panic calls ?

@leofleeo
Copy link
Contributor Author

leofleeo commented Jul 5, 2025

Will you also change all the remaining panic calls ?

Yes, I will, I was just done for the day, that's why it's still a draft

@leofleeo leofleeo changed the title Fix unidiomatic error handling and unchecked errors Fix unidiomatic error handling, unchecked errors, and other unidiomatic code Jul 23, 2025
@leofleeo
Copy link
Contributor Author

This PR will now also fix code issues brought to my attention by golangci-lint

Copy link
Member

@rmartinoscar rmartinoscar left a 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

@leofleeo
Copy link
Contributor Author

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.

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.

2 participants