brian-armstrong / gpio

Go library to do GPIO on systems with /sys/class/gpio (sysfs)
BSD 3-Clause "New" or "Revised" License
139 stars 50 forks source link

Do not call os.Exit() on errors #16

Closed sahib closed 4 years ago

sahib commented 4 years ago

Since this is a library, it should not just blindly execute os.Exit() on every encountered error. Also, since Go 1.14, syscalls are more likely to be interrupted. This means Select() might return with syscall.EINTR in which case we're supposed to call it again. Proper error handling would probably require more work and changes in the public API so I just changed the internal API for now.