Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
CZJCC committed Dec 26, 2024
1 parent 42722dc commit 4fdb5c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/group/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ type Group struct {
}

// NewGroup news a group container.
func NewGroup(factory func() interface{}) *Group {
if factory == nil {
func NewGroup(new func() interface{}) *Group {
if new == nil {
panic("container.group: can't assign a nil to the new function")
}
return &Group{
new: factory,
new: new,
vals: make(map[string]interface{}),
}
}
Expand Down Expand Up @@ -46,12 +46,12 @@ func (g *Group) Get(key string) interface{} {
}

// Reset resets the new function and deletes all existing objects.
func (g *Group) Reset(factory func() interface{}) {
if factory == nil {
func (g *Group) Reset(new func() interface{}) {
if new == nil {
panic("container.group: can't assign a nil to the new function")
}
g.Lock()
g.new = factory
g.new = new
g.Unlock()
g.Clear()
}
Expand Down

0 comments on commit 4fdb5c9

Please sign in to comment.