Is it possible to dynamically load Go code?

后端 未结 3 549
北荒
北荒 2020-12-30 05:50

As the title says I want to dynamically load a Go package (or not) based on information only available at run time.

The objective is to allow the user to extend the

3条回答
  •  粉色の甜心
    2020-12-30 06:32

    Well, there is a dlopen-package for Go -- so, at least, you can load your shared library (DLL) into your Go-program now... You'll, probably, have to code your extension in C, C++ or something else, for which you have tools capable of generating shared libraries.

提交回复
热议问题