title: Is there an ioctl equivalant in Golang that helps with controling GPIO
body: <p>I am writing an Arduino-like library for the raspberryPi in golang. There are 2 main ways to interface with the GPIO linux kernel ABI one using <code>/sys/class/gpio/*</code> (deprecated) or <code>/dev/gpiochip[0-9]*</code>. I would like to use the latter because well, the former is deprecated.</p>
  <p>I took a look at a library called libgpiod. The code was simple to understand but the usage of <code>ioctl</code> made it difficult to port to Golang (especially because I am beginner).</p>
  <p>I would like to be able to port this line:</p>
  <pre><code>rv = ioctl(fd, GPIO_GET_CHIPINFO_IOCTL, &amp;info); //from libgpio lib/core.c ln:273.
  </code></pre>