On Go, Portability, and System Interfaces
I've been noticing more and more lately that we have a plethora of libraries and programs written for Go, which don't work on one platform or another. The root cause of these is often the use of direct system call coding to system calls such as ioctl(). On some platforms (illumos/solaris!) there is no such system call. The Problems But this underscores a far far worse problem, that has become common (mal)-practice in the Go community. That is, the coding of system calls directly into high level libraries and even application programs. For example, it isn't uncommon to see something like this (taken from termbox-go ): func tcsetattr(fd uintptr, termios *syscall_Termios) error { r, _, e := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall_TCSETS), uintptr(unsafe.Pointer(termios))) if r != 0 { ...