Or just use sync.Map, which would be faster and about 10x less work