code: func (m PriorityRESTMapper) ResourceFor(partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionResource, error) {
  	originalGVRs, originalErr := m.Delegate.ResourcesFor(partiallySpecifiedResource)
  	if originalErr != nil && len(originalGVRs) == 0 {
  		return schema.GroupVersionResource{}, originalErr
  	}
  	if len(originalGVRs) == 1 {
  		return originalGVRs[0], originalErr
  	}
  
  	remainingGVRs := append([]schema.GroupVersionResource{}, originalGVRs...)
  	for _, pattern := range m.ResourcePriority {
  		matchedGVRs := []schema.GroupVersionResource{}
  		for _, gvr := range remainingGVRs {
  			if resourceMatches(pattern, gvr) {
  				matchedGVRs = append(matchedGVRs, gvr)
  			}
  		}
  
  		switch len(matchedGVRs) {
  		case 0:
  			// if you have no matches, then nothing matched this pattern just move to the next
  			continue
  		case 1:
  			// one match, return
  			return matchedGVRs[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
  			remainingGVRs = matchedGVRs
  		}
  	}
  
  	return schema.GroupVersionResource{}, &AmbiguousResourceError{PartialResource: partiallySpecifiedResource, MatchingResources: originalGVRs}
  }
docs: // ResourceFor finds all resources, then passes them through the ResourcePriority patterns to find a single matching hit.