code: func (r *RobotsData) FindGroup(agent string) (ret *Group) {
  	var prefixLen int
  
  	agent = strings.ToLower(agent)
  	if ret = r.groups["*"]; ret != nil {
  		// Weakest match possible
  		prefixLen = 1
  	}
  	for a, g := range r.groups {
  		if a != "*" && strings.HasPrefix(agent, a) {
  			if l := len(a); l > prefixLen {
  				prefixLen = l
  				ret = g
  			}
  		}
  	}
  
  	if ret == nil {
  		return emptyGroup
  	}
  	return
  }
docs: // FindGroup searches block of declarations for specified user-agent.
  // From Google's spec:
  // Only one group of group-member records is valid for a particular crawler.
  // The crawler must determine the correct group of records by finding the group
  // with the most specific user-agent that still matches. All other groups of
  // records are ignored by the crawler. The user-agent is non-case-sensitive.
  // The order of the groups within the robots.txt file is irrelevant.