我想以这种方式链接命令:
var cmdGroups = []*commands.CmdGroup {
commands.MakeCmdGroup("foo", cmd1, cmd2, cmd3).AddConstraint(cmd1, cmd2).AddConstraint(cmd2, cmd1, cmd3),
commands.MakeCmdGroup("bar", cmd1, cmd4).AddConstraint(cmd1, cmd4),
}
出于 80 列长度的原因,我想将我的链分成几行,但 Go 不会让我编译这个:
var cmdGroups = []*commands.CmdGroup {
commands.MakeCmdGroup("foo", cmd1, cmd2, cmd3)
.AddConstraint(cmd1, cmd2)
.AddConstraint(cmd2, cmd1, cmd3),
commands.MakeCmdGroup("bar", cmd1, cmd4)
.AddConstraint(cmd1, cmd4),
}
我能做些什么 ?