Been googling and stacking around for the solution with no success.
I'm importing a JSON file to an struct, however, when I want to use it, the values come out in a random order. This is an example of my JSON file:
"Assets": {
"asset1": "asset1.png",
"asset2": "asset2.png"
},
"Colors": {
"MainColor": [
{
"red": 247,
"green": 0,
"blue": 247
}
],
"MainGradient": [
{
"red": 9,
"green": 103,
"blue": 170
},
{
"red": 18,
"green": 138,
"blue": 221
}
]
}
I can import the JSON using Unmarshal, however, when I print it, the "red, green,blue" values outputs in random order, like this:
[{map[asset1:asset1.png asset2:asset2.png] {[map[red:247 green:0 blue:247]] [map[green:103 red:9 blue:170] map[green:138 blue:221 red:18]]}}]
As you can see, the RGB values come at random order every time. I want to know if there's a way to always output the in the same order: red, green, blue.
Thank you.