I'm new to go, and I'm using viper do load all my config what currently i have is the YAML look like below
countryQueries:
sg:
- qtype: gmap
qplacetype: postal_code
- qtype: gmap
qplacetype: address
- qtype: geocode
qplacetype: street_address
hk:
- qtype: gmap
qplacetype: postal_code
- qtype: gmap
qplacetype: address
- qtype: geocode
qplacetype: street_address
to note that the countrycode are dynamic it could be added anytime for any countries. So how do i map this to a struct where technically speaking i can do
for _, query := range countryQueries["sg"] { }
i try to contruct it myself by looping it but im stucked here
for country, queries := range viper.GetStringMap("countryQueries") {
// i cant seem to do anything with queries, which i wish to loop it
for _,query := range queries {} //here error
}