Hi!
Most consistent interface to GPIO across different devices is probably the sysfs gpio interface (yes, deprecated, but very widely used).
sinovoip published a patched fork of Wiring Pi for all their Banana Pi products: BPI-WiringPi2 (deep link to: pin mappings for the m2u).
Wiring Pi is built around the sysfs gpio interface.
A usage guide was published here: https://forum.banana-pi.org/t/how-to-get-working-wiringpi-on-raspbian/3696
An additional step for armbian users might be needed: https://forum.banana-pi.org/t/banana-pi-bpi-m2-ultra-m2u-wiringpi-gpio-demo/3027/10
Then, using e.g. the go-wiringpi bindings you should be able to use the M2berry GPIOs in golang.
I did not try any of the steps above but hope that at least some of it will help you.
Let us know of your results!
Sincerely,
kerel
PS: New userspace applications are supposed to use the character device GPIO, see https://lloydrochester.com/post/hardware/libgpiod-intro-rpi/
Go library: https://github.com/warthog618/gpiod
I can confirm that there are 288 lines exposed via this new interface:
root@m2berry:~# gpiodetect
gpiochip0 [1c20800.pinctrl] (288 lines)
Device Tree: