Following this tutorial and the github repo I understood the use of plugins.
The tutorial compiles each file separately into so files.
go build -buildmode=plugin -o eng/eng.so eng/greeter.go
go build -buildmode=plugin -o chi/chi.so chi/greeter.go
How can I merge two files into a single .so file? I tried following command by separating files through space
go build -buildmode=plugin -o bin/langs.so src/test/eng/greeter.go src/test/chi/greeter.go
The error:
named files must all be in one directory; have src/test/eng/ and src/test/chi/
The idea is to have a single .so files from different packages.
Edit: I guess the follow up question would be how to combine all .so
files into one archive if one has several packages of a library and go only allows one .so
file per package.