mactsouk / mGo4th

Source code for Mastering Go, 4th edition.
MIT License
41 stars 30 forks source link

Return empty string in case of error #5

Closed rgerardi closed 1 year ago

rgerardi commented 1 year ago

It's not considered a good practice to return the value when err is not nil. In this case since the error comes from the previous function call, it's better to return it without the string value since it will be handled and main.