sync.Map to JSON

Hello everyone,
I’m trying to convert sync.Map to JSON with json.Marshal but i get empty json “{}”.


I’m looking for a solution to convert sync.Map to json except convert it to Map (go over sync.Map and copy keys and values to Map) and convert the Map to JSON.

Thanks :slight_smile:

Problably u’ll need to convert before encode.

Thats exacly what I’m trying to avoid, i guess there is no other solution…

Thank you!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.