Load package dynamically

前端 未结 5 1750
-上瘾入骨i
-上瘾入骨i 2020-12-15 03:03

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 behaviou

5条回答
  •  情话喂你
    2020-12-15 03:38

    No, Go doesn't support dynamically loaded libraries.

    Your best bet is to start the plugin as its own executable and communicate with it through sockets or via stdin/stdout.

    2017 update

    This answer is no longer true, Go now supports plugins.

提交回复
热议问题