I have this package that installs fine on Linux.
But when I try to install it on Windows, it won't build:
X:\>go get
github.com/pebbe/isterminal
#
github.com/pebbe/isterminal
C:\Go\src\pkg\
github.com\pebbe\isterminal\isterminal.go:24: undefined: syscall.Termios
C:\Go\src\pkg\
github.com\pebbe\isterminal\isterminal.go:25: undefined: syscall.SYS_IOCTL
C:\Go\src\pkg\
github.com\pebbe\isterminal\isterminal.go:26: undefined: syscall.TCGETS
C:\Go\src\pkg\
github.com\pebbe\isterminal\isterminal.go:26: not enough arguments in call to syscall.Syscall6
X:\>
So, what I need to do is change the package to have it use Linux
methods on Linux, and Windows methods on Windows, and in the
package, have a check for what platform it is runing on. But how
can I do that if it won't even build on both platforms?
I could have two separate packages, one for Linux, one for
Windows, but then I would also need two version for all packages
dependent on this package.
How do I solve this?
--
Peter Kleiweg
my Go programming cookbook:
http://www.let.rug.nl/~kleiweg/go/