diff --git a/lib/promscrape/discovery/gce/gce.go b/lib/promscrape/discovery/gce/gce.go index 3f1f9809eb..9fe537c250 100644 --- a/lib/promscrape/discovery/gce/gce.go +++ b/lib/promscrape/discovery/gce/gce.go @@ -29,11 +29,11 @@ func (z *ZoneYAML) UnmarshalYAML(unmarshal func(interface{}) error) error { return err } var zones []string - switch v.(type) { + switch t := v.(type) { case string: - zones = []string{v.(string)} + zones = []string{t} case []interface{}: - for _, vv := range v.([]interface{}) { + for _, vv := range t { zone, ok := vv.(string) if !ok { return fmt.Errorf("unexpected zone type detected: %T; contents: %#v", vv, vv)