Home > Back-end >  The 2020-10-02: golang how to write a plugin?
The 2020-10-02: golang how to write a plugin?

Time:10-02

The 2020-10-02: golang how to write a plugin? # # f greatly architects a daily topic

CodePudding user response:

Golang plugin is equivalent to the dynamic link library (so), but there are some limitations, such as plug-ins and main program of the coupling is higher, the plug-in and the main program compile link need the same go version, etc.),
The plug-in development according to the official documentation developed and
Is the need to pay attention to the
1 package (package) must be the main
2 and there cannot be the main function
Three must have can export (access) interface method or variable
4 at compile time, add - buildmode=plugin options
  • Related