I created a shared library from install -linkshared -buildmode=shared cavwrapperlib with option.
I have written init method in it. and I have loaded this library with application and compiled my application with go build -linkshared main.go
how can I invoke library method without calling them application same as C support attribute((constructor))
//cavwrapperlib.so
package cavwrapperlib
import “fmt”
func init() {
fmt.Println(“Init called”)
}
package main
import “cavwrapperlib”
func main(){
fmt.Println(“inside main”)
}