moving OS X functions to darwin.go