0

I am working on a new Golang Cobra CLI, which handles several commands. I later on found out that there is already an existing Golang Cobra CLI that handles some commands that I will be covering in the new CLI, but not all. In other words, my new CLI cover all commands of the existing CLI with some extra commands.

Is it possible for us to link the existing CLI into the new CLI?

Note: I am not sure whether "link" is the best word to describe what I am interested to do. In case this is already answered before on SA, feel free to mark this as duplicate.

4

1 回答 1

1

我认为你最好的选择是用更少的命令分叉另一个 repo,然后编辑它以添加你的命令。假设两个存储库都是开源的。

如果您的代码是封闭源代码,那么您可以将其 repo 作为依赖项引入。

于 2022-03-01T14:31:27.567 回答