func MustRegisterOrGet(c Collector) Collector {
	c, err := RegisterOrGet(c)
	if err != nil {
		panic(err)
	}
	return c
}
MustRegisterOrGet behaves like RegisterOrGet but panics instead of returning
an error.

Deprecated: This is deprecated for the same reason RegisterOrGet is. See
there for details.
package prometheus
import (
	"bytes"
	"errors"
	"fmt"
	"os"
	"sort"
	"sync"
	"github.com/golang/protobuf/proto"
	dto "github.com/prometheus/client_model/go"
)
const (
	capMetricChan = 1000
	capDescChan   = 10
)
var (
	defaultRegistry              = NewRegistry()
	DefaultRegisterer Registerer = defaultRegistry
	DefaultGatherer   Gatherer   = defaultRegistry
)
func init() {
	MustRegister(NewProcessCollector(os.Getpid(), ""))
	MustRegister(NewGoCollector())
}
func NewRegistry() *Registry {
	return &Registry{
		collectorsByID:  map[uint64]Collector{},
		descIDs:         map[uint64]struct{}{},
		dimHashesByName: map[string]uint64{},
	}
}
func NewPedanticRegistry() *Registry {
	r := NewRegistry()
	r.pedanticChecksEnabled = true
	return r
}
type Registerer interface {
	Register(Collector) error
	MustRegister(...Collector)
	Unregister(Collector) bool
}
type Gatherer interface {
	Gather() ([]*dto.MetricFamily, error)
}
func Register(c Collector) error {
	return DefaultRegisterer.Register(c)
}
func MustRegister(cs ...Collector) {
	DefaultRegisterer.MustRegister(cs...)
}
func RegisterOrGet(c Collector) (Collector, error) {
	if err := Register(c); err != nil {
		if are, ok := err.(AlreadyRegisteredError); ok {
			return are.ExistingCollector, nil
		}
		return nil, err
	}
	return c, nil
}