code: func IsValidOSArch(labels map[ACIdentifier]string, validOSArch map[string][]string) error {
  	if os, ok := labels["os"]; ok {
  		if validArchs, ok := validOSArch[os]; !ok {
  			// Not a whitelisted OS. TODO: how to warn rather than fail?
  			validOses := make([]string, 0, len(validOSArch))
  			for validOs := range validOSArch {
  				validOses = append(validOses, validOs)
  			}
  			sort.Strings(validOses)
  			return fmt.Errorf(`bad os %#v (must be one of: %v)`, os, validOses)
  		} else {
  			// Whitelisted OS. We check arch here, as arch makes sense only
  			// when os is defined.
  			if arch, ok := labels["arch"]; ok {
  				found := false
  				for _, validArch := range validArchs {
  					if arch == validArch {
  						found = true
  						break
  					}
  				}
  				if !found {
  					return fmt.Errorf(`bad arch %#v for %v (must be one of: %v)`, arch, os, validArchs)
  				}
  			}
  		}
  	}
  	return nil
  }
docs: // IsValidOsArch checks if a OS-architecture combination is valid given a map
  // of valid OS-architectures