I'm curious what the reason behind this error is, and why it is based off 
of the path to the file the plugin was generated from, rather than 
something like a hash of the contents of the file (or the path of the .so 
file itself). To me it seems wrong to use the filepath because it means 
that you _can_ load the same plugin twice just by renaming the .go file 
that the .so file was generated from.

On the other hand, if the .go file is modified, then you would ostensibly 
be generating a different plugin, but Go will block the .so file from being 
opened.

The reason I ask is because it seems to me that the following should work:

1. Create a plugin: test.go
2. build it into a file called test.so: `go build -buildmode=plugin -o 
test.so ./test.go`
3. modify the plugin (test.go)
4. rebuild into a file called test2.so `go build -buildmode=plugin -o 
test2.so ./test.go`. This is done so that the results of running test.so vs 
test2.so can be compared


Additionally, to me it seems like the following *shouldn't* work, because 
it is in fact the exact same plugin being built twice:

go build -buildmode=plugin -o test.so test.go &&
cp test.go test2.go &&
go build -buildmode=plugin -o test2.so test2.go

In the above example, Go allows test.so & test2.so to both be opened even 
though the contents of the plugin is the same.

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to