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