mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 17:20:24 +08:00
8403ed16ae
* ci: add Lint check on commits * ci: fix Lint script error * test: fix go vet errors * test: fix go vet errors, remove gofumpt to check go vet * test: fix go vet errors, try gofumpt * test: fix go vet errors, try gofumpt, round 1 * test: fix go vet errors, try gofumpt, round 2 * ci: fix Lint errors
17 lines
250 B
Go
17 lines
250 B
Go
//go:build linux || darwin
|
|
// +build linux darwin
|
|
|
|
package fs
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
// CloseOnExec makes sure closing the file on process forking.
|
|
func CloseOnExec(file *os.File) {
|
|
if file != nil {
|
|
syscall.CloseOnExec(int(file.Fd()))
|
|
}
|
|
}
|