air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
18.29k stars 815 forks source link

remove a data race by compiling the exclude regexes in the preprocess phase instead #677

Open istyf opened 2 weeks ago

istyf commented 2 weeks ago

This PR should fix #668 #655 and #530

The regular expressions, that are used to determine if files should be excluded, are compiled lazily on first request. This causes different kinds of timing related problems, including panics because multiple goroutines will end up compiling the expressions, while other goroutines may return with data that isn't complete.