Files
notes_estom/Go/DesignPattern/strategy/strategy_test.go
2021-09-03 05:34:34 +08:00

21 lines
311 B
Go

/**
* @Author:zhoutao
* @Date:2020/12/12 下午2:06
* @Desc:
*/
package strategy
func ExamplePayByCash() {
payment := NewPayment("ad", "808490523", 900, &Cash{})
payment.Pay()
//Output:
//Pay by cash
}
func ExamplePayByBank() {
payment := NewPayment("tom", "345782345", 900, &Bank{})
payment.Pay()
}