Skip to content

Commit

Permalink
fix strategy initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
narumiruna committed May 15, 2024
1 parent 62e236e commit 705261d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pkg/strategy/atrpin/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ type Strategy struct {
}

func (s *Strategy) Initialize() error {
s.Strategy = &common.Strategy{}
if s.Strategy == nil {
s.Strategy = &common.Strategy{}
}
return nil
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/strategy/random/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func (s *Strategy) Defaults() error {
}

func (s *Strategy) Initialize() error {
s.Strategy = &common.Strategy{}
if s.Strategy == nil {
s.Strategy = &common.Strategy{}
}
return nil
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/strategy/wall/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ type Strategy struct {
}

func (s *Strategy) Initialize() error {
s.Strategy = &common.Strategy{}
if s.Strategy == nil {
s.Strategy = &common.Strategy{}
}
return nil
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/strategy/xfixedmaker/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ func (s *Strategy) Defaults() error {
}

func (s *Strategy) Initialize() error {
s.Strategy = &common.Strategy{}
if s.Strategy == nil {
s.Strategy = &common.Strategy{}
}
return nil
}

Expand Down

0 comments on commit 705261d

Please sign in to comment.