// +build linux darwin package fs import ( "os" "syscall" ) func CloseOnExec(file *os.File) { if file != nil { syscall.CloseOnExec(int(file.Fd())) } }