-
Notifications
You must be signed in to change notification settings - Fork 21
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
Handling imports #28
Comments
@eastcoast97 golang does not have try catch. Can you point to lines of code so we can see how we can potentially improve. |
Hi Sammy,
Re: api.go
Yup figured after trying to change it and came up with some ideas. Thought I would wait for your message meanwhile.
Instead of directly printing error messages, consider using a logging library to log errors with appropriate severity levels.// insde bigbang block, line number 34.
Instead of hardcoding values, we can define constants for things like timeouts, URLs, and regular expressions. This makes the code more readable and maintainable.
Like,
const (
timeoutSeconds = 10
checkInterval = 100 * time.Millisecond
dreamlandURL = http:// + common.DreamlandApiListen
)
One more suggestion I had,
We can Implement a shutdown mechanism for the HTTP server to allow it to finish processing ongoing requests before shutting down. There should be a method available in httpserver module to shut the process.
From: Samy Fodil ***@***.***>
Date: Wednesday, September 20, 2023 at 12:13 AM
To: taubyte/dreamland ***@***.***>
Cc: Achuthan Ram ***@***.***>, Mention ***@***.***>
Subject: Re: [taubyte/dreamland] Handling imports (Issue #28)
@eastcoast97<https://github.com/eastcoast97> golang does not have try catch. Can you point to lines of code so we can see how we can potentially improve.
—
Reply to this email directly, view it on GitHub<#28 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVZKCRHWAGMZB6RN74JOZETX3JUPRANCNFSM6AAAAAA4VFTLNU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey guys, I'm not experienced in Go, but have a great experience programming in general.
I was investigating api.go file and have a suggestion related to the imports that can be handled better with a simple try catch.
It would be easy to print which package is dealing failing to import locally(cause: versioning, updates, path, broken)
Apart from that, I really enjoyed playing with the app. Great invention!
The text was updated successfully, but these errors were encountered: