portlock

Package portlock is a simple mutex for use between processes to protect a shared resource

Go Reference