未验证 提交 e2b83d90 编写于 作者: P Phodal Huang

feat: try to use stragetry patterns

上级 1ea1ff5a
package evaluate
type Evaluator interface {
IsMatch() bool
Evaluate()
}
type Evaluation struct {
Evaluator Evaluator
}
func (o *Evaluation) Evaluate() {
if o.Evaluator.IsMatch() {
o.Evaluator.Evaluate()
}
}
\ No newline at end of file
package evaluator
type Common struct {
}
func (Common) IsMatch() bool {
return true
}
func (Common) Evaluate() {
}
package evaluator
type Controller struct {
}
func (Controller) IsMatch() bool {
return true
}
func (Controller) Evaluate() {
}
package evaluator
type Model struct {
}
func (Model) IsMatch() bool {
return true
}
func (Model) Evaluate() {
}
package evaluator
type Service struct {
}
func (Service) IsMatch() bool {
return true
}
func (Service) Evaluate() {
}
\ No newline at end of file
package evaluator
type Util struct {
}
func (Util) IsMatch() bool {
return true
}
func (Util) Evaluate() {
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册