Exported function returning value of unexported type RVV-B0011
Anti-pattern
Major
8 months ago4 years old
exported method GetStage returns unexported type unsaferecovery.stage, which can be annoying to use
 486}
 487
 488// GetStage gets the stage of the current unsafe recovery.
 489func (u *Controller) GetStage() stage { 490	u.RLock()
 491	defer u.RUnlock()
 492	return u.stage
exported func NewStoreStatisticsMap returns unexported type *statistics.storeStatisticsMap, which can be annoying to use
298}
299
300// NewStoreStatisticsMap creates a new storeStatisticsMap.
301func NewStoreStatisticsMap(opt config.ConfProvider) *storeStatisticsMap {302	return &storeStatisticsMap{
303		opt:   opt,
304		stats: newStoreStatistics(opt),
exported func NewCollectBucketStatsTask returns unexported type *buckets.collectBucketStatsTask, which can be annoying to use
71}
72
73// NewCollectBucketStatsTask creates task to collect bucket stats.
74func NewCollectBucketStatsTask(minDegree int, regionIDs ...uint64) *collectBucketStatsTask {75	return &collectBucketStatsTask{
76		minDegree: minDegree,
77		regionIDs: regionIDs,
exported func NewEtcdKVBase returns unexported type *kv.etcdKVBase, which can be annoying to use
 48}
 49
 50// NewEtcdKVBase creates a new etcd kv.
 51func NewEtcdKVBase(client *clientv3.Client, rootPath string) *etcdKVBase { 52	return &etcdKVBase{
 53		client:   client,
 54		rootPath: rootPath,