Fix magefile compatibility with Windows (#538)

This commit is contained in:
David Zhao
2022-03-18 23:53:05 -07:00
committed by GitHub
parent f14c452f8c
commit 224dfe68b1
3 changed files with 30 additions and 19 deletions
+20
View File
@@ -0,0 +1,20 @@
//go:build mage && !windows
// +build mage,!windows
package main
import (
"syscall"
)
func setULimit() error {
// raise ulimit on unix
var rLimit syscall.Rlimit
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
return err
}
rLimit.Max = 10000
rLimit.Cur = 10000
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
}