package main
import "fmt"
var V int
func F() { fmt.Printf("Hello, number %d\n", V) }
This can be built with:
go build -buildmode=plugin
And then loaded and used from your application:
p, err := plugin.Open("plugin_name.so")
if err != nil {
panic(e...