esimov / pigo

Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go.
MIT License
4.39k stars 310 forks source link

The use of log.Fatal #2

Closed bep closed 6 years ago

bep commented 6 years ago

First, thanks for this, this is very much appreciated, and the code looks solid.

I have one small request, which I think is needed for this to be used as a library. And that is to replace the log.Fatal (which does an ´os.Exit` I don't think is even possible to catch in a client):

https://github.com/esimov/pigo/blob/master/core/pigo.go#L67

I would suggest just returning an error. This may be "this should never happen errors", and then a panic may be in order.

esimov commented 6 years ago

Thanks for the appreciation. I will consider replacing log.Fatal with a return error.

esimov commented 6 years ago

@bep i have replaced the log message with error return. I also updated the package files if needed.