But if you remove the reference to regexp/syntax in the top-level main.go,
then it also works fine (with no change to the plugin code itself).
On Tuesday, 5 September 2023 at 20:05:58 UTC+1 Howard C. Shaw III wrote:
> It looks to me like the regexp package has an func init() that never gets
> c
It looks to me like the regexp package has an func init() that never gets
called when Re is only imported in a plugin, which is why it works when you
uncomment the lines that use regexp in the main package.
Howard
--
You received this message because you are subscribed to the Google Groups
"g
I want to second what Ozan has said, use *sftp.Client not sftp.Client, but
I want to throw out a couple of words about that.
First, the documentation specifically warns against copying Mutex. So you
need to be fairly certain that no mutexes are used in a struct before
using value semantics. An
Slightly simplified version:
==> go.mod <==
module example.com
go 1.20
==> main.go <==
package main
import (
"plugin"
"regexp/syntax"
)
func main() {
if syntax.Perl != 212 {
panic("Unexpected flags")
}
p, err := plugin.Open("p1.so")
if err != nil {
panic(err)
}
s, err := p.Lookup("F")
if err
I forgot to include
==> go.mod <==
module example.com
go 1.20
--
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.
To view
I have been able to replicate the OP's problem with go 1.21.0
==> main.go <==
package main
import (
"plugin"
//"regexp"
"regexp/syntax"
)
func main() {
//_, _ = regexp.Compile(`\w+`)
p, err := plugin.Open("p1.so")
if err != nil {
panic(err)
}
s, err := p.Lookup("F")
if err != nil {
panic(err)
}