mirror of
https://github.com/Estom/notes.git
synced 2026-04-25 02:52:37 +08:00
go知识重新整理
This commit is contained in:
20
Go/DesignPattern/strategy/strategy_test.go
Normal file
20
Go/DesignPattern/strategy/strategy_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @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()
|
||||
}
|
||||
Reference in New Issue
Block a user