ZeStream / zestream-server

an open-sourced alternative to cloudinary [video streaming done ✅, image/audio under dev 🔨 ]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exit inside non-main function

uzaxirr opened this issue · comments

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

I want to work on this

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

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