go知识重新整理

This commit is contained in:
Estom
2021-09-03 05:34:34 +08:00
parent 62309f856a
commit 1bad082e49
291 changed files with 29345 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
/**
* @Author:zhoutao
* @Date:2020/12/13 上午10:31
* @Desc:
*/
package visitor
func ExampleRequestVisitor() {
c := CustomerCol{}
c.Add(NewEnterpriseCustomer("NO.1"))
c.Add(NewEnterpriseCustomer("NO.2"))
c.Add(NewIndividualCustomer("bob"))
c.Accept(&ServiceRequestVisitor{})
//output :
// enterprise
// enterprise
// individual
}
func ExampleAnalisis() {
c := CustomerCol{}
c.Add(NewEnterpriseCustomer("A"))
c.Add(NewIndividualCustomer("B"))
c.Add(NewEnterpriseCustomer("C"))
c.Accept(&AnalisisVisitor{})
//output :
// enterprise
// enterprise
}