I have the following yaml file and want to iterate over the cameraids.---
---
profiles:
HDready: ' -vcodec libx264 -pix_fmt yuv420p -crf 23 -s 1280x720 '
mobile: ' -vcodec libx264 -pix_fmt yuv420p -crf 23 -s 480x270 '
cameraids:
111:
fps: 30
191:
fps: 50
851:
fps: 50
I want now to iterate over the cameraids and profiles therefore I declare the variable for cameraids like this
var camids map[string]interface{}
The same as the fmt.Println(reflect.TypeOf(viper.Get("cameraids")))
prints but I always get the following error no new variables on left side of :=
when I try to get the map from viper
camids := viper.GetStringMap("cameraids")
Please can you explain and help me what I misunderstand, thanks.