This commit is contained in:
刘洪宝 2018-12-06 12:24:06 +08:00
parent 05b12c89f1
commit 1064ec934f
2 changed files with 1 additions and 28 deletions

View File

@ -34,7 +34,7 @@
6. [备忘录模式](https://github.com/silsuer/golang-design-patterns/tree/master/memento-pattern)
7. 中介者模式
7. [中介者模式](https://github.com/silsuer/golang-design-patterns/tree/master/mediator-pattern)
8. 迭代器模式

View File

@ -1,27 +0,0 @@
package main
import "fmt"
// 中介者接口
type IMediator interface {
Notify(c IClient) // 接受通知
}
// 客户端接口
type IClient interface {
Column()
}
// 具体中介者,定义关联关系
type Mediator struct {
From IClient
To IClient
}
func (m *Mediator) Notify(c IClient) {
// 会通知所有
}
func main() {
fmt.Println(1)
}