in code/function/function.go [240:251]
func computeStop(project string, srv *compute.Service, instanceList *compute.InstanceList) error {
for _, v := range instanceList.Items {
zoneStr := strings.Split(v.Zone, "/")
zone := zoneStr[len(zoneStr)-1]
stopCall := srv.Instances.Stop(project, zone, v.Name)
if _, err := stopCall.Do(); err != nil {
return fmt.Errorf("error stopping Compute Engine instances: %s", err)
}
}
return nil
}