[go-nuts] Re: Is overwriting contents of pointer field the expected behavior of json.Unmarshal?

2022-08-22 Thread Tamás Gulácsi
"To unmarshal a JSON array into a slice, Unmarshal resets the slice length to zero and then appends each element to the slice." And you gave "&newElems" to Unmarshal twice. So it zeroed the length, and appended the second time, effectively overwriting the first (and only) element. This is intend

[go-nuts] cgo binding copies data twice, necessary?

2022-08-22 Thread David Stainton
I recently wrote cgo bindings to the CTIDH C library (a bleeding edge post quantum non-interactive key exchange) copies the data twice. First in the call to C.CBytes and then again in the assignment to p.privateKey via that pointer dereference. The performance hit for the twice copy is not real

[go-nuts] Is overwriting contents of pointer field the expected behavior of json.Unmarshal?

2022-08-22 Thread Mateusz Wójcik
The test code below demonstrates a json.Unmarshal behavior that I find unexpected. The code unmarshals arrays of objects with pointers fields. All unmarshaled objects end up sharing the same pointer value, effectively overwriting the contents of the pointer. package unmarshall import ( "en

Re: [go-nuts] Is Go a security malware risk?

2022-08-22 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2022-08-22 at 06:15 -0700, 'Gopher-Insane' via golang-nuts wrote: > Hi > > So our security team has raised a concern with Go and malware. The > link that was sent to me > was https://securityboulevard.com/2021/09/behavior-based-detection-ca > n-stop-exotic-malware/.  > I reached out to Bill

Re: [go-nuts] Is Go a security malware risk?

2022-08-22 Thread 'Gopher-Insane' via golang-nuts
I think the concern is in using the language to wrap malware that would otherwise be detected. So not the outcome of the malware but the hiding of it. On Monday, 22 August 2022 at 14:47:55 UTC+1 Thomas Bushnell, BSG wrote: > This is not a problem that arises from *you *using Go; it's a problem

Re: [go-nuts] Is Go a security malware risk?

2022-08-22 Thread 'Gopher-Insane' via golang-nuts
Great responses, thank you. That has helped. On Monday, 22 August 2022 at 14:47:55 UTC+1 Thomas Bushnell, BSG wrote: > This is not a problem that arises from *you *using Go; it's a problem > arising from the fact that *other *people are using Go to write malware, > and bad security techniques

[go-nuts] Re: Go 1.19 average goroutine stack

2022-08-22 Thread tapi...@gmail.com
On Saturday, August 20, 2022 at 10:58:10 PM UTC+8 tapi...@gmail.com wrote: > On Friday, August 19, 2022 at 12:14:55 AM UTC+8 k...@google.com wrote: > >> On Wednesday, August 17, 2022 at 8:18:35 PM UTC-7 tapi...@gmail.com >> wrote: >> >>> I'm a bit wondering about how the following case will be

[go-nuts] Re: Java to Go converter - 2

2022-08-22 Thread alex-coder
Hi, sorry for delay. Despite my great interest in this task, I can not spend a lot of time on the project. But you're right, everything I've posted on go-nuts shows that conversion is very possible and in the same context that you're considering, if I understand you correctly of course . So far

Re: [go-nuts] Is Go a security malware risk?

2022-08-22 Thread 'Thomas Bushnell BSG' via golang-nuts
This is not a problem that arises from *you *using Go; it's a problem arising from the fact that *other *people are using Go to write malware, and bad security techniques are unable to deal with it. You could stop using Go entirely and it wouldn't change the dynamic. The better course is not to re

Re: [go-nuts] Is Go a security malware risk?

2022-08-22 Thread 'Axel Wagner' via golang-nuts
On Mon, Aug 22, 2022 at 3:31 PM 'Gopher-Insane' via golang-nuts < golang-nuts@googlegroups.com> wrote: > So our security team has raised a concern with Go and malware. The link > that was sent to me was > https://securityboulevard.com/2021/09/behavior-based-detection-can-stop-exotic-malware/ > . >

[go-nuts] Is Go a security malware risk?

2022-08-22 Thread 'Gopher-Insane' via golang-nuts
Hi So our security team has raised a concern with Go and malware. The link that was sent to me was https://securityboulevard.com/2021/09/behavior-based-detection-can-stop-exotic-malware/ . I reached out to Bill Kennedy on Twitter who disagreed that Go was a problem. Said it was worth posting h