Skip to content

Commit

Permalink
New AndStrategy and OrStrategy starts empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
cinar committed Oct 10, 2024
1 parent 74dbcbd commit 0e31ba5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions strategy/and_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ type AndStrategy struct {
}

// NewAndStrategy function initializes an empty and strategies group with the given name.
func NewAndStrategy(name string) *AndStrategy {
func NewAndStrategy(name string, strategies ...Strategy) *AndStrategy {
return &AndStrategy{
Strategies: []Strategy{},
Strategies: strategies,
name: name,
}
}
Expand Down
4 changes: 2 additions & 2 deletions strategy/or_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ type OrStrategy struct {
}

// NewOrStrategy function initializes an empty or strategies group with the given name.
func NewOrStrategy(name string) *OrStrategy {
func NewOrStrategy(name string, strategies ...Strategy) *OrStrategy {
return &OrStrategy{
Strategies: []Strategy{},
Strategies: strategies,
name: name,
}
}
Expand Down

0 comments on commit 0e31ba5

Please sign in to comment.