code: func asGroupsOrPanic(items []Item) []Group {
  	groups := make([]Group, len(items))
  	for i, item := range items {
  		if grp, ok := item.(Group); ok {
  			groups[i] = grp
  		} else {
  			panic(fmt.Sprintf("item is not a group: %s", reflect.TypeOf(item)))
  		}
  	}
  	return groups
  }
docs: // asGroupsOrPanic converts the given array of Item into an array of Group.
  // Each of the given items in the array must also be a Group or else a panic results.