package tick import "syscall" import "os" func LockFile(file *os.File) error { return syscall.Flock(int(file.Fd()), syscall.LOCK_EX | syscall.LOCK_NB) }