Hi Team,
when ever i return map data. Go is sorting it in ascending order. But i want to re-arrange those key, value pairs in the order which i would like to. Is there any solution to get such sort of output.
Hi Team,
when ever i return map data. Go is sorting it in ascending order. But i want to re-arrange those key, value pairs in the order which i would like to. Is there any solution to get such sort of output.
Depend on OS, the hash algoritm is different, so the order used when print a map will change.
You can use package “sort” to get an ordered map according their keys
Can u share me an example to solve my issue
Thank you
you’re welcome!!!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.