'Why do I get bad file descriptor while running rerun Go package in iTerm2?

Im using a rerun Go package in a iTerm2 terminal and getting an error

Error while reading list of files to listen! bad file descriptor

This error comes from filepath.Walk function. The thing is that everything works fine in integrated VSCode terminal but not in iTerm2. I could guarantee that config file is 100% correct (rerun says that config is incorrect in other way plus we use this config for couple years in a team). Also I would like to mention that iTerm2 has a Full Disk Access in the MacOS privacy settings.

Would be so thankful for any info or help regarding my problem.

Im on macOS Monterey 12.1, M1 Max.

Full error:

rerun -c rerun.json
git/ivp/rer 21:40:28 ☹[PANI] ▶ Error while reading list of files to listen! bad file descriptor
panic: Error while reading list of files to listen! %s

goroutine 1 [running]:
github.com/ivpusic/golog.(*Logger).Panicf(0xc000166100, {0x12024a8, 0x2f}, {0xc00015de98, 0x1e51ff8, 0x18})
    /Users/greenwookez/go/pkg/mod/github.com/ivpusic/[email protected]/logger.go:315 +0x134
main.(*watcher).start(0xc0001261e0)
    /Users/greenwookez/go/pkg/mod/github.com/ivpusic/[email protected]/watcher.go:147 +0x2ef
main.main()
    /Users/greenwookez/go/pkg/mod/github.com/ivpusic/[email protected]/main.go:51 +0x2af


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source