Init() like function in library build with -buildmode=shared

While it is possible to invoke the init() function when a Go library is built with the -buildmode=c-shared, I can’t seem to invoke the same when the -buildmode=shared. Is there any other function like init() which will automatically get called?

I don’t think there is, but I’m wondering what you are trying to achieve.

I want to do it for the go plugin and not for buildmode=shared. The purpose is to initialize some parameters in the plugin.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.