This repo has a sample on how Go plugins can be used to accomplish a hotswap of functionality.
- Clone the repository
- Open a terminal, switch to the cloned directory and type in -
go run tester.go
to begin. - You can drop in a .so file (which has a
Machine
symbol that implementsDoSomething
) to thelibFolder
directory - The test utility which watches the
libFolder
loads the plugin and executes theDoSomething
function