code: func (m PriorityRESTMapper) KindFor(partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionKind, error) {
  	originalGVKs, originalErr := m.Delegate.KindsFor(partiallySpecifiedResource)
  	if originalErr != nil && len(originalGVKs) == 0 {
  		return schema.GroupVersionKind{}, originalErr
  	}
  	if len(originalGVKs) == 1 {
  		return originalGVKs[0], originalErr
  	}
  
  	remainingGVKs := append([]schema.GroupVersionKind{}, originalGVKs...)
  	for _, pattern := range m.KindPriority {
  		matchedGVKs := []schema.GroupVersionKind{}
  		for _, gvr := range remainingGVKs {
  			if kindMatches(pattern, gvr) {
  				matchedGVKs = append(matchedGVKs, gvr)
  			}
  		}
  
  		switch len(matchedGVKs) {
  		case 0:
  			// if you have no matches, then nothing matched this pattern just move to the next
  			continue
  		case 1:
  			// one match, return
  			return matchedGVKs[0], originalErr
  		default:
  			// more than one match, use the matched hits as the list moving to the next pattern.
  			// this way you can have a series of selection criteria
  			remainingGVKs = matchedGVKs
  		}
  	}
  
  	return schema.GroupVersionKind{}, &AmbiguousResourceError{PartialResource: partiallySpecifiedResource, MatchingKinds: originalGVKs}
  }
docs: // KindFor finds all kinds, then passes them through the KindPriority patterns to find a single matching hit.