stianeikeland / go-rpio

:electric_plug: Raspberry Pi GPIO library for go-lang
MIT License
2.16k stars 221 forks source link

Try gpiomem when /dev/mem is not found #83

Open nsieg opened 2 years ago

nsieg commented 2 years ago

When running go-rpio inside a docker container with only /dev/gpiomem mounted, the library fails (docker run --device /dev/gpiomem). Currently, it only checks whether there is a permission problem with /dev/mem. In this case, however, /dev/mem is not found inside the container leading to a file not found error. In this case, it should also be tried if /dev/gpiomem is available.