问题描述

是否可以在运行时加载特定的包? 我想要一种插件,其中每个插件具有与其他功能相同的功能,但具有不同的行为,并且根据配置文件加载一个或另一个。 谢谢。

Is it possible to load a specific package during runtime? I want to have a kind of plugins where each one has the same functions than the others but with different behaviour, and depending on the configuration file, load one or other. Thanks.

推荐答案

 exec.Command(go ,运行,文件...).Run()
exec.Command("go", "run", files…).Run()

你会看到一些类似的代码