> So this is like filling a function pointer table at runtime (application 
startup)

Why not simply:

var Init func(InitFlags) bool
func init() {
    libSDL, _ := purego.Dlopen(libraryFileName, purego.RTLD_LAZY)
    purego.RegisterLibFunc(&Init, libSDL, "SDL_Init")
}

e.g. https://go.dev/play/p/X6LGwo9cAkH

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/74618436-82e1-4b4d-9061-0db50b949b4cn%40googlegroups.com.

Reply via email to