INNER CODE UNIT · Go
groups
grafana-cold-storage/phlare · tools/doc-generator/main.go:45
groups := map[string][]*parse.ConfigBlock{}
for _, block := range blocks {
groups[block.Name] = append(groups[block.Name], block)
}
// For each duplicated block, we need to fix the CLI flags, because
// in the documentation each block will be displayed only once but
// since they're duplicated they will have a different CLI flag
// prefix, which we want to correctly document.
for _, group := range groups {
if len(group) == 1 {
continue
}
// We need to find the CLI flags prefix of each config block. To do it,
// we pick the first entry from each config block and then find the
// different prefix across all of them.
flags := []string{}