code: func getConsoleGroups(def *config.Header, summaries map[common.ConsoleID]*ui.BuilderSummaryGroup) []ui.ConsoleGroup {
  	if def == nil || len(def.GetConsoleGroups()) == 0 {
  		// No header, no console groups.
  		return nil
  	}
  	groups := def.GetConsoleGroups()
  	consoleGroups := make([]ui.ConsoleGroup, len(groups))
  	for i, group := range groups {
  		groupSummaries := make([]*ui.BuilderSummaryGroup, len(group.ConsoleIds))
  		for j, id := range group.ConsoleIds {
  			cid, err := common.ParseConsoleID(id)
  			if err != nil {
  				// This should never happen, the consoleID was already validated further
  				// upstream.
  				panic(err)
  			}
  			if consoleSummary, ok := summaries[cid]; ok {
  				groupSummaries[j] = consoleSummary
  			} else {
  				// This should never happen.
  				panic(fmt.Sprintf("could not find console summary %s", id))
  			}
  		}
  		consoleGroups[i].Consoles = groupSummaries
  		if group.Title != nil {
  			ariaLabel := "console group " + group.Title.Text
  			consoleGroups[i].Title = ui.NewLink(group.Title.Text, group.Title.Url, ariaLabel)
  			consoleGroups[i].Title.Alt = group.Title.Alt
  		}
  	}
  	return consoleGroups
  }
docs: // getConsoleGroups extracts the console summaries for all header summaries
  // out of the summaries map into console groups for the header.