Replies: 3 comments 1 reply
-
I did a six-minute review of the code. Not enough to call it a code review. I really like what you have so far and have starred the repo. I shall try to review it more carefully when I have time. Well done! |
Beta Was this translation helpful? Give feedback.
1 reply
-
I will start with error handling.
Because Go is a 3GL implementation language, programming patterns are a
part of your mind and not part of the language.
Errors may be:
- Handled by the program
- Reported to the User if it is a User Error
- Reported to the Dev if it is an unexpected error.
It is the third item that you may want to improve upon.
If you wrap your app with a defer recover that not only creates a log file
but also sends an email to you with the contents of the log file after the
User gives permission, you will then be notified of errors in the field
that we may never think of on our own and that would allow you to harden
your app. Instead of sending an email, you could instead have it make an
RPC to an AppEngine microservice that logs the error for you. How you
decide to implement this class of errors is entirely up to you. In this
small project, you may think it overkills but this can be your personal dev
solution for your applications and having it tested here, you can then
easily include it in your future projects to identify errors that need to
be either handled or reported. ErrorHandling in Go is a hot topic and not
everyone agrees with me, you must decide for yourself what is best for you
and your stakeholders.
…On Mon, Mar 29, 2021 at 12:41 AM drodil ***@***.***> wrote:
Thanks a lot @comaldave <https://github.com/comaldave> ! I have not done
so much golang (none professionally tbh) so there is probably something to
improve on. I am happy to get some pointers from more experienced golang
devs about error handling, design, logging, mocking and other things so
waiting for your input. Thanks once again!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAYCWF2H5V35J43X2MGU5DTGAOIPANCNFSM4ZS2SRPA>
.
--
David Lynn Skinner
Secretary, Davsk Ltd Co
1-501-436-9086
| 1-870-617-2770
***@***.***
| https://blog.davsk.net
650 S 5th St Apt 88 Arkadelphia AR 71923
<https://maps.google.com/?q=650+S+5th+St+Apt+88+Arkadelphia+AR++71923>
1-501-201-0414
<http://stackoverflow.com/users/3886366/david-skinner>
<http://github.com/ComalDave/> <http://facebook.com/david.lynn.skinner/>
<http://www.instagram.com/david.lynn.skinner/>
<http://www.linkedin.com/in/david-l-skinner/>
<http://twitter.com/SkinnerDavidL> <http://youtube.com/c/DavidSkinnerDavsk>
<http://www.pinterest.com/skinnerdavid/>
Create your own email signature
<https://www.wisestamp.com/create-own-signature/?utm_source=promotion&utm_medium=signature&utm_campaign=create_your_own&srcid=>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
https://www.practical-go-lessons.com/chap-23-errors
- errors are eliminated by tests.
- faults happen at runtime through no fault of the user, these we blame
on the programmer not validating data or not reading the docs of the API
- failures happen at runtime when the program is unable to achieve the
desired result through no error of the programmer or user. eg: NIC card
loses connection, your program fails gracefully telling the user to try
again when the connection has been restored.
- mistakes are User errors that must be reported and provisioned for the
user to recover.
On Mon, Mar 29, 2021 at 12:57 PM David Skinner ***@***.***>
wrote:
… I will start with error handling.
Because Go is a 3GL implementation language, programming patterns are a
part of your mind and not part of the language.
Errors may be:
- Handled by the program
- Reported to the User if it is a User Error
- Reported to the Dev if it is an unexpected error.
It is the third item that you may want to improve upon.
If you wrap your app with a defer recover that not only creates a log file
but also sends an email to you with the contents of the log file after the
User gives permission, you will then be notified of errors in the field
that we may never think of on our own and that would allow you to harden
your app. Instead of sending an email, you could instead have it make an
RPC to an AppEngine microservice that logs the error for you. How you
decide to implement this class of errors is entirely up to you. In this
small project, you may think it overkills but this can be your personal dev
solution for your applications and having it tested here, you can then
easily include it in your future projects to identify errors that need to
be either handled or reported. ErrorHandling in Go is a hot topic and not
everyone agrees with me, you must decide for yourself what is best for you
and your stakeholders.
On Mon, Mar 29, 2021 at 12:41 AM drodil ***@***.***> wrote:
> Thanks a lot @comaldave <https://github.com/comaldave> ! I have not done
> so much golang (none professionally tbh) so there is probably something to
> improve on. I am happy to get some pointers from more experienced golang
> devs about error handling, design, logging, mocking and other things so
> waiting for your input. Thanks once again!
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#16 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAAYCWF2H5V35J43X2MGU5DTGAOIPANCNFSM4ZS2SRPA>
> .
>
--
David Lynn Skinner
Secretary, Davsk Ltd Co
1-501-436-9086
| 1-870-617-2770
***@***.***
| https://blog.davsk.net
650 S 5th St Apt 88 Arkadelphia AR 71923
<https://maps.google.com/?q=650+S+5th+St+Apt+88+Arkadelphia+AR++71923>
1-501-201-0414
<http://stackoverflow.com/users/3886366/david-skinner>
<http://github.com/ComalDave/> <http://facebook.com/david.lynn.skinner/>
<http://www.instagram.com/david.lynn.skinner/>
<http://www.linkedin.com/in/david-l-skinner/>
<http://twitter.com/SkinnerDavidL>
<http://youtube.com/c/DavidSkinnerDavsk>
<http://www.pinterest.com/skinnerdavid/>
Create your own email signature
<https://www.wisestamp.com/create-own-signature/?utm_source=promotion&utm_medium=signature&utm_campaign=create_your_own&srcid=>
--
David Lynn Skinner
Secretary, Davsk Ltd Co
1-501-436-9086
| 1-870-617-2770
***@***.***
| https://blog.davsk.net
650 S 5th St Apt 88 Arkadelphia AR 71923
<https://maps.google.com/?q=650+S+5th+St+Apt+88+Arkadelphia+AR++71923>
1-501-201-0414
<http://stackoverflow.com/users/3886366/david-skinner>
<http://github.com/ComalDave/> <http://facebook.com/david.lynn.skinner/>
<http://www.instagram.com/david.lynn.skinner/>
<http://www.linkedin.com/in/david-l-skinner/>
<http://twitter.com/SkinnerDavidL> <http://youtube.com/c/DavidSkinnerDavsk>
<http://www.pinterest.com/skinnerdavid/>
Create your own email signature
<https://www.wisestamp.com/create-own-signature/?utm_source=promotion&utm_medium=signature&utm_campaign=create_your_own&srcid=>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Please provide me some general feedback of the tool to this discussion. If it's a new feature you would like to see or bug you found, please use either new discussion or submit an issue. Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions