Re: [go-nuts] NTFS deduplicated files changed from regular to symlink in go 1.21

2023-09-21 Thread Ian Lance Taylor
[ + Quin Muntal ] On Thu, Sep 21, 2023 at 10:34 AM Simon Frei wrote: > > Hi, > > We got a report in syncthing that some files fail to sync on an ntfs > filesystem with deduplication enabled after upgrading the app: > https://github.com/syncthing/syncthing/issues/9120 > The only change relevant

Re: [go-nuts] Go 1.21.0 panics on macos ventura 13.5.2

2023-09-21 Thread Ian Lance Taylor
On Thu, Sep 21, 2023 at 2:16 PM Pierre Laplante wrote: > > Running make planic with: > > fatal error: forcegc: phase error Note for mailing list: this was reported as https://go.dev/issue/63151. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" gro

[go-nuts] Go 1.21.0 panics on macos ventura 13.5.2

2023-09-21 Thread Pierre Laplante
main.go: package main import "plugin" func main() { p, err := plugin.Open("../my_plugin/my_plugin.so") if err != nil { panic(err) } v, err := p.Lookup("V") if err != nil { panic(err) } f, err := p.Lookup("F") if err != nil { panic(err) } *v.(*int) = 7 f.(func())() // prints "Hello, number 7" }

[go-nuts] Re: golang splitting string by space but considering quoted section as a single part

2023-09-21 Thread Albert Li
// SplitString split string with a rune comma ignore quoted func SplitString(str string, r rune) []string { quoted := false return strings.FieldsFunc(str, func(r1 rune) bool { if r1 == '\'' { quoted = !quoted } return !quoted && r1 == r }) } // TestSpitString test case func TestSpitString(t *testin

[go-nuts] NTFS deduplicated files changed from regular to symlink in go 1.21

2023-09-21 Thread Simon Frei
Hi, We got a report in syncthing that some files fail to sync on an ntfs filesystem with deduplication enabled after upgrading the app: https://github.com/syncthing/syncthing/issues/9120 The only change relevant to filesystem handling there was going from go1.20 to go1.21. Debug logging shows t

Re: [go-nuts] Encrypting a small secret using curve25519

2023-09-21 Thread Karlovsky Alexey
You can use CMS encryption (part of https://datatracker.ietf.org/doc/html/rfc5652) For example you can try https://github.com/mozilla-services/pkcs7 In CMS you use a public key to encrypt the generated intermediate symmetric key (content encryption key) and the receiver can decrypt this key and the

[go-nuts] Re: Why doesn't the database/sql package in Go support using placeholders "?" to replace the database name and username in SQL statements?

2023-09-21 Thread John Zh
Thanks for your reply. So does substituting placeholders in the driver still involve pre-compiling the SQL statement to prevent SQL injection? Acutally I am more concerned about security aspects rather than performance overhead. 在2023年9月19日星期二 UTC+8 07:45:35 写道: > Hi. I'm maintainer of go-mysql-

[go-nuts] Re: Why doesn't the database/sql package in Go support using placeholders "?" to replace the database name and username in SQL statements?

2023-09-21 Thread John Zh
Thanks for your reply. I understand now that the issue does not lie with the database/sql interface. It appears to be a limitation on the usage of placeholders in MySQL. 在2023年9月18日星期一 UTC+8 20:27:11 写道: > Or else it's a prepared statement which gets invoked with parameters. > > Mysql's own docu

[go-nuts] Re: Why doesn't the database/sql package in Go support using placeholders "?" to replace the database name and username in SQL statements?

2023-09-21 Thread John Zh
Thanks for your reply. You have deepened my understanding of placeholders. It seems to be the limitations of using placeholders in MySQL. 在2023年9月18日星期一 UTC+8 20:01:52 写道: > A thing, that it may be valuable to explain further, is that Go's > "database/sql" doesn't come with a built-in query buil