fix golint issues in core/load (#495)
This commit is contained in:
@@ -6,11 +6,13 @@ import (
|
||||
"github.com/tal-tech/go-zero/core/syncx"
|
||||
)
|
||||
|
||||
// A ShedderGroup is a manager to manage key based shedders.
|
||||
type ShedderGroup struct {
|
||||
options []ShedderOption
|
||||
manager *syncx.ResourceManager
|
||||
}
|
||||
|
||||
// NewShedderGroup returns a ShedderGroup.
|
||||
func NewShedderGroup(opts ...ShedderOption) *ShedderGroup {
|
||||
return &ShedderGroup{
|
||||
options: opts,
|
||||
@@ -18,6 +20,7 @@ func NewShedderGroup(opts ...ShedderOption) *ShedderGroup {
|
||||
}
|
||||
}
|
||||
|
||||
// GetShedder gets the Shedder for the given key.
|
||||
func (g *ShedderGroup) GetShedder(key string) Shedder {
|
||||
shedder, _ := g.manager.GetResource(key, func() (closer io.Closer, e error) {
|
||||
return nopCloser{
|
||||
|
||||
Reference in New Issue
Block a user