func (r *Registry) MustRegisterGroup(name string) GID {
	gd := &groupDesc{Name: name}
	r.mustRegister(gd)
	return gd.id
}
MustRegisterGroup registers a new group and panics if a group already exists with the same name.

MustRegisterGroup is not safe to call from concurrent goroutines.
package metrics
import (
	"fmt"
	"sort"
)
type Registry struct {
	descriptors []*groupDesc
	groups      []groupRegistry
}
const (
	DefaultGroup = GID(0)
)
func NewRegistry() *Registry {
	var r Registry
	r.MustRegisterGroup("global")
	return &r
}
func (r *Registry) register(gd *groupDesc) error {
	p := sort.Search(len(r.descriptors), func(i int) bool {
		return r.descriptors[i].Name == gd.Name
	})
	if p != len(r.descriptors) {
		return fmt.Errorf("group name '%s' already in use", gd.Name)
	}
	r.descriptors = append(r.descriptors, gd)
	sort.Slice(r.descriptors, func(i, j int) bool {
		return r.descriptors[i].Name < r.descriptors[j].Name
	})
	gd.id = GID(len(r.groups))
	r.groups = append(r.groups, groupRegistry{desc: gd})
	return nil
}
func (r *Registry) mustRegister(gd *groupDesc) {
	if err := r.register(gd); err != nil {
		panic(err.Error())
	}
}