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

Exit inside non-main function #40

Closed
uzaxirr opened this issue Jan 3, 2023 · 4 comments · Fixed by #56
Closed

Exit inside non-main function #40

uzaxirr opened this issue Jan 3, 2023 · 4 comments · Fixed by #56
Assignees
Labels
good first issue Good for newcomers

Comments

@uzaxirr
Copy link
Member

uzaxirr commented Jan 3, 2023

Description

Packages exposing functions that can stop program execution by exiting are hard to reuse. Program exits in functions other than main() or init() are not encouraged.

Occurrences

There are 4 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/ZeStream/zestream-server/issue/RVV-A0003/occurrences/

Screenshot 2023-01-03 at 10 35 00 AM

Solution

calls to log.Fatal should be only in main() or init() functions. So a possible solution for this could be replacing log.Fatal with an Error log level

@uzaxirr uzaxirr added the good first issue Good for newcomers label Jan 3, 2023
@uzaxirr uzaxirr changed the title (RVV-A0003) Exit inside non-main function Exit inside non-main function Jan 3, 2023
@Missing-Parallax
Copy link

I want to work on this

@akshat2602
Copy link
Contributor

Hey @Missing-Parallax are you still working on this? If not I'd like to pick this up :)

@Missing-Parallax
Copy link

Missing-Parallax commented Jan 7, 2023 via email

@uzaxirr
Copy link
Member Author

uzaxirr commented Jan 7, 2023

Hey @akshat2602
I've assigned the issue to you!

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

Successfully merging a pull request may close this issue.

3 participants