code: func countFlatmapContainerValues(key string, attrs map[string]string) string {
  	if len(key) < 3 || !(strings.HasSuffix(key, ".#") || strings.HasSuffix(key, ".%")) {
  		panic(fmt.Sprintf("invalid index value %q", key))
  	}
  
  	prefix := key[:len(key)-1]
  	items := map[string]int{}
  
  	for k := range attrs {
  		if k == key {
  			continue
  		}
  		if !strings.HasPrefix(k, prefix) {
  			continue
  		}
  
  		suffix := k[len(prefix):]
  		dot := strings.Index(suffix, ".")
  		if dot > 0 {
  			suffix = suffix[:dot]
  		}
  
  		items[suffix]++
  	}
  	return strconv.Itoa(len(items))
  }
docs: // countFlatmapContainerValues returns the number of values in the flatmapped container
  // (set, map, list) indexed by key. The key argument is expected to include the
  // trailing ".#", or ".%".