The simplest way would be for you to use the sync.Map type which is specifically designed for that purpose.