3 ms·
> With Go, you never, ever have to write any OS-specific code It actually depends what you want to do. Since Go tends to be low-level, there may be a moment wh
by rakoo 12y ago
> With Go, you never, ever have to write any OS-specific code
It actually depends what you want to do. Since Go tends to be low-level, there may be a moment where your code goes into syscall land, in which case you're going to be OS-specific.
The most recent example I have in mind is mmaping a file: see https://github.com/edsrzf/mmap-go https://github.com/edsrzf/mmap-go: there is a windows- and a unix- specific version. If you're using something else, you're out of luck (with this package at least)
There is a syscall package, but it's just piling up a lot of syscalls with already some OS-specific stuff. It is going to be so much of a burden to manage that the Go team plans to abstract this in a new package (https://golang.org/s/go1.4-syscall https://golang.org/s/go1.4-syscall)