Hacker News new | past | comments | ask | show | jobs | submit login

Maps are concurrent readonly safe.



You can't declare a read-only map (or slice). Actually Java made exactly the same mistake, the best you can do is to implement Map<K, V> and List<T> with setters that throw at runtime.


They aren't safe to read or write concurrently.


> They aren't safe to read or write concurrently.

Slightly ambiguous wording, so just to clarify:

Go maps are safe to read concurrently

Go maps are not safe to read AND write concurrently

Go maps are not safe to write concurrently


Both!!! Its out there, in the wide world for everyone to read, just use Google!!


I wasn't asking a question, I was clarifying.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: