In Golang we have to sync concurrent changes to the Map. If my Map contains another Map like this:

map[string]map[string]*CustomStruct

.. do I have to use Lock in all of them when writing something?

If I'll write something into internal Map -> outer Map will also be changed, so I still have to sync outer Map's changes.

If I Lock outer Map's changes -> no one else can write into internal Map -> there is no point to Lock internal Map.

Am I right or it works in a different way and I must lock all Maps?