企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
~~~ package command import ( "testing" ) func TestCommand(t *testing.T) { invoker := NewInvoker() concomA := NewConcreteCommandA() receA := NewReceiverA() concomA.SetReceiver(*receA) invoker.AddCommand(concomA) concomB := NewConcreteCommandB() receB := NewReceiverB() concomB.SetReceiver(*receB) invoker.AddCommand(concomB) invoker.ExecuteCommand() } ~~~