I am retrieving an object called DockerInfo
which has a field inside it called SystemStatus
which is [][2]string
, then in order to access the elements inside SystemStatus
I am doing this, for example if the 4th element in SystemStatus
is ["Nodes","6"]
then to access the number 6
dockerinfo.SystemStatus[3][1]
But the Nodes
elements are not fixed in 4th position always so I can not use indexing and instead I want to find number of nodes by for example writing
dockerinfo.SystemStatus["Nodes"]
How can I do that? Or how to transform the SystemStatus
to map[string]string
format?