Skip to content

Commit

Permalink
New AndStrategy and OrStrategy starts empty. (#231)
Browse files Browse the repository at this point in the history
# Describe Request

New AndStrategy and OrStrategy starts empty.

# Change Type

New feature.
  • Loading branch information
cinar authored Oct 10, 2024
1 parent 74dbcbd commit fff820e
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 fff820e

Please sign in to comment.