Below are the regex for filtering out all the non go files (i.e those with '.go' extension)
^([\S]*[^.][^g][^o]|[\S]*.[^g].|[\S]*..[^o]$|[\S]*[^.]..|[\S]{1,2})$
^([^.]*)($|[.]($|[\S]$|g[^o]$|[^g]o$|[^g][^o]$|([\S]+)\.($|.$|g[^o]$|[^g]o$|[^g][^o]$|[^.]{3,}$)|[^.]{3,}$))
You can test them here (click on try it 'Go' in the menu below the regex)
While they seem to work correctly in go but not with inotifywait
's exclude filter (which uses posix ERE format)
I am trying to setup a "watch and reload" task in my Makefile for a golang project. Also i am assuming file or folders names dont have spaces.