Errors in go discussion


(Gudjo) #1

any advice for errors in go, some articles or smth.
should i make my own errors for everything or what?


(George Calianu) #2

Surely you must handle your errors but what specifically concern you?


(Gudjo) #3

should i create my own error struct or just with errors.New() or


(George Calianu) #4

Depends of your projects, isn’t a standard rule. Probably for mostly small projects an advanced error handling system could be overkill. On the other hand could be situation when a simple api need to return an error struct. Only you can decide what kind of error handling use in your particular case.