I encountered this issue when running my program on Mac:
Error: open <filename>: too many open files in system
After some digging it seems this issue can be fixed by increasing the limit using syscall.Setrlimit() function: https://pkg.go.dev/syscall#Setrlimit
However when I try to use it my IDE complains that the function doesn't exist. I'm developing on windows and it seems this function doesn't exist there. How can I fix this? I need to be able to compile the program for windows, mac and linux from the same source code.