mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 17:20:24 +08:00
15 lines
160 B
Go
15 lines
160 B
Go
// +build linux darwin
|
|
|
|
package fs
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func CloseOnExec(file *os.File) {
|
|
if file != nil {
|
|
syscall.CloseOnExec(int(file.Fd()))
|
|
}
|
|
}
|