I need to only allow one instance of my Golang executable at a time. I'm not sure how to use a Global Mutex to make sure no other instances are running. Because the sw is very memory-consuming, I want to allow only one instance of the executable to run. The other instances should wait untill the working instance has finished and then start working. This would be running on a Linux Machine.
There is same question for windows existing: Restricting to Single Instance of Executable with Golang