I'm working on an AI game engine in golang, and I need to store some precomputed data to be accessible as fast as possible.
The structure of the data is like this:
{
'type1': {
0: {
0: { 1, 2, 3, 4, 5, 6, 7 },
1: { 2, 3, 4 },
},
1: {
0: { 2, 3, 4, 5, 6 },
},
},
"type2": {
0: {
{ 63, 23, 42, 12 },
},
},
}
What is the best way to embed this data into the compiled binary? The data will never change and represents the rules of the game.
I am aware that I can create a function that allocates the map on the heap, but I think it is more natural that the data is accessed directly where it is.