code: func (cmd *createSnapshotCmd) validateFlags(c context.Context) (map[string]string, error) {
  	if cmd.disk == "" {
  		return nil, errors.New("-disk is required")
  	}
  	labels := make(map[string]string, len(cmd.labels))
  	for _, label := range cmd.labels {
  		parts := strings.SplitN(label, ":", 2)
  		if len(parts) != 2 {
  			return nil, errors.New(fmt.Sprintf("-label %q must be in key:value form", label))
  		}
  		if _, ok := labels[parts[0]]; ok {
  			return nil, errors.New(fmt.Sprintf("-label %q has duplicate key", label))
  		}
  		labels[parts[0]] = parts[1]
  	}
  	if cmd.name == "" {
  		return nil, errors.New("-name is required")
  	}
  	if cmd.project == "" {
  		return nil, errors.New("-project is required")
  	}
  	if cmd.zone == "" {
  		return nil, errors.New("-zone is required")
  	}
  	return labels, nil
  }
docs: // validateFlags validates parsed command line flags and returns a map of parsed labels.