github.com/wfusion/gofusion@v1.1.14/common/utils/gomonkey/dsl/factory.go (about) 1 package dsl 2 3 func Any() Constraint { 4 return &AnyConstraint{} 5 } 6 7 func Eq(x interface{}) Constraint { 8 return &EqConstraint{x: x} 9 } 10 11 func Return(x ...interface{}) Behavior { 12 r := &ReturnBehavior{rets: make([]Params, 0), params: make(Params, 0)} 13 r.params = append(r.params, x...) 14 return r 15 } 16 17 func Repeat(behavior Behavior, times int) Behavior { 18 return &RepeatBehavior{rets: make([]Params, 0), behavior: behavior, times: times} 19 }