Cómo buscar un elemento en un segmento de golang
Tengo una rebanada de estructuras.
type Config struct {
Key string
Value string
}
// I form a slice of the above struct
var myconfig []Config
// unmarshal a response body into the above slice
if err := json.Unmarshal(respbody, &myconfig); err != nil {
panic(err)
}
fmt.Println(config)
Aquí está el resultado de esto:
[{key1 test} {web/key1 test2}]
¿Cómo puedo buscar en esta matriz para obtener el elemento dondekey="key1"
?