https://github.com/jacobsa/go-serial
Currently it only works on OS X, but that's mostly just because I don't have
any Linux hardware to test on. I think making it work on Linux would be a
matter of updating some constants (and am happy to take pull requests). Even
so, it might be useful to somebody as-is. Let me know if you have any
feedback.
Aaron
[1]: http://groups.google.com/group/golang-nuts/browse_thread/thread/f28f5fc4f69e16ef
I also made a serial port package here:
http://github.com/tarm/goserial
I think you and I arrived at about the same API! I some commits from
a couple months ago that add timeouts, parity, etc, but have not yet
needed those and so have not yet tested them and so have not yet
pushed them out to github.
The package I made uses cgo+termios.h instead of syscalls for OSX, and
it should also work on Linux, though I have not tested that either.
One thing you might think about since you're doing syscalls anyway is
using the IOSSIOSPEED ioctl which I think will let you set
non-standard baud rates on OSX.
One difference (for now) is my package also works on windows and you
can cross compile from OSX (or linux presumably) to windows, which can
be handy.
-Tarmigan