Load package dynamically

前端 未结 5 1740
-上瘾入骨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:35

    Just do these,create a codegen that reads the configuration, generates a basic go file with the packages loaded in order and then execute that, compile languages won't nor provide dynamic loading, even dart suffers in a way,simple just read your configuration file then create a temporary file with the necessary codes to load up and communicate with sockets or http

提交回复
热议问题