ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~ 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) } ~~~