多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
~~~ package flyweight import ( "testing" ) func TestFlyweight(t *testing.T) { ff := NewFlyweightFactory() fya := ff.Flyweight("a") fya.Operation(1) fyb := ff.Flyweight("b") fyb.Operation(2) fyc := ff.Flyweight("c") fyc.Operation(3) fyd := ff.Flyweight("d") fyd.Operation(4) fyu := ff.Flyweight("u") fyu.Operation(5) } ~~~