type testCustomCollector … func newTestCustomCollector(ds ...*Desc) *testCustomCollector { … } func (tc *testCustomCollector) DescribeWithStability(ch chan<- *Desc) { … } func (tc *testCustomCollector) CollectWithStability(ch chan<- Metric) { … } func TestBaseCustomCollector(t *testing.T) { … } func TestInvalidCustomCollector(t *testing.T) { … } // TestCustomCollectorClearState guarantees `ClearState()` will fully clear a collector. // It is necessary because we may forget to clear some new-added fields in the future. func TestCustomCollectorClearState(t *testing.T) { … }